8#if !defined(ALIB_C20_MODULES) || ((ALIB_C20_MODULES != 0) && (ALIB_C20_MODULES != 1))
9# error "Symbol ALIB_C20_MODULES has to be given to the compiler as either 0 or 1"
59template<
typename T>
void write(
const T& val,
NAString& target )
64template<
typename T>
void write( T* val,
NAString& target )
67 if( std::is_same<T, Box*>::value )
71 integer actLen= buffer.Length();
79 target._(*
static_cast<Box*
>(val));
89 integer methodEnd= fileNameEnd >= 0 ? key.IndexOf(
'#', fileNameEnd + 1) : -1;
93 else if ( fileNameEnd >= 0 )
targetBuffer._<NC>(
"FileName [" );
101 targetBuffer.ReplaceSubstring<NC>(
" @", targetStart + fileNameEnd +1, 2 );
105 if ( fileNameEnd >= 0 )
106 targetBuffer.ReplaceSubstring<NC>(
".*", targetStart + fileNameEnd, 1);
115#if !ALIB_SINGLE_THREADED
120 return targetBuffer._(
"[Thread=\"")._( it->second )._(
"\"]");
122 return targetBuffer._(
"[ThreadID=")._( threadID )._(
']');
129 for (
auto& it : map )
135 if ( it.first.template Equals<NC>(
noKey ) )
136 keyString._<NC>(
"<global>" );
138 keyString._<NC>(
'"' )._( it.first )._(
'"' );
158 bool firstEntry=
true;
159 if ( store->globalStore && store->globalStore->Size() > 0)
161 cnt+= int( store->globalStore->Size() );
167#if !ALIB_SINGLE_THREADED
168 for (
auto thread= store->threadStore.begin() ; thread != store->threadStore.end() ; ++thread )
170 if ( thread->first.first==
false )
172 if( firstEntry ) firstEntry=
false;
else targetBuffer.NewLine();
174 cnt+= int( thread->second->Size() );
184 for( iterator.Initialize( store->languageStore) ; iterator.IsValid() ; iterator.Next() )
186 if( *iterator.Node() ==
nullptr )
188 cnt+= int( (*iterator.Node())->Size() );
189 if( firstEntry ) firstEntry=
false;
else targetBuffer.NewLine();
195#if !ALIB_SINGLE_THREADED
196 for (
auto thread= store->threadStore.begin() ; thread != store->threadStore.end() ; ++thread )
198 if ( thread->first.first ==
true )
200 if( firstEntry ) firstEntry=
false;
else targetBuffer.NewLine();
202 cnt+= int( thread->second->Size() );
215 if ( store->globalStore !=
nullptr )
224#if !ALIB_SINGLE_THREADED
225 for (
auto thread= store->threadStore.begin() ; thread != store->threadStore.end() ; ++thread )
226 if( thread->first.first ==
false )
227 for (
auto& it : thread->second )
233 ._<NC>(
"Scope::ThreadOuter " );
244 for( iterator.Initialize( store->languageStore ); iterator.IsValid() ; iterator.Next() )
246 if( *iterator.Node() ==
nullptr )
257#if !ALIB_SINGLE_THREADED
258 for (
auto thread= store->threadStore.begin() ; thread != store->threadStore.end() ; ++thread )
259 if( thread->first.first ==
true )
260 for (
auto& it : thread->second )
266 ._<NC>(
"Scope::ThreadInner " );
TRecursiveIterator< false > RecursiveIterator
static ALIB_DLL void ReplaceToReadable(AString &target, integer startIdx)
ALIB_DLL NAString & storeThreadToScope(ThreadID threadID)
ALIB_DLL NAString & storeKeyToScope(String key)
NAString & targetBuffer
The target to write to.
ALIB_DLL int writeStore(ScopeStore< T, true > *store, int indentSpaces)
ScopeInfo::ThreadDictionary & threadDict
User-defined threads names.
ALIB_DLL integer writeStoreMapHelper(SSMap< T > &map, const NString &prefix)
ALIB_DLL int writeStoreMap(ScopeStore< T, false > *store)
const NString noKey
String to identify global keys.
integer maximumKeyLength
The maximum length of a key. Adjusts (increases) over life-cycle.
TAString & _(const TAppendable &src)
integer IndexOf(TChar needle, integer startIdx=0) const
@ Left
Chooses left alignment.
@ On
Switch it on, switched on, etc.
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::TEscape< character > Escape
Type alias in namespace alib.
LocalString< 512 > String512
Type alias name for TLocalString<character,512>.
LocalString< 256 > String256
Type alias name for TLocalString<character,256>.
LocalString< 64 > String64
Type alias name for TLocalString<character,64>.
lang::integer integer
Type alias in namespace alib.
strings::TString< nchar > NString
Type alias in namespace alib.
strings::TAString< nchar, lang::HeapAllocator > NAString
Type alias in namespace alib.
strings::TTab< nchar > NTab
Type alias in namespace alib.
boxing::Box Box
Type alias in namespace alib.
strings::TField< nchar > NField
Type alias in namespace alib.
strings::TString< character > String
Type alias in namespace alib.