//-< STORE.HPP >-----------------------------------------------------*--------* // GOODS Version 1.0 (c) 1992 GARRET * ? * // ( Garret object oriented data storage ) * /\| * // Store interface with objects * / \ * // Created: 14-Feb-92 K.A. Knizhnik * / [] \ * // Last update: 16-May-92 K.A. Knizhnik * GARRET * //-------------------------------------------------------------------*--------* #ifndef __STORE_HPP__ #define __STORE_HPP__ #include "stdtp.hpp" #include "ermsg.hpp" #define Dbs_Slot_Bits 5 #define Dbs_Slot_Size (1 << Dbs_Slot_Bits) typedef unsigned short o_size_t; // object size type // // Date base errors checking // #define Dbs_Check( Operation ) \ do if(!(Operation)) Fatal ( "%s:%s", #Operation, Sys_Error() ); while(FALSE) #define Dbs_Error( Text ) Fatal ( "%s:%s", Text, Sys_Error() ) #define Dbs_Warning( Text ) Trace ( "%s:%s", Text, Sys_Error() ) struct Dbs_Object; struct Object_Database; class Dbs_Store { public : int Ident; // identifier of storage in data base Object_Database* Base; // pointer to data base working with this storage virtual bool Empty ( void ) = 0; virtual large Length ( void ) = 0; virtual large Start ( void ) = 0; virtual void Flush ( void ) = 0; virtual void Read ( Dbs_Object* Obj ) = 0; virtual void Write ( Dbs_Object* Obj ) = 0; virtual large Malloc ( o_size_t Size ) = 0; virtual void Near ( large Address ) = 0; virtual void Free ( large Address, o_size_t Size ) = 0; virtual void Open ( int Id, Object_Database* Base ) = 0; virtual void Close ( void ) = 0; }; #endif