ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
ScopeDump Class Reference

Description:

This class is an internal helper to export current scope values. It was extracted from class Lox to keep that class clean from this somehow 'cluttered' code.

The current purpose of this class is to write information into an AString buffer. This is used by method Lox::State. In the future, other export formats, like JSON might be implemented here.

Note
As this is a pure internal helper-class. Documentation may be limited.

Definition at line 29 of file scopedump.inl.

Collaboration diagram for ScopeDump:
[legend]

Public Method Index:

 ScopeDump (ScopeInfo::ThreadDictionary &threadDictionary, const NString noKeyHashKey, NAString &target, int maxKeyLength=10)
 
template<typename T >
ALIB_API int writeStore (ScopeStore< T, true > *store, int indentSpaces)
 
template<typename T >
ALIB_API int writeStoreMap (ScopeStore< T, false > *store)
 

Protected Field Index:

integer maximumKeyLength
 The maximum length of a key. Adjusts (increases) over life-cycle.
 
const NString noKey
 String to identify global keys.
 
NAStringtargetBuffer
 The target to write to.
 
ScopeInfo::ThreadDictionarythreadDict
 User-defined threads names.
 

Protected Method Index:

ALIB_API NAStringstoreKeyToScope (String key)
 
ALIB_API NAStringstoreThreadToScope (ThreadID threadID)
 
template<typename T >
ALIB_API integer writeStoreMapHelper (SSMap< T > &map, const NString &prefix)
 

Field Details:

◆ maximumKeyLength

integer maximumKeyLength
protected

The maximum length of a key. Adjusts (increases) over life-cycle.

Definition at line 42 of file scopedump.inl.

◆ noKey

const NString noKey
protected

String to identify global keys.

Definition at line 39 of file scopedump.inl.

◆ targetBuffer

NAString& targetBuffer
protected

The target to write to.

Definition at line 36 of file scopedump.inl.

◆ threadDict

ScopeInfo::ThreadDictionary& threadDict
protected

User-defined threads names.

Definition at line 46 of file scopedump.inl.

Constructor(s) / Destructor Details:

◆ ScopeDump()

ScopeDump ( ScopeInfo::ThreadDictionary & threadDictionary,
const NString noKeyHashKey,
NAString & target,
int maxKeyLength = 10 )
inline

Constructor

Parameters
threadDictionaryUser-defined threads names.
targetTarget string to write to.
noKeyHashKeyString to identify global keys.
maxKeyLengthThe start value for the maximum length of a key.

Definition at line 62 of file scopedump.inl.

Method Details:

◆ storeKeyToScope()

ALIB_API NAString & storeKeyToScope ( String key)
protected

Helper method to write a StringTree's key as scope information.

Parameters
keyThe key used for the StringTree.
Returns
The target to allow concatenated calls.

◆ storeThreadToScope()

ALIB_API NAString & storeThreadToScope ( ThreadID threadID)
protected

Helper method to write thread information.

Parameters
threadIDThe thread id.
Returns
The target to allow concatenated calls.

◆ writeStore()

template<typename T >
ALIB_API int writeStore ( ScopeStore< T, true > * store,
int indentSpaces )

Writes the contents of the ScopeStore used for Scope Domains.

Parameters
storeThe store to use
indentSpacesThe number of spaces to add at the beginning of each line.
Returns
The total number of Scope Domains written.

◆ writeStoreMap()

template<typename T >
ALIB_API int writeStoreMap ( ScopeStore< T, false > * store)

Writes hash tables stored in a ScopeStore. Keys are Strings. Value types currently supported are LogData* and int.

Parameters
storeThe store to use.
Returns
The total number of hash table entries written.

◆ writeStoreMapHelper()

template<typename T >
ALIB_API integer writeStoreMapHelper ( SSMap< T > & map,
const NString & prefix )
protected

Helper method to writeStoreMap.

Parameters
mapThe map to use
prefixA prefix string for each line
Returns
The number of objects written

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