ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::lox::detail::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 20 of file scopedump.inl.

Collaboration diagram for alib::lox::detail::ScopeDump:
[legend]

Public Method Index:

 ScopeDump (ScopeInfo::ThreadDictionary &threadDictionary, const NString noKeyHashKey, NAString &target, int maxKeyLength=10)
 
template<typename T>
ALIB_DLL int writeStore (ScopeStore< T, true > *store, int indentSpaces)
 
template<typename T>
ALIB_DLL 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_DLL NAStringstoreKeyToScope (String key)
 
ALIB_DLL NAStringstoreThreadToScope (ThreadID threadID)
 
template<typename T>
ALIB_DLL integer writeStoreMapHelper (SSMap< T > &map, const NString &prefix)
 

Field Details:

◆ maximumKeyLength

integer alib::lox::detail::ScopeDump::maximumKeyLength
protected

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

Definition at line 30 of file scopedump.inl.

◆ noKey

const NString alib::lox::detail::ScopeDump::noKey
protected

String to identify global keys.

Definition at line 27 of file scopedump.inl.

◆ targetBuffer

NAString& alib::lox::detail::ScopeDump::targetBuffer
protected

The target to write to.

Definition at line 24 of file scopedump.inl.

◆ threadDict

ScopeInfo::ThreadDictionary& alib::lox::detail::ScopeDump::threadDict
protected

User-defined threads names.

Definition at line 34 of file scopedump.inl.

Constructor(s) / Destructor Details:

◆ ScopeDump()

alib::lox::detail::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 45 of file scopedump.inl.

Method Details:

◆ storeKeyToScope()

ALIB_DLL NAString & alib::lox::detail::ScopeDump::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_DLL NAString & alib::lox::detail::ScopeDump::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_DLL int alib::lox::detail::ScopeDump::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_DLL int alib::lox::detail::ScopeDump::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_DLL integer alib::lox::detail::ScopeDump::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: