gem5  v21.1.0.2
Classes | Namespaces | Macros | Typedefs | Functions | Variables
serialize.hh File Reference
#include <algorithm>
#include <fstream>
#include <iostream>
#include <iterator>
#include <stack>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <vector>
#include "base/inifile.hh"
#include "base/logging.hh"
#include "sim/serialize_handlers.hh"

Go to the source code of this file.

Classes

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

Namespaces

 gem5
 Reference material can be found at the JEDEC website: UFS standard http://www.jedec.org/standards-documents/results/jesd220 UFS HCI specification http://www.jedec.org/standards-documents/results/jesd223.
 

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_OBJ(obj)   obj.serializeSection(cp, #obj)
 
#define UNSERIALIZE_OBJ(obj)   obj.unserializeSection(cp, #obj)
 
#define SERIALIZE_MAPPING(member, names, size)   mappingParamOut(cp, #member, names, member, size)
 
#define UNSERIALIZE_MAPPING(member, names, size)   mappingParamIn(cp, #member, names, member, size)
 

Typedefs

typedef std::ostream gem5::CheckpointOut
 

Functions

template<class T >
void gem5::paramOut (CheckpointOut &os, const std::string &name, const T &param)
 This function is used for writing parameters to a checkpoint. More...
 
template<class T >
bool gem5::paramInImpl (CheckpointIn &cp, const std::string &name, T &param)
 
template<class T >
bool gem5::optParamIn (CheckpointIn &cp, const std::string &name, T &param, bool do_warn=true)
 This function is used for restoring optional parameters from the checkpoint. More...
 
template<class T >
void gem5::paramIn (CheckpointIn &cp, const std::string &name, T &param)
 This function is used for restoring parameters from a checkpoint. More...
 
template<class InputIterator >
void gem5::arrayParamOut (CheckpointOut &os, const std::string &name, InputIterator start, InputIterator end)
 
template<class T >
void gem5::arrayParamOut (CheckpointOut &os, const std::string &name, const T *param, unsigned size)
 
template<class T , class InsertIterator >
void gem5::arrayParamIn (CheckpointIn &cp, const std::string &name, InsertIterator inserter, ssize_t fixed_size=-1)
 Extract values stored in the checkpoint, and assign them to the provided array container. More...
 
template<class T >
decltype(std::declval< T >().insert(std::declval< typename T::value_type >()), void()) gem5::arrayParamIn (CheckpointIn &cp, const std::string &name, T &param)
 
template<class T >
decltype(std::declval< T >().push_back(std::declval< typename T::value_type >()), void()) gem5::arrayParamIn (CheckpointIn &cp, const std::string &name, T &param)
 
template<class T >
void gem5::arrayParamIn (CheckpointIn &cp, const std::string &name, T *param, unsigned size)
 
template<class T >
void gem5::mappingParamOut (CheckpointOut &os, const char *sectionName, const char *const names[], const T *param, unsigned size)
 Serialize a mapping represented as two arrays: one containing names and the other containing values. More...
 
template<class T >
void gem5::mappingParamIn (CheckpointIn &cp, const char *sectionName, const char *const names[], T *param, unsigned size)
 Restore mappingParamOut. More...
 

Variables

template<class T >
decltype(std::begin(std::declval< const T & >()), std::end(std::declval< const T & >()), void()) gem5::arrayParamOut (CheckpointOut &os, const std::string &name, const T &param)
 

Macro Definition Documentation

◆ SERIALIZE_MAPPING

#define SERIALIZE_MAPPING (   member,
  names,
  size 
)    mappingParamOut(cp, #member, names, member, size)

Definition at line 660 of file serialize.hh.

◆ SERIALIZE_SCALAR

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

Definition at line 568 of file serialize.hh.

◆ UNSERIALIZE_MAPPING

#define UNSERIALIZE_MAPPING (   member,
  names,
  size 
)    mappingParamIn(cp, #member, names, member, size)

Definition at line 666 of file serialize.hh.

◆ UNSERIALIZE_SCALAR

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

Definition at line 575 of file serialize.hh.


Generated on Tue Sep 21 2021 12:26:45 for gem5 by doxygen 1.8.17