|
|
|
|
@@ -72,11 +72,17 @@ class CheckpointIn
|
|
|
|
|
|
|
|
|
|
SimObjectResolver &objNameResolver;
|
|
|
|
|
|
|
|
|
|
const std::string _cptDir;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
CheckpointIn(const std::string &cpt_dir, SimObjectResolver &resolver);
|
|
|
|
|
~CheckpointIn();
|
|
|
|
|
|
|
|
|
|
const std::string cptDir;
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
* @{
|
|
|
|
|
*/
|
|
|
|
|
const std::string getCptDir() { return _cptDir; }
|
|
|
|
|
|
|
|
|
|
bool find(const std::string §ion, const std::string &entry,
|
|
|
|
|
std::string &value);
|
|
|
|
|
@@ -84,9 +90,9 @@ class CheckpointIn
|
|
|
|
|
bool findObj(const std::string §ion, const std::string &entry,
|
|
|
|
|
SimObject *&value);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool entryExists(const std::string §ion, const std::string &entry);
|
|
|
|
|
bool sectionExists(const std::string §ion);
|
|
|
|
|
/** @}*/ //end of api_checkout group
|
|
|
|
|
|
|
|
|
|
// The following static functions have to do with checkpoint
|
|
|
|
|
// creation rather than restoration. This class makes a handy
|
|
|
|
|
@@ -99,16 +105,28 @@ class CheckpointIn
|
|
|
|
|
// current directory we're serializing into.
|
|
|
|
|
static std::string currentDirectory;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
// Set the current directory. This function takes care of
|
|
|
|
|
// inserting curTick() if there's a '%d' in the argument, and
|
|
|
|
|
// appends a '/' if necessary. The final name is returned.
|
|
|
|
|
/**
|
|
|
|
|
* Set the current directory
|
|
|
|
|
*
|
|
|
|
|
* This function takes care of inserting curTick() if there's a '%d' in the
|
|
|
|
|
* argument, and appends a '/' if necessary. The final name is returned.
|
|
|
|
|
*
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
static std::string setDir(const std::string &base_name);
|
|
|
|
|
|
|
|
|
|
// Export current checkpoint directory name so other objects can
|
|
|
|
|
// derive filenames from it (e.g., memory). The return value is
|
|
|
|
|
// guaranteed to end in '/' so filenames can be directly appended.
|
|
|
|
|
// This function is only valid while a checkpoint is being created.
|
|
|
|
|
/**
|
|
|
|
|
* Get the current checkout directory name
|
|
|
|
|
*
|
|
|
|
|
* This function exports the current checkout point directory name so other
|
|
|
|
|
* objects can derive filenames from it (e.g., memory). The return value is
|
|
|
|
|
* guaranteed to end in '/' so filenames can be directly appended. This
|
|
|
|
|
* function is only valid while a checkpoint is being created.
|
|
|
|
|
*
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
static std::string dir();
|
|
|
|
|
|
|
|
|
|
// Filename for base checkpoint file within directory.
|
|
|
|
|
@@ -167,6 +185,10 @@ class Serializable
|
|
|
|
|
*/
|
|
|
|
|
class ScopedCheckpointSection {
|
|
|
|
|
public:
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
* @{
|
|
|
|
|
*/
|
|
|
|
|
template<class CP>
|
|
|
|
|
ScopedCheckpointSection(CP &cp, const char *name) {
|
|
|
|
|
pushName(name);
|
|
|
|
|
@@ -178,6 +200,7 @@ class Serializable
|
|
|
|
|
pushName(name.c_str());
|
|
|
|
|
nameOut(cp);
|
|
|
|
|
}
|
|
|
|
|
/** @}*/ //end of api_serialize group
|
|
|
|
|
|
|
|
|
|
~ScopedCheckpointSection();
|
|
|
|
|
|
|
|
|
|
@@ -195,6 +218,9 @@ class Serializable
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
Serializable();
|
|
|
|
|
virtual ~Serializable();
|
|
|
|
|
|
|
|
|
|
@@ -204,6 +230,8 @@ class Serializable
|
|
|
|
|
* Output an object's state into the current checkpoint section.
|
|
|
|
|
*
|
|
|
|
|
* @param cp Checkpoint state
|
|
|
|
|
*
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
virtual void serialize(CheckpointOut &cp) const = 0;
|
|
|
|
|
|
|
|
|
|
@@ -213,6 +241,8 @@ class Serializable
|
|
|
|
|
* Read an object's state from the current checkpoint section.
|
|
|
|
|
*
|
|
|
|
|
* @param cp Checkpoint state
|
|
|
|
|
*
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
virtual void unserialize(CheckpointIn &cp) = 0;
|
|
|
|
|
|
|
|
|
|
@@ -226,9 +256,14 @@ class Serializable
|
|
|
|
|
*
|
|
|
|
|
* @param cp Checkpoint state
|
|
|
|
|
* @param name Name to append to the active path
|
|
|
|
|
*
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
void serializeSection(CheckpointOut &cp, const char *name) const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
void serializeSection(CheckpointOut &cp, const std::string &name) const {
|
|
|
|
|
serializeSection(cp, name.c_str());
|
|
|
|
|
}
|
|
|
|
|
@@ -242,37 +277,54 @@ class Serializable
|
|
|
|
|
*
|
|
|
|
|
* @param cp Checkpoint state
|
|
|
|
|
* @param name Name to append to the active path
|
|
|
|
|
*
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
void unserializeSection(CheckpointIn &cp, const char *name);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
void unserializeSection(CheckpointIn &cp, const std::string &name) {
|
|
|
|
|
unserializeSection(cp, name.c_str());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Get the fully-qualified name of the active section */
|
|
|
|
|
/**
|
|
|
|
|
* Gets the fully-qualified name of the active section
|
|
|
|
|
*
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
static const std::string ¤tSection();
|
|
|
|
|
|
|
|
|
|
static int ckptCount;
|
|
|
|
|
static int ckptMaxCount;
|
|
|
|
|
static int ckptPrevCount;
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
static void serializeAll(const std::string &cpt_dir);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
static void unserializeGlobals(CheckpointIn &cp);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
static std::stack<std::string> path;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// The base implementations use to_number for parsing and '<<' for
|
|
|
|
|
// displaying, suitable for integer types.
|
|
|
|
|
//
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
template <class T>
|
|
|
|
|
bool
|
|
|
|
|
parseParam(const std::string &s, T &value)
|
|
|
|
|
{
|
|
|
|
|
// The base implementations use to_number for parsing and '<<' for
|
|
|
|
|
// displaying, suitable for integer types.
|
|
|
|
|
return to_number(s, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
template <class T>
|
|
|
|
|
void
|
|
|
|
|
showParam(CheckpointOut &os, const T &value)
|
|
|
|
|
@@ -280,6 +332,9 @@ showParam(CheckpointOut &os, const T &value)
|
|
|
|
|
os << value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
template <class T>
|
|
|
|
|
bool
|
|
|
|
|
parseParam(const std::string &s, BitUnionType<T> &value)
|
|
|
|
|
@@ -291,6 +346,9 @@ parseParam(const std::string &s, BitUnionType<T> &value)
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
template <class T>
|
|
|
|
|
void
|
|
|
|
|
showParam(CheckpointOut &os, const BitUnionType<T> &value)
|
|
|
|
|
@@ -304,14 +362,20 @@ showParam(CheckpointOut &os, const BitUnionType<T> &value)
|
|
|
|
|
static_cast<unsigned int>(storage) : storage);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Treat 8-bit ints (chars) as ints on output, not as chars
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
template <>
|
|
|
|
|
inline void
|
|
|
|
|
showParam(CheckpointOut &os, const char &value)
|
|
|
|
|
{
|
|
|
|
|
// Treat 8-bit ints (chars) as ints on output, not as chars
|
|
|
|
|
os << (int)value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
template <>
|
|
|
|
|
inline void
|
|
|
|
|
showParam(CheckpointOut &os, const signed char &value)
|
|
|
|
|
@@ -319,6 +383,9 @@ showParam(CheckpointOut &os, const signed char &value)
|
|
|
|
|
os << (int)value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
template <>
|
|
|
|
|
inline void
|
|
|
|
|
showParam(CheckpointOut &os, const unsigned char &value)
|
|
|
|
|
@@ -326,6 +393,9 @@ showParam(CheckpointOut &os, const unsigned char &value)
|
|
|
|
|
os << (unsigned int)value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
template <>
|
|
|
|
|
inline bool
|
|
|
|
|
parseParam(const std::string &s, float &value)
|
|
|
|
|
@@ -333,6 +403,9 @@ parseParam(const std::string &s, float &value)
|
|
|
|
|
return to_number(s, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
template <>
|
|
|
|
|
inline bool
|
|
|
|
|
parseParam(const std::string &s, double &value)
|
|
|
|
|
@@ -340,6 +413,9 @@ parseParam(const std::string &s, double &value)
|
|
|
|
|
return to_number(s, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
template <>
|
|
|
|
|
inline bool
|
|
|
|
|
parseParam(const std::string &s, bool &value)
|
|
|
|
|
@@ -347,23 +423,32 @@ parseParam(const std::string &s, bool &value)
|
|
|
|
|
return to_bool(s, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Display bools as strings
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
template <>
|
|
|
|
|
inline void
|
|
|
|
|
showParam(CheckpointOut &os, const bool &value)
|
|
|
|
|
{
|
|
|
|
|
// Display bools as strings
|
|
|
|
|
os << (value ? "true" : "false");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// String requires no processing to speak of
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
template <>
|
|
|
|
|
inline bool
|
|
|
|
|
parseParam(const std::string &s, std::string &value)
|
|
|
|
|
{
|
|
|
|
|
// String requires no processing to speak of
|
|
|
|
|
value = s;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
template <class T>
|
|
|
|
|
void
|
|
|
|
|
paramOut(CheckpointOut &os, const std::string &name, const T ¶m)
|
|
|
|
|
@@ -373,6 +458,9 @@ paramOut(CheckpointOut &os, const std::string &name, const T ¶m)
|
|
|
|
|
os << "\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
template <class T>
|
|
|
|
|
void
|
|
|
|
|
paramIn(CheckpointIn &cp, const std::string &name, T ¶m)
|
|
|
|
|
@@ -384,6 +472,9 @@ paramIn(CheckpointIn &cp, const std::string &name, T ¶m)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
template <class T>
|
|
|
|
|
bool
|
|
|
|
|
optParamIn(CheckpointIn &cp, const std::string &name,
|
|
|
|
|
@@ -400,6 +491,9 @@ optParamIn(CheckpointIn &cp, const std::string &name,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
template <class T>
|
|
|
|
|
void
|
|
|
|
|
arrayParamOut(CheckpointOut &os, const std::string &name,
|
|
|
|
|
@@ -416,6 +510,9 @@ arrayParamOut(CheckpointOut &os, const std::string &name,
|
|
|
|
|
os << "\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
template <class T>
|
|
|
|
|
void
|
|
|
|
|
arrayParamOut(CheckpointOut &os, const std::string &name,
|
|
|
|
|
@@ -435,6 +532,9 @@ arrayParamOut(CheckpointOut &os, const std::string &name,
|
|
|
|
|
os << "\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
template <class T>
|
|
|
|
|
void
|
|
|
|
|
arrayParamOut(CheckpointOut &os, const std::string &name,
|
|
|
|
|
@@ -454,6 +554,9 @@ arrayParamOut(CheckpointOut &os, const std::string &name,
|
|
|
|
|
os << "\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
template <class T>
|
|
|
|
|
void
|
|
|
|
|
arrayParamOut(CheckpointOut &os, const std::string &name,
|
|
|
|
|
@@ -477,6 +580,8 @@ arrayParamOut(CheckpointOut &os, const std::string &name,
|
|
|
|
|
* @param name Name of the container.
|
|
|
|
|
* @param param The array container.
|
|
|
|
|
* @param size The expected number of entries to be extracted.
|
|
|
|
|
*
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
template <class T>
|
|
|
|
|
void
|
|
|
|
|
@@ -523,6 +628,9 @@ arrayParamIn(CheckpointIn &cp, const std::string &name,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
template <class T>
|
|
|
|
|
void
|
|
|
|
|
arrayParamIn(CheckpointIn &cp, const std::string &name, std::vector<T> ¶m)
|
|
|
|
|
@@ -565,6 +673,9 @@ arrayParamIn(CheckpointIn &cp, const std::string &name, std::vector<T> ¶m)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
template <class T>
|
|
|
|
|
void
|
|
|
|
|
arrayParamIn(CheckpointIn &cp, const std::string &name, std::list<T> ¶m)
|
|
|
|
|
@@ -595,6 +706,9 @@ arrayParamIn(CheckpointIn &cp, const std::string &name, std::list<T> ¶m)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
template <class T>
|
|
|
|
|
void
|
|
|
|
|
arrayParamIn(CheckpointIn &cp, const std::string &name, std::set<T> ¶m)
|
|
|
|
|
@@ -628,6 +742,10 @@ arrayParamIn(CheckpointIn &cp, const std::string &name, std::set<T> ¶m)
|
|
|
|
|
void
|
|
|
|
|
debug_serialize(const std::string &cpt_dir);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
objParamIn(CheckpointIn &cp, const std::string &name, SimObject * ¶m);
|
|
|
|
|
|
|
|
|
|
@@ -635,14 +753,43 @@ objParamIn(CheckpointIn &cp, const std::string &name, SimObject * ¶m);
|
|
|
|
|
// These macros are streamlined to use in serialize/unserialize
|
|
|
|
|
// functions. It's assumed that serialize() has a parameter 'os' for
|
|
|
|
|
// the ostream, and unserialize() has parameters 'cp' and 'section'.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \def SERIALIZE_SCALER(scaler)
|
|
|
|
|
*
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
#define SERIALIZE_SCALAR(scalar) paramOut(cp, #scalar, scalar)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \def UNSERIALIZE_SCALER(scalar)
|
|
|
|
|
*
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
#define UNSERIALIZE_SCALAR(scalar) paramIn(cp, #scalar, scalar)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \def UNSERIALIZE_OPT_SCALAR(scalar)
|
|
|
|
|
*
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
#define UNSERIALIZE_OPT_SCALAR(scalar) optParamIn(cp, #scalar, scalar)
|
|
|
|
|
|
|
|
|
|
// ENUMs are like SCALARs, but we cast them to ints on the way out
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \def SERIALIZE_ENUM(scalar)
|
|
|
|
|
*
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
#define SERIALIZE_ENUM(scalar) paramOut(cp, #scalar, (int)scalar)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \def UNSERIALIZE_ENUM(scaler)
|
|
|
|
|
*
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
#define UNSERIALIZE_ENUM(scalar) \
|
|
|
|
|
do { \
|
|
|
|
|
int tmp; \
|
|
|
|
|
@@ -650,31 +797,82 @@ objParamIn(CheckpointIn &cp, const std::string &name, SimObject * ¶m);
|
|
|
|
|
scalar = static_cast<decltype(scalar)>(tmp); \
|
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \def SERIALIZE_ARRAY(member, size)
|
|
|
|
|
*
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
#define SERIALIZE_ARRAY(member, size) \
|
|
|
|
|
arrayParamOut(cp, #member, member, size)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \def UNSERIALIZE_ARRAY(member, size)
|
|
|
|
|
*
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
#define UNSERIALIZE_ARRAY(member, size) \
|
|
|
|
|
arrayParamIn(cp, #member, member, size)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \def SERIALIZE_CONTAINER(member)
|
|
|
|
|
*
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
#define SERIALIZE_CONTAINER(member) \
|
|
|
|
|
arrayParamOut(cp, #member, member)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \def UNSERIALIZE_CONTAINER(member)
|
|
|
|
|
*
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
#define UNSERIALIZE_CONTAINER(member) \
|
|
|
|
|
arrayParamIn(cp, #member, member)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \def SERIALIZE_EVENT(event)
|
|
|
|
|
*
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
#define SERIALIZE_EVENT(event) event.serializeSection(cp, #event);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \def UNSERIALIZE_EVENT(event)
|
|
|
|
|
*
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
#define UNSERIALIZE_EVENT(event) \
|
|
|
|
|
do { \
|
|
|
|
|
event.unserializeSection(cp, #event); \
|
|
|
|
|
eventQueue()->checkpointReschedule(&event); \
|
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \def SERIALIZE_OBJ(obj)
|
|
|
|
|
*
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
#define SERIALIZE_OBJ(obj) obj.serializeSection(cp, #obj)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \def UNSERIALIZE_OBJ(obj)
|
|
|
|
|
*
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
#define UNSERIALIZE_OBJ(obj) obj.unserializeSection(cp, #obj)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \def SERIALIZE_OBJPTR(objptr)
|
|
|
|
|
*
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
#define SERIALIZE_OBJPTR(objptr) paramOut(cp, #objptr, (objptr)->name())
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \def UNSERIALIZE_OBJPTR(objptr)
|
|
|
|
|
*
|
|
|
|
|
* @ingroup api_serialize
|
|
|
|
|
*/
|
|
|
|
|
#define UNSERIALIZE_OBJPTR(objptr) \
|
|
|
|
|
do { \
|
|
|
|
|
SimObject *sptr; \
|
|
|
|
|
|