38 #ifdef PZDEBUG_SAVEABLE 39 #define SAVEABLE_STR_NOTE(buf,str) { std::string msg(str); buf.Write(&msg,1); } 40 #define SAVEABLE_SKIP_NOTE(buf) { std::string str; buf.Read(&str,1); } 42 #define SAVEABLE_STR_NOTE(buf,str) 43 #define SAVEABLE_SKIP_NOTE(buf) 72 static std::set<TPZRestoreClassBase*> gRestoreClassSet;
73 return gRestoreClassSet;
78 static std::map<int,TPZRestore_t> gClassIdMap;
96 virtual int ClassId()
const = 0;
99 virtual std::list<std::map<std::string, uint64_t>> VersionHistory()
const;
100 virtual std::pair<std::string, uint64_t> Version()
const;
102 static std::pair<std::string, uint64_t> NeoPZVersion();
108 virtual void Write(
TPZStream &buf,
int withclassid)
const;
111 virtual void Read(
TPZStream &buf,
void *context);
118 virtual bool Compare(
TPZSavable *copy,
bool override =
false);
125 virtual bool Compare(
TPZSavable *copy,
bool override =
false)
const;
129 static void RegisterClassId(
int classid,
TPZRestore_t fun);
131 static TPZSavable *CreateInstance(
const int &classId);
176 template<
class T,
class TranslatorType>
195 gTranslator =
new TranslatorType();
206 template<
class T,
class TranslatorType>
213 template<
class T,
class TranslatorType>
216 template<
class T,
class TranslatorType>
219 #endif //TPZSAVABLE_H static TPZChunkTranslator * gTranslator
TPZRestoreClass()
Constructor.
Templated vector implementation.
TPZRestoreClassBase * TPZRestore_t
Typedef of TPZRestore_t.
static TPZRestoreClass< T > gRestoreObject
TPZRegisterClassId(int(T::*)() const)
const int TPZSAVEABLEID
Identifier as saveable object.
static TPZRestoreClassWithTranslator< T, TranslatorType > gRestoreObject
TPZRestoreClassWithTranslator()
Constructor.
virtual TPZChunkTranslator * GetTranslator()
~TPZRestoreClassWithTranslator()
virtual TPZSavable * Restore()
Restores object from Map based in classid into the buf.
static std::map< int, TPZRestore_t > & ClassIdMap()
This static function guarantees that the gMap object is available when needed.
virtual TPZChunkTranslator * GetTranslator()
static void Register(TPZRestoreClassBase *restore)
TPZRegisterClassId()=default
Defines the interface for saving and reading data. Persistency.
This class defines the interface to save and restore objects from TPZStream objects. Persistency.
static std::set< TPZRestoreClassBase * > & RestoreClassSet()
This static function guarantees that the gMap object is available when needed.
virtual TPZSavable * Restore()
Restores object from Map based in classid into the buf.
Implements an interface to register a class id and a restore function. Persistence.