LBGetPutImpl.mesa
Please do not edit this file.
It was generated using CedarRPCGen.
DIRECTORY
Rope,
SunRPC,
UT,
UTGetPut,
LB,
LBGetPut;
LBGetPutImpl: CEDAR PROGRAM
IMPORTS SunRPC, UTGetPut EXPORTS LB, LBGetPut =
BEGIN
Handle: TYPE = SunRPC.Handle;
ROPE: TYPE = Rope.ROPE;
ReturnCodesNames: PUBLIC ARRAY LB.ReturnCodes OF ROPE ← [
"iluSuccess",
"iluECantExportService",
"EError"
];
GetReturnCodes: PUBLIC PROC[h: Handle] RETURNS [res: LB.ReturnCodes] = {
res ← VAL[SunRPC.GetInt32[h]];
};
PutReturnCodes: PUBLIC PROC[h: Handle, in: LB.ReturnCodes] = {
SunRPC.PutInt32[h, ORD[in]];
};
GetLocRoom: PUBLIC PROC[h: Handle] RETURNS [res: LB.LocRoom] = {
res ← SunRPC.GetRope[h];
};
PutLocRoom: PUBLIC PROC[h: Handle, in: LB.LocRoom] = {
SunRPC.PutRope[h, in];
};
GetLocXYZ: PUBLIC PROC[h: Handle] RETURNS [res: LB.LocXYZ] = {
res.x ← SunRPC.GetDReal[h];
res.y ← SunRPC.GetDReal[h];
res.z ← SunRPC.GetDReal[h];
};
PutLocXYZ: PUBLIC PROC[h: Handle, in: LB.LocXYZ] = {
SunRPC.PutDReal[h, in.x];
SunRPC.PutDReal[h, in.y];
SunRPC.PutDReal[h, in.z];
};
LocationDescriminationValuesNames: PUBLIC ARRAY LB.LocationDescriminationValues OF ROPE ← [
"LocationVLocRoom",
"LocationVLocXYZ"
];
GetLocationDescriminationValues: PUBLIC PROC[h: Handle] RETURNS [res: LB.LocationDescriminationValues] = {
res ← VAL[SunRPC.GetInt32[h]];
};
PutLocationDescriminationValues: PUBLIC PROC[h: Handle, in: LB.LocationDescriminationValues] = {
SunRPC.PutInt32[h, ORD[in]];
};
GetLocation: PUBLIC PROC[h: Handle] RETURNS [res: LB.Location] = {
tag: LB.LocationDescriminationValues;
tag ← GetLocationDescriminationValues[h];
SELECT tag FROM
LocationVLocRoom => {
v: REF LocationVLocRoom LB.LocationObject ← NEW[LocationVLocRoom LB.LocationObject];
v.vLocRoom ← SunRPC.GetRope[h];
res ← v;
};
LocationVLocXYZ => {
v: REF LocationVLocXYZ LB.LocationObject ← NEW[LocationVLocXYZ LB.LocationObject];
v.vLocXYZ ← GetLocXYZ[h];
res ← v;
};
ENDCASE => NULL;
};
PutLocation: PUBLIC PROC[h: Handle, in: LB.Location] = {
PutLocationDescriminationValues[h, in.descriminator];
SELECT in.descriminator FROM
LocationVLocRoom => {
v: REF LocationVLocRoom LB.LocationObject ← NARROW[in];
SunRPC.PutRope[h, v.vLocRoom];
};
LocationVLocXYZ => {
v: REF LocationVLocXYZ LB.LocationObject ← NARROW[in];
PutLocXYZ[h, v.vLocXYZ];
};
ENDCASE => NULL;
};
GetSphere: PUBLIC PROC[h: Handle] RETURNS [res: LB.Sphere] = {
res.center ← GetLocXYZ[h];
res.radius ← SunRPC.GetDReal[h];
};
PutSphere: PUBLIC PROC[h: Handle, in: LB.Sphere] = {
PutLocXYZ[h, in.center];
SunRPC.PutDReal[h, in.radius];
};
BasicVolumeDescriminationValuesNames: PUBLIC ARRAY LB.BasicVolumeDescriminationValues OF ROPE ← [
"BasicVolumeVLocRoom",
"BasicVolumeVSphere"
];
GetBasicVolumeDescriminationValues: PUBLIC PROC[h: Handle] RETURNS [res: LB.BasicVolumeDescriminationValues] = {
res ← VAL[SunRPC.GetInt32[h]];
};
PutBasicVolumeDescriminationValues: PUBLIC PROC[h: Handle, in: LB.BasicVolumeDescriminationValues] = {
SunRPC.PutInt32[h, ORD[in]];
};
GetBasicVolume: PUBLIC PROC[h: Handle] RETURNS [res: LB.BasicVolume] = {
tag: LB.BasicVolumeDescriminationValues;
tag ← GetBasicVolumeDescriminationValues[h];
SELECT tag FROM
BasicVolumeVLocRoom => {
v: REF BasicVolumeVLocRoom LB.BasicVolumeObject ← NEW[BasicVolumeVLocRoom LB.BasicVolumeObject];
v.vLocRoom ← SunRPC.GetRope[h];
res ← v;
};
BasicVolumeVSphere => {
v: REF BasicVolumeVSphere LB.BasicVolumeObject ← NEW[BasicVolumeVSphere LB.BasicVolumeObject];
v.vSphere ← GetSphere[h];
res ← v;
};
ENDCASE => NULL;
};
PutBasicVolume: PUBLIC PROC[h: Handle, in: LB.BasicVolume] = {
PutBasicVolumeDescriminationValues[h, in.descriminator];
SELECT in.descriminator FROM
BasicVolumeVLocRoom => {
v: REF BasicVolumeVLocRoom LB.BasicVolumeObject ← NARROW[in];
SunRPC.PutRope[h, v.vLocRoom];
};
BasicVolumeVSphere => {
v: REF BasicVolumeVSphere LB.BasicVolumeObject ← NARROW[in];
PutSphere[h, v.vSphere];
};
ENDCASE => NULL;
};
GetVolume: PUBLIC PROC[h: Handle] RETURNS [res: LB.Volume] = {
{
len: INT ← SunRPC.GetInt32[h];
res ← NEW[LB.SeqType0Object[len]];
FOR i: INT IN [0..len) DO
res[i] ← GetBasicVolume[h];
ENDLOOP;
};
};
PutVolume: PUBLIC PROC[h: Handle, in: LB.Volume] = {
SunRPC.PutInt32[h, in.size];
FOR i: INT IN [0..in.size) DO
PutBasicVolume[h, in[i]];
ENDLOOP;
};
GetLocatedObject: PUBLIC PROC[h: Handle] RETURNS [res: LB.LocatedObject] = {
res.o ← UTGetPut.GetObjct[h];
res.l ← GetLocation[h];
};
PutLocatedObject: PUBLIC PROC[h: Handle, in: LB.LocatedObject] = {
UTGetPut.PutObjct[h, in.o];
PutLocation[h, in.l];
};
GetLocatedObjectSet: PUBLIC PROC[h: Handle] RETURNS [res: LB.LocatedObjectSet] = {
{
len: INT ← SunRPC.GetInt32[h];
res ← NEW[LB.SeqType1Object[len]];
FOR i: INT IN [0..len) DO
res[i] ← GetLocatedObject[h];
ENDLOOP;
};
};
PutLocatedObjectSet: PUBLIC PROC[h: Handle, in: LB.LocatedObjectSet] = {
SunRPC.PutInt32[h, in.size];
FOR i: INT IN [0..in.size) DO
PutLocatedObject[h, in[i]];
ENDLOOP;
};
ChangeOperationNames: PUBLIC ARRAY LB.ChangeOperation OF ROPE ← [
"Add",
"Delete"
];
GetChangeOperation: PUBLIC PROC[h: Handle] RETURNS [res: LB.ChangeOperation] = {
res ← VAL[SunRPC.GetInt32[h]];
};
PutChangeOperation: PUBLIC PROC[h: Handle, in: LB.ChangeOperation] = {
SunRPC.PutInt32[h, ORD[in]];
};
ErrorTypeNames: PUBLIC ARRAY LB.ErrorType OF ROPE ← [
"BadLoc",
"BadObject",
"BadCallback",
"BadRoom",
"BadRock"
];
GetErrorType: PUBLIC PROC[h: Handle] RETURNS [res: LB.ErrorType] = {
res ← VAL[SunRPC.GetInt32[h]];
};
PutErrorType: PUBLIC PROC[h: Handle, in: LB.ErrorType] = {
SunRPC.PutInt32[h, ORD[in]];
};
GetAtLocargs: PUBLIC PROC[h: Handle] RETURNS [res: LB.AtLocargs] = {
res.o ← UTGetPut.GetObjct[h];
res.loc ← GetLocation[h];
};
PutAtLocargs: PUBLIC PROC[h: Handle, in: LB.AtLocargs] = {
UTGetPut.PutObjct[h, in.o];
PutLocation[h, in.loc];
};
GetAtLocreturn: PUBLIC PROC[h: Handle] RETURNS [res: LB.AtLocreturn] = {
tag: LB.ReturnCodes;
tag ← GetReturnCodes[h];
SELECT tag FROM
EError => {
v: REF EError LB.AtLocreturnObject ← NEW[EError LB.AtLocreturnObject];
v.EErrorValue ← GetErrorType[h];
res ← v;
};
iluSuccess => {
v: REF iluSuccess LB.AtLocreturnObject ← NEW[iluSuccess LB.AtLocreturnObject];
res ← v;
};
ENDCASE => NULL;
};
PutAtLocreturn: PUBLIC PROC[h: Handle, in: LB.AtLocreturn] = {
PutReturnCodes[h, in.returnCode];
SELECT in.returnCode FROM
EError => {
v: REF EError LB.AtLocreturnObject ← NARROW[in];
PutErrorType[h, v.EErrorValue];
};
iluSuccess => {
v: REF iluSuccess LB.AtLocreturnObject ← NARROW[in];
};
ENDCASE => NULL;
};
GetRemoveObjectargs: PUBLIC PROC[h: Handle] RETURNS [res: LB.RemoveObjectargs] = {
res.o ← UTGetPut.GetObjct[h];
};
PutRemoveObjectargs: PUBLIC PROC[h: Handle, in: LB.RemoveObjectargs] = {
UTGetPut.PutObjct[h, in.o];
};
GetRemoveObjectreturn: PUBLIC PROC[h: Handle] RETURNS [res: LB.RemoveObjectreturn] = {
tag: LB.ReturnCodes;
tag ← GetReturnCodes[h];
SELECT tag FROM
EError => {
v: REF EError LB.RemoveObjectreturnObject ← NEW[EError LB.RemoveObjectreturnObject];
v.EErrorValue ← GetErrorType[h];
res ← v;
};
iluSuccess => {
v: REF iluSuccess LB.RemoveObjectreturnObject ← NEW[iluSuccess LB.RemoveObjectreturnObject];
v.returnValue ← SunRPC.GetCard32[h];
res ← v;
};
ENDCASE => NULL;
};
PutRemoveObjectreturn: PUBLIC PROC[h: Handle, in: LB.RemoveObjectreturn] = {
PutReturnCodes[h, in.returnCode];
SELECT in.returnCode FROM
EError => {
v: REF EError LB.RemoveObjectreturnObject ← NARROW[in];
PutErrorType[h, v.EErrorValue];
};
iluSuccess => {
v: REF iluSuccess LB.RemoveObjectreturnObject ← NARROW[in];
SunRPC.PutCard32[h, v.returnValue];
};
ENDCASE => NULL;
};
GetFindObjectsargs: PUBLIC PROC[h: Handle] RETURNS [res: LB.FindObjectsargs] = {
res.locs ← GetVolume[h];
res.types ← UTGetPut.GetObjectTypeSet[h];
};
PutFindObjectsargs: PUBLIC PROC[h: Handle, in: LB.FindObjectsargs] = {
PutVolume[h, in.locs];
UTGetPut.PutObjectTypeSet[h, in.types];
};
GetFindObjectsreturn: PUBLIC PROC[h: Handle] RETURNS [res: LB.FindObjectsreturn] = {
tag: LB.ReturnCodes;
tag ← GetReturnCodes[h];
SELECT tag FROM
EError => {
v: REF EError LB.FindObjectsreturnObject ← NEW[EError LB.FindObjectsreturnObject];
v.EErrorValue ← GetErrorType[h];
res ← v;
};
iluSuccess => {
v: REF iluSuccess LB.FindObjectsreturnObject ← NEW[iluSuccess LB.FindObjectsreturnObject];
v.returnValue ← GetLocatedObjectSet[h];
res ← v;
};
ENDCASE => NULL;
};
PutFindObjectsreturn: PUBLIC PROC[h: Handle, in: LB.FindObjectsreturn] = {
PutReturnCodes[h, in.returnCode];
SELECT in.returnCode FROM
EError => {
v: REF EError LB.FindObjectsreturnObject ← NARROW[in];
PutErrorType[h, v.EErrorValue];
};
iluSuccess => {
v: REF iluSuccess LB.FindObjectsreturnObject ← NARROW[in];
PutLocatedObjectSet[h, v.returnValue];
};
ENDCASE => NULL;
};
GetNotifyOfObjectsargs: PUBLIC PROC[h: Handle] RETURNS [res: LB.NotifyOfObjectsargs] = {
res.locs ← GetVolume[h];
res.types ← UTGetPut.GetObjectTypeSet[h];
res.who ← SunRPC.GetRope[h];
res.rock ← UTGetPut.GetOPAQUE[h];
};
PutNotifyOfObjectsargs: PUBLIC PROC[h: Handle, in: LB.NotifyOfObjectsargs] = {
PutVolume[h, in.locs];
UTGetPut.PutObjectTypeSet[h, in.types];
SunRPC.PutRope[h, in.who];
UTGetPut.PutOPAQUE[h, in.rock];
};
GetNotifyOfObjectsreturn: PUBLIC PROC[h: Handle] RETURNS [res: LB.NotifyOfObjectsreturn] = {
tag: LB.ReturnCodes;
tag ← GetReturnCodes[h];
SELECT tag FROM
EError => {
v: REF EError LB.NotifyOfObjectsreturnObject ← NEW[EError LB.NotifyOfObjectsreturnObject];
v.EErrorValue ← GetErrorType[h];
res ← v;
};
iluSuccess => {
v: REF iluSuccess LB.NotifyOfObjectsreturnObject ← NEW[iluSuccess LB.NotifyOfObjectsreturnObject];
res ← v;
};
ENDCASE => NULL;
};
PutNotifyOfObjectsreturn: PUBLIC PROC[h: Handle, in: LB.NotifyOfObjectsreturn] = {
PutReturnCodes[h, in.returnCode];
SELECT in.returnCode FROM
EError => {
v: REF EError LB.NotifyOfObjectsreturnObject ← NARROW[in];
PutErrorType[h, v.EErrorValue];
};
iluSuccess => {
v: REF iluSuccess LB.NotifyOfObjectsreturnObject ← NARROW[in];
};
ENDCASE => NULL;
};
GetRemoveObjectCallbackargs: PUBLIC PROC[h: Handle] RETURNS [res: LB.RemoveObjectCallbackargs] = {
res.who ← SunRPC.GetRope[h];
res.rock ← UTGetPut.GetOPAQUE[h];
};
PutRemoveObjectCallbackargs: PUBLIC PROC[h: Handle, in: LB.RemoveObjectCallbackargs] = {
SunRPC.PutRope[h, in.who];
UTGetPut.PutOPAQUE[h, in.rock];
};
GetRemoveObjectCallbackreturn: PUBLIC PROC[h: Handle] RETURNS [res: LB.RemoveObjectCallbackreturn] = {
tag: LB.ReturnCodes;
tag ← GetReturnCodes[h];
SELECT tag FROM
EError => {
v: REF EError LB.RemoveObjectCallbackreturnObject ← NEW[EError LB.RemoveObjectCallbackreturnObject];
v.EErrorValue ← GetErrorType[h];
res ← v;
};
iluSuccess => {
v: REF iluSuccess LB.RemoveObjectCallbackreturnObject ← NEW[iluSuccess LB.RemoveObjectCallbackreturnObject];
res ← v;
};
ENDCASE => NULL;
};
PutRemoveObjectCallbackreturn: PUBLIC PROC[h: Handle, in: LB.RemoveObjectCallbackreturn] = {
PutReturnCodes[h, in.returnCode];
SELECT in.returnCode FROM
EError => {
v: REF EError LB.RemoveObjectCallbackreturnObject ← NARROW[in];
PutErrorType[h, v.EErrorValue];
};
iluSuccess => {
v: REF iluSuccess LB.RemoveObjectCallbackreturnObject ← NARROW[in];
};
ENDCASE => NULL;
};
GetNotifyObjectsCallbackargs: PUBLIC PROC[h: Handle] RETURNS [res: LB.NotifyObjectsCallbackargs] = {
res.rock ← UTGetPut.GetOPAQUE[h];
res.os ← GetLocatedObjectSet[h];
res.change ← GetChangeOperation[h];
};
PutNotifyObjectsCallbackargs: PUBLIC PROC[h: Handle, in: LB.NotifyObjectsCallbackargs] = {
UTGetPut.PutOPAQUE[h, in.rock];
PutLocatedObjectSet[h, in.os];
PutChangeOperation[h, in.change];
};
GetNotifyObjectsCallbackreturn: PUBLIC PROC[h: Handle] RETURNS [res: LB.NotifyObjectsCallbackreturn] = {
tag: LB.ReturnCodes;
tag ← GetReturnCodes[h];
SELECT tag FROM
EError => {
v: REF EError LB.NotifyObjectsCallbackreturnObject ← NEW[EError LB.NotifyObjectsCallbackreturnObject];
v.EErrorValue ← GetErrorType[h];
res ← v;
};
iluSuccess => {
v: REF iluSuccess LB.NotifyObjectsCallbackreturnObject ← NEW[iluSuccess LB.NotifyObjectsCallbackreturnObject];
res ← v;
};
ENDCASE => NULL;
};
PutNotifyObjectsCallbackreturn: PUBLIC PROC[h: Handle, in: LB.NotifyObjectsCallbackreturn] = {
PutReturnCodes[h, in.returnCode];
SELECT in.returnCode FROM
EError => {
v: REF EError LB.NotifyObjectsCallbackreturnObject ← NARROW[in];
PutErrorType[h, v.EErrorValue];
};
iluSuccess => {
v: REF iluSuccess LB.NotifyObjectsCallbackreturnObject ← NARROW[in];
};
ENDCASE => NULL;
};
END.