HOPS
HOPS class reference
Public Member Functions | Static Public Member Functions | List of all members
hops::MHO_Snapshot Class Reference

Class MHO_Snapshot. More...

#include <MHO_Snapshot.hh>

Public Member Functions

 MHO_Snapshot (MHO_Snapshot &&)=delete
 
 MHO_Snapshot (MHO_Snapshot const &)=delete
 
void AcceptAllKeys ()
 Sets the internal flag to accept all keys. More...
 
void AddKey (const char *key)
 Inserts a key into the set of keys for MHO_Snapshot. More...
 
void AddKey (const std::string &key)
 Inserts a key into the set of keys for MHO_Snapshot. More...
 
template<typename XObjType >
void DumpObject (XObjType *obj, const char *key, const char *name)
 Dumps an object of type XObjType to a file specified by key and name. More...
 
template<typename XObjType >
void DumpObject (XObjType *obj, std::string key, std::string name)
 Dumps an object of type XObjType to a file specified by key and name. More...
 
template<typename XObjType >
void DumpObject (XObjType *obj, std::string key, std::string name, std::string file, int line)
 Dumps an object to a file with given key, name, file and line number. More...
 
void LimitToKeySet ()
 Sets internal flag to limit keys based on key set. More...
 
MHO_Snapshotoperator= (MHO_Snapshot &&)=delete
 
MHO_Snapshotoperator= (MHO_Snapshot const &)=delete
 
void RemoveAllKeys ()
 Clears all keys in the MHO_Snapshot object. More...
 
void RemoveKey (const char *key)
 Removes a key-value pair from the MHO_Snapshot object if it exists. More...
 
void RemoveKey (const std::string &key)
 Removes a key-value pair from the MHO_Snapshot object's keys. More...
 
void SetExecutableName (const char *exe_name)
 Setter for executable name. More...
 
void SetExecutableName (std::string exe_name)
 Setter for executable name. More...
 

Static Public Member Functions

static MHO_SnapshotGetInstance ()
 provides public access to the only static instance More...
 

Detailed Description

Class MHO_Snapshot.

MHO_Snapshot – a debugging tool to dump an object to a snapshot file. Uses the singleton pattern (dumps to only one file)

Author
J. Barrett - barre.nosp@m.ttj@.nosp@m.mit.e.nosp@m.du
Date
Sun Apr 2 17:06:41 2023 -0400

Constructor & Destructor Documentation

◆ MHO_Snapshot() [1/2]

hops::MHO_Snapshot::MHO_Snapshot ( MHO_Snapshot const &  )
delete

◆ MHO_Snapshot() [2/2]

hops::MHO_Snapshot::MHO_Snapshot ( MHO_Snapshot &&  )
delete

Member Function Documentation

◆ AcceptAllKeys()

void hops::MHO_Snapshot::AcceptAllKeys ( )
inline

Sets the internal flag to accept all keys.

◆ AddKey() [1/2]

void hops::MHO_Snapshot::AddKey ( const char *  key)

Inserts a key into the set of keys for MHO_Snapshot.

Parameters
keyThe key to be inserted.

◆ AddKey() [2/2]

void hops::MHO_Snapshot::AddKey ( const std::string &  key)

Inserts a key into the set of keys for MHO_Snapshot.

Parameters
keyThe key to be inserted.

◆ DumpObject() [1/3]

template<typename XObjType >
void hops::MHO_Snapshot::DumpObject ( XObjType *  obj,
const char *  key,
const char *  name 
)
inline

Dumps an object of type XObjType to a file specified by key and name.

Parameters
objPointer to object of type XObjType
keyKey as a null-terminated string
nameName as a null-terminated string
Returns
No return value (void)

◆ DumpObject() [2/3]

template<typename XObjType >
void hops::MHO_Snapshot::DumpObject ( XObjType *  obj,
std::string  key,
std::string  name 
)
inline

Dumps an object of type XObjType to a file specified by key and name.

Parameters
objPointer to the object of type XObjType to be dumped
keyKey used to construct the filename for dumping snapshots
nameName used to construct the filename for dumping snapshots
Returns
void

◆ DumpObject() [3/3]

template<typename XObjType >
void hops::MHO_Snapshot::DumpObject ( XObjType *  obj,
std::string  key,
std::string  name,
std::string  file,
int  line 
)
inline

Dumps an object to a file with given key, name, file and line number.

Template Parameters
XObjTypeTemplate parameter XObjType
Parameters
objPointer to the object of type XObjType to be dumped
keyUnique identifier for the object as a string
nameName or label associated with the object as a string
fileFile path where the object is being dumped (not used in this implementation)
lineLine number where the dump occurs (not used in this implementation)

◆ GetInstance()

static MHO_Snapshot& hops::MHO_Snapshot::GetInstance ( )
inlinestatic

provides public access to the only static instance

Returns
Reference to the singleton instance of MHO_Snapshot.
Note
This is a static function.

◆ LimitToKeySet()

void hops::MHO_Snapshot::LimitToKeySet ( )
inline

Sets internal flag to limit keys based on key set.

◆ operator=() [1/2]

MHO_Snapshot& hops::MHO_Snapshot::operator= ( MHO_Snapshot &&  )
delete

◆ operator=() [2/2]

MHO_Snapshot& hops::MHO_Snapshot::operator= ( MHO_Snapshot const &  )
delete

◆ RemoveAllKeys()

void hops::MHO_Snapshot::RemoveAllKeys ( )

Clears all keys in the MHO_Snapshot object.

◆ RemoveKey() [1/2]

void hops::MHO_Snapshot::RemoveKey ( const char *  key)

Removes a key-value pair from the MHO_Snapshot object if it exists.

Parameters
keyKey to be removed from the snapshot

◆ RemoveKey() [2/2]

void hops::MHO_Snapshot::RemoveKey ( const std::string &  key)

Removes a key-value pair from the MHO_Snapshot object's keys.

Parameters
keyKey to be removed; must exist in fKeys

◆ SetExecutableName() [1/2]

void hops::MHO_Snapshot::SetExecutableName ( const char *  exe_name)
inline

Setter for executable name.

Parameters
exe_nameNew executable name to set

◆ SetExecutableName() [2/2]

void hops::MHO_Snapshot::SetExecutableName ( std::string  exe_name)
inline

Setter for executable name.

Parameters
exe_nameNew executable name to set

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