gem5  v20.1.0.0
Classes | Macros | Typedefs | Functions
serialize.hh File Reference
#include <algorithm>
#include <iostream>
#include <list>
#include <map>
#include <stack>
#include <set>
#include <vector>
#include "base/bitunion.hh"
#include "base/logging.hh"
#include "base/str.hh"

Go to the source code of this file.

Classes

class  CheckpointIn
 
class  Serializable
 Basic support for object serialization. More...
 
class  Serializable::ScopedCheckpointSection
 

Macros

#define SERIALIZE_SCALAR(scalar)   paramOut(cp, #scalar, scalar)
 
#define UNSERIALIZE_SCALAR(scalar)   paramIn(cp, #scalar, scalar)
 
#define UNSERIALIZE_OPT_SCALAR(scalar)   optParamIn(cp, #scalar, scalar)
 
#define SERIALIZE_ENUM(scalar)   paramOut(cp, #scalar, (int)scalar)
 
#define UNSERIALIZE_ENUM(scalar)
 
#define SERIALIZE_ARRAY(member, size)   arrayParamOut(cp, #member, member, size)
 
#define UNSERIALIZE_ARRAY(member, size)   arrayParamIn(cp, #member, member, size)
 
#define SERIALIZE_CONTAINER(member)   arrayParamOut(cp, #member, member)
 
#define UNSERIALIZE_CONTAINER(member)   arrayParamIn(cp, #member, member)
 
#define SERIALIZE_EVENT(event)   event.serializeSection(cp, #event);
 
#define UNSERIALIZE_EVENT(event)
 
#define SERIALIZE_OBJ(obj)   obj.serializeSection(cp, #obj)
 
#define UNSERIALIZE_OBJ(obj)   obj.unserializeSection(cp, #obj)
 
#define SERIALIZE_OBJPTR(objptr)   paramOut(cp, #objptr, (objptr)->name())
 
#define UNSERIALIZE_OBJPTR(objptr)
 

Typedefs

typedef std::ostream CheckpointOut
 

Functions

template<class T >
bool parseParam (const std::string &s, T &value)
 
template<class T >
void showParam (CheckpointOut &os, const T &value)
 
template<class T >
bool parseParam (const std::string &s, BitUnionType< T > &value)
 
template<class T >
void showParam (CheckpointOut &os, const BitUnionType< T > &value)
 
template<>
void showParam (CheckpointOut &os, const char &value)
 
template<>
void showParam (CheckpointOut &os, const signed char &value)
 
template<>
void showParam (CheckpointOut &os, const unsigned char &value)
 
template<>
bool parseParam (const std::string &s, float &value)
 
template<>
bool parseParam (const std::string &s, double &value)
 
template<>
bool parseParam (const std::string &s, bool &value)
 
template<>
void showParam (CheckpointOut &os, const bool &value)
 
template<>
bool parseParam (const std::string &s, std::string &value)
 
template<class T >
void paramOut (CheckpointOut &os, const std::string &name, const T &param)
 This function is used for writing parameters to a checkpoint. More...
 
template<class T >
void paramIn (CheckpointIn &cp, const std::string &name, T &param)
 This function is used for restoring parameters from a checkpoint. More...
 
template<class T >
bool optParamIn (CheckpointIn &cp, const std::string &name, T &param, bool warn=true)
 This function is used for restoring optional parameters from the checkpoint. More...
 
template<class T >
void arrayParamOut (CheckpointOut &os, const std::string &name, const std::vector< T > &param)
 
template<class T >
void arrayParamOut (CheckpointOut &os, const std::string &name, const std::list< T > &param)
 
template<class T >
void arrayParamOut (CheckpointOut &os, const std::string &name, const std::set< T > &param)
 
template<class T >
void arrayParamOut (CheckpointOut &os, const std::string &name, const T *param, unsigned size)
 
template<class T >
void arrayParamIn (CheckpointIn &cp, const std::string &name, T *param, unsigned size)
 Extract values stored in the checkpoint, and assign them to the provided array container. More...
 
template<class T >
void arrayParamIn (CheckpointIn &cp, const std::string &name, std::vector< T > &param)
 
template<class T >
void arrayParamIn (CheckpointIn &cp, const std::string &name, std::list< T > &param)
 
template<class T >
void arrayParamIn (CheckpointIn &cp, const std::string &name, std::set< T > &param)
 
void debug_serialize (const std::string &cpt_dir)
 
void objParamIn (CheckpointIn &cp, const std::string &name, SimObject *&param)
 

Macro Definition Documentation

◆ SERIALIZE_SCALAR

#define SERIALIZE_SCALAR (   scalar)    paramOut(cp, #scalar, scalar)

Definition at line 790 of file serialize.hh.

◆ UNSERIALIZE_SCALAR

#define UNSERIALIZE_SCALAR (   scalar)    paramIn(cp, #scalar, scalar)

Definition at line 797 of file serialize.hh.

Typedef Documentation

◆ CheckpointOut

typedef std::ostream CheckpointOut

Definition at line 63 of file serialize.hh.

Function Documentation

◆ debug_serialize()

void debug_serialize ( const std::string &  cpt_dir)

Generated on Wed Sep 30 2020 14:02:19 for gem5 by doxygen 1.8.17