gem5  v19.0.0.0
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 173 of file serialize.hh.

Constructor & Destructor Documentation

◆ ScopedCheckpointSection() [1/4]

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

Definition at line 176 of file serialize.hh.

◆ ScopedCheckpointSection() [2/4]

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

Definition at line 182 of file serialize.hh.

References name().

◆ ~ScopedCheckpointSection()

Serializable::ScopedCheckpointSection::~ScopedCheckpointSection ( )

Definition at line 217 of file serialize.cc.

References DPRINTF.

◆ ScopedCheckpointSection() [3/4]

Serializable::ScopedCheckpointSection::ScopedCheckpointSection ( )
delete

◆ ScopedCheckpointSection() [4/4]

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

Member Function Documentation

◆ nameOut() [1/2]

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

Definition at line 236 of file serialize.cc.

References Serializable::currentSection(), and DPRINTF.

◆ nameOut() [2/2]

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

Definition at line 199 of file serialize.hh.

References name(), serialize(), and unserialize().

◆ operator=() [1/2]

ScopedCheckpointSection& Serializable::ScopedCheckpointSection::operator= ( const ScopedCheckpointSection )
delete

◆ operator=() [2/2]

ScopedCheckpointSection& Serializable::ScopedCheckpointSection::operator= ( ScopedCheckpointSection &&  )
delete

◆ pushName()

void Serializable::ScopedCheckpointSection::pushName ( const char *  name)
private

Definition at line 225 of file serialize.cc.

References csprintf(), and DPRINTF.


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

Generated on Fri Feb 28 2020 16:27:15 for gem5 by doxygen 1.8.13