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.
Definition at line 20 of file scopedump.inl.
Public Method Index: | |
| ScopeDump (ScopeInfo::ThreadDictionary &threadDictionary, const NString noKeyHashKey, NAString &target, int maxKeyLength=10) | |
| template<typename T> | |
| int | writeStore (ScopeStore< T, true > *store, int indentSpaces) |
| template<typename T> | |
| 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. | |
| NAString & | targetBuffer |
| The target to write to. | |
| ScopeInfo::ThreadDictionary & | threadDict |
| User-defined threads names. | |
Protected Method Index: | |
| NAString & | storeKeyToScope (String key) |
| NAString & | storeThreadToScope (ThreadID threadID) |
| template<typename T> | |
| integer | writeStoreMapHelper (SSMap< T > &map, const NString &prefix) |
|
protected |
The maximum length of a key. Adjusts (increases) over life-cycle.
Definition at line 30 of file scopedump.inl.
|
protected |
String to identify global keys.
Definition at line 27 of file scopedump.inl.
|
protected |
The target to write to.
Definition at line 24 of file scopedump.inl.
|
protected |
User-defined threads names.
Definition at line 34 of file scopedump.inl.
|
inline |
Constructor
| threadDictionary | User-defined threads names. |
| target | Target string to write to. |
| noKeyHashKey | String to identify global keys. |
| maxKeyLength | The start value for the maximum length of a key. |
Definition at line 45 of file scopedump.inl.
Helper method to write a StringTree's key as scope information.
| key | The key used for the StringTree. |
Helper method to write thread information.
| threadID | The thread id. |
| int alib::lox::detail::ScopeDump::writeStore | ( | ScopeStore< T, true > * | store, |
| int | indentSpaces ) |
Writes the contents of the ScopeStore used for Scope Domains.
| store | The store to use |
| indentSpaces | The number of spaces to add at the beginning of each line. |
| 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.
| store | The store to use. |
|
protected |
Helper method to writeStoreMap.
| map | The map to use |
| prefix | A prefix string for each line |