LBClientImpl.mesa
Please do not edit this file.
It was generated using CedarRPCGen.
DIRECTORY
Rope,
SunRPC,
SunRPCAuth,
UT,
UTGetPut,
LBGetPut,
LB;
LBClientImpl: CEDAR PROGRAM
IMPORTS SunRPC, UTGetPut, LBGetPut
EXPORTS LB =
BEGIN
ROPE: TYPE = Rope.ROPE;
defaultTimeout: CARDINAL ← 2000;
defaultRetries: CARDINAL ← 5;
MakeLB1Client: PUBLIC PROC [h: SunRPC.Handle,
c: SunRPCAuth.Conversation] RETURNS [LB.LB1] ~ {
RETURN [NEW[LB.LB1Object ← [
servernoop1,
atloc1,
removeobject1,
findobjects1,
notifyofobjects1,
removeobjectcallback1,
h, c, NIL]]];
};
servernoop1: PROC[o: LB.LB1] = {
SunRPC.StartCall[o.rpcHandle, o.rpcConversation,
LB.LBPrognum, 1, 0];
[] ← SunRPC.SendCallAndReceiveReply[o.rpcHandle, defaultTimeout, defaultRetries];
SunRPC.ReleaseReply[o.rpcHandle];
};
atloc1: PROC[o0: LB.LB1,
o: UT.Objct,
loc: LB.Location]
RETURNS [res: LB.AtLocreturn] = {
SunRPC.StartCall[o0.rpcHandle, o0.rpcConversation,
LB.LBPrognum, 1, 1];
UTGetPut.PutObjct[o0.rpcHandle, o];
LBGetPut.PutLocation[o0.rpcHandle, loc];
[] ← SunRPC.SendCallAndReceiveReply[o0.rpcHandle, defaultTimeout, defaultRetries];
res ← LBGetPut.GetAtLocreturn[o0.rpcHandle];
SunRPC.ReleaseReply[o0.rpcHandle];
};
removeobject1: PROC[o0: LB.LB1,
o: UT.Objct]
RETURNS [res: LB.RemoveObjectreturn] = {
SunRPC.StartCall[o0.rpcHandle, o0.rpcConversation,
LB.LBPrognum, 1, 2];
UTGetPut.PutObjct[o0.rpcHandle, o];
[] ← SunRPC.SendCallAndReceiveReply[o0.rpcHandle, defaultTimeout, defaultRetries];
res ← LBGetPut.GetRemoveObjectreturn[o0.rpcHandle];
SunRPC.ReleaseReply[o0.rpcHandle];
};
findobjects1: PROC[o: LB.LB1,
locs: LB.Volume,
types: UT.ObjectTypeSet]
RETURNS [res: LB.FindObjectsreturn] = {
SunRPC.StartCall[o.rpcHandle, o.rpcConversation,
LB.LBPrognum, 1, 3];
LBGetPut.PutVolume[o.rpcHandle, locs];
UTGetPut.PutObjectTypeSet[o.rpcHandle, types];
[] ← SunRPC.SendCallAndReceiveReply[o.rpcHandle, defaultTimeout, defaultRetries];
res ← LBGetPut.GetFindObjectsreturn[o.rpcHandle];
SunRPC.ReleaseReply[o.rpcHandle];
};
notifyofobjects1: PROC[o: LB.LB1,
locs: LB.Volume,
types: UT.ObjectTypeSet,
who: ROPE,
rock: UT.OPAQUE]
RETURNS [res: LB.NotifyOfObjectsreturn] = {
SunRPC.StartCall[o.rpcHandle, o.rpcConversation,
LB.LBPrognum, 1, 4];
LBGetPut.PutVolume[o.rpcHandle, locs];
UTGetPut.PutObjectTypeSet[o.rpcHandle, types];
SunRPC.PutRope[o.rpcHandle, who];
UTGetPut.PutOPAQUE[o.rpcHandle, rock];
[] ← SunRPC.SendCallAndReceiveReply[o.rpcHandle, defaultTimeout, defaultRetries];
res ← LBGetPut.GetNotifyOfObjectsreturn[o.rpcHandle];
SunRPC.ReleaseReply[o.rpcHandle];
};
removeobjectcallback1: PROC[o: LB.LB1,
who: ROPE,
rock: UT.OPAQUE]
RETURNS [res: LB.RemoveObjectCallbackreturn] = {
SunRPC.StartCall[o.rpcHandle, o.rpcConversation,
LB.LBPrognum, 1, 5];
SunRPC.PutRope[o.rpcHandle, who];
UTGetPut.PutOPAQUE[o.rpcHandle, rock];
[] ← SunRPC.SendCallAndReceiveReply[o.rpcHandle, defaultTimeout, defaultRetries];
res ← LBGetPut.GetRemoveObjectCallbackreturn[o.rpcHandle];
SunRPC.ReleaseReply[o.rpcHandle];
};
Makecallbacks1Client: PUBLIC PROC [h: SunRPC.Handle,
c: SunRPCAuth.Conversation] RETURNS [LB.callbacks1] ~ {
RETURN [NEW[LB.callbacks1Object ← [
clientnoop1,
notifyobjectscallback1,
h, c, NIL]]];
};
clientnoop1: PROC[o: LB.callbacks1] = {
SunRPC.StartCall[o.rpcHandle, o.rpcConversation,
LB.callbacks, 1, 0];
[] ← SunRPC.SendCallAndReceiveReply[o.rpcHandle, defaultTimeout, defaultRetries];
SunRPC.ReleaseReply[o.rpcHandle];
};
notifyobjectscallback1: PROC[o: LB.callbacks1,
rock: UT.OPAQUE,
os: LB.LocatedObjectSet,
change: LB.ChangeOperation]
RETURNS [res: LB.NotifyObjectsCallbackreturn] = {
SunRPC.StartCall[o.rpcHandle, o.rpcConversation,
LB.callbacks, 1, 6];
UTGetPut.PutOPAQUE[o.rpcHandle, rock];
LBGetPut.PutLocatedObjectSet[o.rpcHandle, os];
LBGetPut.PutChangeOperation[o.rpcHandle, change];
[] ← SunRPC.SendCallAndReceiveReply[o.rpcHandle, defaultTimeout, defaultRetries];
res ← LBGetPut.GetNotifyObjectsCallbackreturn[o.rpcHandle];
SunRPC.ReleaseReply[o.rpcHandle];
};
END.