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,
parent1,
children1,
shortestpaths1,
findnearests1,
findnearestsofkind1,
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];
};
parent1:
PROC[o:
LB.
LB1,
l: ROPE]
RETURNS [res: LB.Parentreturn] = {
SunRPC.StartCall[o.rpcHandle, o.rpcConversation,
LB.LBPrognum, 1, 7];
SunRPC.PutRope[o.rpcHandle, l];
[] ← SunRPC.SendCallAndReceiveReply[o.rpcHandle, defaultTimeout, defaultRetries];
res ← LBGetPut.GetParentreturn[o.rpcHandle];
SunRPC.ReleaseReply[o.rpcHandle];
};
children1:
PROC[o:
LB.
LB1,
l: ROPE]
RETURNS [res: LB.Childrenreturn] = {
SunRPC.StartCall[o.rpcHandle, o.rpcConversation,
LB.LBPrognum, 1, 8];
SunRPC.PutRope[o.rpcHandle, l];
[] ← SunRPC.SendCallAndReceiveReply[o.rpcHandle, defaultTimeout, defaultRetries];
res ← LBGetPut.GetChildrenreturn[o.rpcHandle];
SunRPC.ReleaseReply[o.rpcHandle];
};
shortestpaths1:
PROC[o:
LB.
LB1,
frm: LB.T,
to: LB.T,
wantPaths: CARD32]
RETURNS [res: LB.ShortestPathsreturn] = {
SunRPC.StartCall[o.rpcHandle, o.rpcConversation,
LB.LBPrognum, 1, 9];
LBGetPut.PutT[o.rpcHandle, frm];
LBGetPut.PutT[o.rpcHandle, to];
SunRPC.PutCard32[o.rpcHandle, wantPaths];
[] ← SunRPC.SendCallAndReceiveReply[o.rpcHandle, defaultTimeout, defaultRetries];
res ← LBGetPut.GetShortestPathsreturn[o.rpcHandle];
SunRPC.ReleaseReply[o.rpcHandle];
};
findnearests1:
PROC[o:
LB.
LB1,
frm: LB.T,
to: LB.Set,
wantPaths: CARD32]
RETURNS [res: LB.FindNearestsreturn] = {
SunRPC.StartCall[o.rpcHandle, o.rpcConversation,
LB.LBPrognum, 1, 10];
LBGetPut.PutT[o.rpcHandle, frm];
LBGetPut.PutSet[o.rpcHandle, to];
SunRPC.PutCard32[o.rpcHandle, wantPaths];
[] ← SunRPC.SendCallAndReceiveReply[o.rpcHandle, defaultTimeout, defaultRetries];
res ← LBGetPut.GetFindNearestsreturn[o.rpcHandle];
SunRPC.ReleaseReply[o.rpcHandle];
};
findnearestsofkind1:
PROC[o:
LB.
LB1,
frm: LB.T,
kind: ROPE,
description: UT.ObjectDescription,
wantPaths: CARD32]
RETURNS [res: LB.FindNearestsOfKindreturn] = {
SunRPC.StartCall[o.rpcHandle, o.rpcConversation,
LB.LBPrognum, 1, 11];
LBGetPut.PutT[o.rpcHandle, frm];
SunRPC.PutRope[o.rpcHandle, kind];
UTGetPut.PutObjectDescription[o.rpcHandle, description];
SunRPC.PutCard32[o.rpcHandle, wantPaths];
[] ← SunRPC.SendCallAndReceiveReply[o.rpcHandle, defaultTimeout, defaultRetries];
res ← LBGetPut.GetFindNearestsOfKindreturn[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.