trick/trick_source/er7_utils/CheckpointHelper/List.hh
Alex Lin 2c794060f4 Merge in the er7_utils integrators
Taking in the latest er7_utils directory and adding it into Trick in the
same location it was as an external repository.  Made one change to
the files_to_ICG.hh file in the repository to remove the CheckpointHelper
header files.  Those go in the Trick files_to_ICG.hh file.

refs #180

Conflicts:
	Makefile
	autoconf/configure.ac
	configure
	include/trick/files_to_ICG.hh
	share/trick/makefiles/Makefile.common
	share/trick/makefiles/config_user.mk.in
	trick_source/sim_services/Integrator/Makefile
	trick_source/trick_swig/Makefile
2016-02-18 13:39:16 -06:00

79 lines
1.5 KiB
C++

/*******************************************************************************
PURPOSE:
(List for checkpointable list container.)
PROGRAMMERS:
(((Thomas Brain) (Metecs) (May 2013) (--)))
*******************************************************************************/
#ifndef CHECKPOINTHELPER_LIST_HH_
#define CHECKPOINTHELPER_LIST_HH_
#include "CheckpointItem.hh"
#include <list>
namespace CheckpointHelper
{
template<class T>
class list: public CheckpointItem, public std::list<T>
{
public:
T ** chkpt;
std::string mmstr;
list(T ** chkptIn, std::string mmstrIn) :
chkpt(chkptIn), mmstr(mmstrIn)
{
*chkpt = 0x0;
}
list<T>& operator=(const std::list<T>& pr)
{
std::list<T>::operator=(pr);
return *this;
}
virtual ~list()
{
}
virtual void checkpoint()
{
chkpt_seq<typename std::list<T>::iterator, T>(*this);
}
virtual void restart()
{
restart_seq<typename std::list<T>::iterator>(*this);
}
};
}
#if (!defined(SWIG) && !defined(TRICK_ICG))
#define STLLIST( type, varName ) \
type* _##varName; \
CheckpointHelper::list<type> varName
#else
#define STLLIST( 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 STLLISTCSTR STL_CSTR1
#endif /* STLHELPER_LIST_HH_ */