18template<
typename T>
void write(
const T& val,
NAString& target ) { target._(val); }
20template<
typename T>
void write( T* val,
NAString& target ) {
22 if( std::is_same<T, Box*>::value ) {
25 integer actLen= buffer.Length();
33 target._(*
static_cast<Box*
>(val));
42 integer methodEnd= fileNameEnd >= 0 ? key.IndexOf(
'#', fileNameEnd + 1) : -1;
46 else if ( fileNameEnd >= 0 )
targetBuffer._<NC>(
"FileName [" );
52 if ( methodEnd >= 0 ) {
53 targetBuffer.ReplaceSubstring<NC>(
" @", targetStart + fileNameEnd +1, 2 );
57 if ( fileNameEnd >= 0 )
58 targetBuffer.ReplaceSubstring<NC>(
".*", targetStart + fileNameEnd, 1);
67#if !ALIB_SINGLE_THREADED
71 return targetBuffer._(
"[Thread=\"")._( it->second )._(
"\"]");
73 return targetBuffer._(
"[ThreadID=")._( threadID )._(
']');
79 for (
auto& it : map ) {
84 if ( it.first.template Equals<NC>(
noKey ) )
85 keyString._<NC>(
"<global>" );
87 keyString._<NC>(
'"' )._( it.first )._(
'"' );
106 bool firstEntry=
true;
107 if ( store->globalStore && store->globalStore->Size() > 0) {
108 cnt+= int( store->globalStore->Size() );
114#if !ALIB_SINGLE_THREADED
115 for (
auto threadIt= store->threadStore.begin() ; threadIt != store->threadStore.end() ; ++threadIt ) {
116 if ( threadIt->first.first==
false )
118 if( firstEntry ) firstEntry=
false;
else targetBuffer.NewLine();
120 cnt+= int( threadIt->second->Size() );
126 StringTreeIterator<typename ScopeStore<T, false>::TLanguageStore> iterator;
127 typename decltype(iterator)::NameSorter sorter;
128 iterator.SetSorting(&sorter);
134 if( *iterator.Node() ==
nullptr )
136 cnt+= int( (*iterator.Node())->Size() );
137 if( firstEntry ) firstEntry=
false;
else targetBuffer.NewLine();
143#if !ALIB_SINGLE_THREADED
144 for (
auto threadIt= store->threadStore.begin() ; threadIt != store->threadStore.end() ; ++threadIt ) {
145 if ( threadIt->first.first ==
true )
147 if( firstEntry ) firstEntry=
false;
else targetBuffer.NewLine();
149 cnt+= int( threadIt->second->Size() );
161 if ( store->globalStore !=
nullptr ) {
169#if !ALIB_SINGLE_THREADED
170 for (
auto threadIt= store->threadStore.begin() ; threadIt != store->threadStore.end() ; ++threadIt )
171 if( threadIt->first.first ==
false )
172 for (
auto& it : threadIt->second ) {
177 ._<NC>(
"Scope::ThreadOuter " );
184 StringTreeIterator<typename ScopeStore<T, true>::TLanguageStore> iterator;
185 typename decltype(iterator)::NameSorter sorter;
186 iterator.SetSorting(&sorter);
192 if( *iterator.Node() ==
nullptr )
202#if !ALIB_SINGLE_THREADED
203 for (
auto threadIt= store->threadStore.begin() ; threadIt != store->threadStore.end() ; ++threadIt )
204 if( threadIt->first.first ==
true )
205 for (
auto& it : threadIt->second ) {
210 ._<NC>(
"Scope::ThreadInner " );
static void ReplaceToReadable(AString &target, integer startIdx)
integer writeStoreMapHelper(SSMap< T > &map, const NString &prefix)
NAString & targetBuffer
The target to write to.
NAString & storeKeyToScope(String key)
ScopeInfo::ThreadDictionary & threadDict
User-defined threads names.
NAString & storeThreadToScope(ThreadID threadID)
const NString noKey
String to identify global keys.
integer maximumKeyLength
The maximum length of a key. Adjusts (increases) over life-cycle.
int writeStore(ScopeStore< T, true > *store, int indentSpaces)
int writeStoreMap(ScopeStore< T, false > *store)
TAString & _(const TAppendable &src)
integer IndexOf(TChar needle, integer startIdx=0) const
@ Left
Chooses left alignment.
@ On
Switch it on, switched on, etc.
@ Exclude
Chooses exclusion.
HashMap< PoolAllocator, NString, T, std::hash< NString >, std::equal_to< NString >, lang::Caching::Enabled, Recycling::None > SSMap
Shortcut to the ScopeStore's hashmap.
integer ThreadID
The ALib thread identifier type.
strings::TString< nchar > NString
Type alias in namespace #"%alib".
strings::TField< nchar > NField
Type alias in namespace #"%alib".
strings::TTab< nchar > NTab
Type alias in namespace #"%alib".
strings::TEscape< character > Escape
Type alias in namespace #"%alib".
LocalString< 64 > String64
Type alias name for #"TLocalString;TLocalString<character,64>".
strings::TAString< nchar, lang::HeapAllocator > NAString
Type alias in namespace #"%alib".
lang::integer integer
Type alias in namespace #"%alib".
boxing::Box Box
Type alias in namespace #"%alib".
strings::TString< character > String
Type alias in namespace #"%alib".
LocalString< 256 > String256
Type alias name for #"TLocalString;TLocalString<character,256>".