18 static LoggerPtr logger(Logger::getLogger(
"pz.saveable"));
19 static LoggerPtr loggerCheck(Logger::getLogger(
"pz.checkconsistency"));
23 std::list<std::map<std::string, uint64_t>> history;
24 std::map<std::string, uint64_t> versionMap;
25 versionMap.insert(std::make_pair(
"NeoPZ", 1));
26 history.push_back(versionMap);
28 versionMap.insert(std::make_pair(
"NeoPZ", 2));
29 history.push_back(versionMap);
31 versionMap.insert(std::make_pair(
"NeoPZ", 3));
32 history.push_back(versionMap);
34 versionMap.insert(std::make_pair(
"NeoPZ", 4));
35 history.push_back(versionMap);
44 return std::make_pair(
"NeoPZ", 4);
54 std::cout <<
"TPZSavable::Write const with classid -1 expect trouble\n";
65 std::set<TPZRestoreClassBase*>::iterator it;
69 std::cout <<
"TPZSavable::Register duplicate RestoreClass " << std::endl;
79 std::map<int,TPZRestore_t>::iterator it;
83 std::cout <<
"TPZSavable::Register duplicate classid " << it->second->Restore()->ClassId() << std::endl;
100 std::stringstream sout;
101 sout <<
"Class id " <<
ClassId() <<
" Compare needs to be implemented";
113 std::stringstream sout;
114 sout <<
"Class id " <<
ClassId() <<
" Compare needs to be implemented";
122 std::map<int,TPZRestore_t>::const_iterator it;
125 std::cout <<
"TPZSavable trying to restore unknown object with classId " << classId << std::endl;
128 std::stringstream sout;
129 sout << __PRETTY_FUNCTION__ <<
" trying to restore unknown object with classId " << classId;
Contains declaration of the TPZSavable class which defines the interface to save and restore objects ...
Contains definitions to LOGPZ_DEBUG, LOGPZ_INFO, LOGPZ_WARN, LOGPZ_ERROR and LOGPZ_FATAL, and the implementation of the inline InitializePZLOG(string) function using log4cxx library or not. It must to be called out of "#ifdef LOG4CXX" scope.
virtual void Read(TPZStream &buf, void *context)
read objects from the stream
virtual bool Compare(TPZSavable *copy, bool override=false)
Compares the object for identity with the object pointed to, eventually copy the object.
virtual int ClassId() const =0
Define the class id associated with the class.
#define DebugStop()
Returns a message to user put a breakpoint in.
virtual std::pair< std::string, uint64_t > Version() const
static void RegisterClassId(int classid, TPZRestore_t fun)
static TPZSavable * CreateInstance(const int &classId)
static std::map< int, TPZRestore_t > & ClassIdMap()
This static function guarantees that the gMap object is available when needed.
virtual void Write(TPZStream &buf, int withclassid) const
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
#define LOGPZ_ERROR(A, B)
Define log for errors (cout)
virtual TPZSavable * Restore()=0
virtual void SetClassId(int classid)
static std::pair< std::string, uint64_t > NeoPZVersion()
static void Register(TPZRestoreClassBase *restore)
Contains declaration of the abstract TPZStream class. TPZStream defines the interface for saving and ...
Defines the interface for saving and reading data. Persistency.
virtual std::list< std::map< std::string, uint64_t > > VersionHistory() const
virtual TPZChunkTranslator * GetTranslator()=0
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.