SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
A helper for dealing with serialization/deserialization done within an operation. More...
#include <Helper.h>
Public Member Functions | |
~Helper () | |
Destructor is public, but you shouldn't use it. | |
Helper (const Helper &)=delete | |
Copy construction and assignment are disallowed. | |
void | operator= (const Helper &)=delete |
bool | topLevel () const |
Returns true if the helper is for deserializing top-level or child operations. | |
const Operation::Key * | key () const |
Return the key currently being used. | |
Static Public Member Functions | |
static Helper & | instance () |
Return the helper "singleton". More... | |
static Helper & | pushInstance (Operation::Key *opsKey) |
Push a new helper instance on the local thread's stack. More... | |
static void | popInstance () |
Pop a helper instance off the local thread's stack. | |
static std::size_t | nestingDepth () |
Return the nesting level (i.e., the number of helper instances in the stack). More... | |
Protected Attributes | |
Operation::Key * | m_key |
bool | m_topLevel = true |
m_topLevel indicates whether pushInstance() (false) or instance() (true) was used to create this helper. | |
A helper for dealing with serialization/deserialization done within an operation.
This is needed in order to internally call operations with the serialization/deserialization functions.
|
static |
Return the helper "singleton".
The object returned is a per-thread instance at the top of a stack that may be altered using the pushInstance() and popInstance() methods. This allows nested deserializers to each have their own context that appears to be globally available.
|
static |
Return the nesting level (i.e., the number of helper instances in the stack).
The outermost helper will return 1 (assuming you have called instance() first).
|
static |
Push a new helper instance on the local thread's stack.
The returned Helper will have the same managers as the previous (if any) helper.