/******************************************************************************* PURPOSE: (Set for checkpointable set container.) PROGRAMMERS: (((Thomas Brain) (Metecs) (May 2013) (--))) *******************************************************************************/ #ifndef CHECKPOINTHELPER_SET_HH_ #define CHECKPOINTHELPER_SET_HH_ #include "CheckpointItem.hh" #include namespace CheckpointHelper { template class set: public CheckpointItem, public std::set { public: T ** chkpt; std::string mmstr; set(T ** chkptIn, std::string mmstrIn) : chkpt(chkptIn), mmstr(mmstrIn) { *chkpt = 0x0; } set& operator=(const std::set& pr) { std::set::operator=(pr); return *this; } virtual ~set() { } virtual void checkpoint() { chkpt_seq::iterator, T>(*this); } virtual void restart() { restart_seq::iterator>(*this); } }; template class multiset: public CheckpointHelper::CheckpointItem, public std::multiset { public: T ** chkpt; std::string mmstr; multiset(T ** chkptIn, std::string mmstrIn) : chkpt(chkptIn), mmstr(mmstrIn) { *chkpt = 0x0; } multiset& operator=(const std::multiset& pr) { std::multiset::operator=(pr); return *this; } virtual ~multiset() { } virtual void checkpoint() { chkpt_seq::iterator, T>(*this); } virtual void restart() { restart_seq::iterator>(*this); } }; } #if (!defined(SWIG) && !defined(TRICK_ICG)) #define STLSET( type, varName ) \ type* _##varName; \ CheckpointHelper::set varName #define STLMULTISET( type, varName ) \ type* _##varName; \ CheckpointHelper::multiset varName #else #define STLSET( type, varName ) \ type* _##varName #define STLMULTISET( type, varName ) \ type* _##varName; #endif #if (!defined(SWIG) && !defined(TRICK_ICG)) #ifndef STL_CSTR1 #define STL_CSTR1( varName, type ) \ varName( &_##varName, #type ) #endif #else #ifndef STL_CSTR1 #define STL_CSTR1( varName, type ) \ _##varName() #endif #endif #define STLSETCSTR STL_CSTR1 #define STLMULTISETCSTR STL_CSTR1 #endif /* STLHELPER_SET_HH_ */