\small\begin{xple}
INTERFACE Store;

IMPORT Data;

CONST Headersize = 8;   (* pointees allocated for the object header *)

PROCEDURE SetSaveProcedure(proc: PROCEDURE());

PROCEDURE SetRestoreProced(proc: PROCEDURE());
(* define the save/restore procedures passed to the Napier POS *)

PROCEDURE Setup():BOOLEAN;
(* start a session with a Napier POS and *)

PROCEDURE CloseStore();
(* stop a session with a Napier POS. Modifications made since the
   last call to Stabilise are not saved *) 

PROCEDURE Statistics();

PROCEDURE RootObject(): Data.Pointer;
(* Return the object identifier of the root object of a POS *) 

PROCEDURE GarbageCollect();
(* Do a full garbage collection of the store*)

PROCEDURE CanModify(key: Data.Pointer): BOOLEAN;
(* Create a shadow copy of a persistent object before altering the
   object. May be called redundantly for the same object. *)
 
PROCEDURE Stabilise();
(* Write all modifications since the last call of this function or the
   start of the session to the POS *)

PROCEDURE KeyToAddress(key: Data.Pointer): Data.Pointer;
(* Determine the virtual memory address of an object, which is used by
   functions of the Memory module *)

PROCEDURE CreateObject(size: Data.Card; numberOfPolys: Data.Card) :Data.Pointer;
(* The size will be rounded up to multiple of PointeesPerPolymorph *)

PROCEDURE DestroyObject(obj: Data.Pointer);
(* -- unused *)

PROCEDURE GetSize(obj: Data.Pointer): Data.Int;
(* Return the size of an object *)

PROCEDURE GetPointee(obj: Data.Pointer; off: Data.Card): Data.Pointee;
(* Return the byte stored at byte offset off. *)

PROCEDURE SetPointee(obj: Data.Pointer; off: Data.Card; pointee: Data.Pointee);
(* Write pointee to byte offset off within the specified object *)

PROCEDURE GetPolymorph(obj: Data.Pointer; off: Data.Card): Data.Polymorph;
(* Return the Polymorph stored at byte offset off. *)

PROCEDURE SetPolymorph(obj: Data.Pointer; off: Data.Card; polymorph: Data.Polymorph);
(* Write polymorph  to byte offset off within the specified object *)

PROCEDURE GetPointer(obj: Data.Pointer; off: Data.Card): Data.Pointer;
(* Return the object identifier stored at byte offset off. *)

PROCEDURE SetPointer(obj: Data.Pointer; off: Data.Card; pointer: Data.Pointer);
(* Write pointer to byte offset off within the specified object *)

PROCEDURE GetImmediate(obj: Data.Pointer; off: Data.Card): Data.Immediate;
(* Return the immediate stored at byte offset off. *)

PROCEDURE SetImmediate(obj: Data.Pointer; off: Data.Card; immediate: Data.Immediate);
(* Write immediate to byte offset off within the specified object *)

PROCEDURE GetSmallCard(obj: Data.Pointer; off: Data.Card): Data.SmallCard;
(* Return the small cardinal stored at byte offset off. *)

PROCEDURE SetSmallCard(obj: Data.Pointer; off: Data.Card; smallCard: Data.SmallCard);
(* Write smallCard to byte offset off within the specified object *)

PROCEDURE GetSmallInt(obj: Data.Pointer; off: Data.Card): Data.SmallInt;
(* Return the small integer stored at byte offset off. *)

PROCEDURE SetSmallInt(obj: Data.Pointer; off: Data.Card; smallInt: Data.SmallInt);
(* Write smallInt to byte offset off within the specified object *)

PROCEDURE GetInt(obj: Data.Pointer; off: Data.Card): Data.Int;
(* Return the integer stored at byte offset off. *)

PROCEDURE SetInt(obj: Data.Pointer; off: Data.Card; int: Data.Int);
(* Write int to byte offset off within the specified object *)

PROCEDURE GetFloat(obj: Data.Pointer; off: Data.Card): Data.Float;
(* Return the single precision float stored at byte offset off. *)

PROCEDURE SetFloat(obj: Data.Pointer; off: Data.Card; float: Data.Float);
(* Write float to byte offset off within the specified object *)

END Store.
\end{xple}
