gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | List of all members
Serializable::ScopedCheckpointSection Class Reference

Scoped checkpoint section helper class. More...

#include <serialize.hh>

Public Member Functions

template<class CP >
 ScopedCheckpointSection (CP &cp, const char *name)
 
template<class CP >
 ScopedCheckpointSection (CP &cp, const std::string &name)
 
 ~ScopedCheckpointSection ()
 
 ScopedCheckpointSection ()=delete
 
 ScopedCheckpointSection (const ScopedCheckpointSection &)=delete
 
ScopedCheckpointSectionoperator= (const ScopedCheckpointSection &)=delete
 
ScopedCheckpointSectionoperator= (ScopedCheckpointSection &&)=delete
 

Private Member Functions

void pushName (const char *name)
 
void nameOut (CheckpointOut &cp)
 
void nameOut (CheckpointIn &cp)
 

Detailed Description

Scoped checkpoint section helper class.

This helper class creates a section within a checkpoint without the need for a separate serializeable object. It is mainly used within the Serializable class when serializing or unserializing section (see serializeSection() and unserializeSection()). It can also be used to maintain backwards compatibility in existing code that serializes structs that are not inheriting from Serializable into subsections.

When the class is instantiated, it appends a name to the active path in a checkpoint. The old path is later restored when the instance is destroyed. For example, serializeSection() could be implemented by instantiating a ScopedCheckpointSection and then calling serialize() on an object.

Definition at line 240 of file serialize.hh.

Constructor & Destructor Documentation

template<class CP >
Serializable::ScopedCheckpointSection::ScopedCheckpointSection ( CP &  cp,
const char *  name 
)
inline

Definition at line 243 of file serialize.hh.

References nameOut(), and pushName().

template<class CP >
Serializable::ScopedCheckpointSection::ScopedCheckpointSection ( CP &  cp,
const std::string &  name 
)
inline

Definition at line 249 of file serialize.hh.

References nameOut(), and pushName().

Serializable::ScopedCheckpointSection::~ScopedCheckpointSection ( )

Definition at line 619 of file serialize.cc.

References DPRINTF.

Serializable::ScopedCheckpointSection::ScopedCheckpointSection ( )
delete
Serializable::ScopedCheckpointSection::ScopedCheckpointSection ( const ScopedCheckpointSection )
delete

Member Function Documentation

void Serializable::ScopedCheckpointSection::nameOut ( CheckpointOut cp)
private

Definition at line 638 of file serialize.cc.

References Serializable::currentSection(), and DPRINTF.

Referenced by ScopedCheckpointSection().

void Serializable::ScopedCheckpointSection::nameOut ( CheckpointIn cp)
inlineprivate

Definition at line 266 of file serialize.hh.

ScopedCheckpointSection& Serializable::ScopedCheckpointSection::operator= ( const ScopedCheckpointSection )
delete
ScopedCheckpointSection& Serializable::ScopedCheckpointSection::operator= ( ScopedCheckpointSection &&  )
delete
void Serializable::ScopedCheckpointSection::pushName ( const char *  name)
private

Definition at line 627 of file serialize.cc.

References csprintf(), and DPRINTF.

Referenced by ScopedCheckpointSection().


The documentation for this class was generated from the following files:

Generated on Fri Jun 9 2017 13:04:19 for gem5 by doxygen 1.8.6