Nebula
Loading...
Searching...
No Matches
Util::GlobalStringAtomTable Class Reference

#include <globalstringatomtable.h>

Detailed Description

Global string atom table.

This is the definitive string atom table which contains the string of all string atoms of all threads. Locking is necessary to lookup or add a string (that's why thread-local string atom tables exist as local cache to prevent too much locking of the global table).

Inherits Util::StringAtomTableBase.

Classes

struct  DebugInfo
 debug functionality: DebugInfo struct More...
 

Public Member Functions

 GlobalStringAtomTable ()
 constructor
 
 ~GlobalStringAtomTable ()
 destructor
 
StringBufferGetGlobalStringBuffer () const
 get pointer to global string buffer
 
DebugInfo GetDebugInfo () const
 debug functionality: get copy of the string atom table
 
- Public Member Functions inherited from Util::StringAtomTableBase
 StringAtomTableBase ()
 constructor
 
 ~StringAtomTableBase ()
 destructor
 

Private Member Functions

 __DeclareInterfaceSingleton (GlobalStringAtomTable)
 
void Lock ()
 take the critical section
 
const char * Add (const char *str)
 add a string pointer to the atom table and string buffer (must be called inside Lock())
 
void Unlock ()
 release the critical section
 

Private Attributes

Threading::CriticalSection critSect
 
StringBuffer stringBuffer
 

Friends

class StringAtom
 

Additional Inherited Members

- Protected Member Functions inherited from Util::StringAtomTableBase
const char * Find (const char *str) const
 find a string pointer in the atom table
 
- Protected Attributes inherited from Util::StringAtomTableBase
Util::Array< StaticStringtable
 

Constructor & Destructor Documentation

◆ GlobalStringAtomTable()

Util::GlobalStringAtomTable::GlobalStringAtomTable ( )

constructor

◆ ~GlobalStringAtomTable()

Util::GlobalStringAtomTable::~GlobalStringAtomTable ( )

destructor

Member Function Documentation

◆ __DeclareInterfaceSingleton()

Util::GlobalStringAtomTable::__DeclareInterfaceSingleton ( GlobalStringAtomTable )
private

◆ Add()

const char * Util::GlobalStringAtomTable::Add ( const char * str)
private

add a string pointer to the atom table and string buffer (must be called inside Lock())

This adds a new string to the atom table and the global string buffer, and returns the pointer to the string in the string buffer.

NOTE: you MUST call this method within Lock()/Unlock()!

◆ GetDebugInfo()

GlobalStringAtomTable::DebugInfo Util::GlobalStringAtomTable::GetDebugInfo ( ) const

debug functionality: get copy of the string atom table

Debug method: get an array with all string in the table.

◆ GetGlobalStringBuffer()

StringBuffer * Util::GlobalStringAtomTable::GetGlobalStringBuffer ( ) const

get pointer to global string buffer

◆ Lock()

void Util::GlobalStringAtomTable::Lock ( )
private

take the critical section

◆ Unlock()

void Util::GlobalStringAtomTable::Unlock ( )
private

release the critical section

Friends And Related Symbol Documentation

◆ StringAtom

friend class StringAtom
friend

Member Data Documentation

◆ critSect

Threading::CriticalSection Util::GlobalStringAtomTable::critSect
private

◆ stringBuffer

StringBuffer Util::GlobalStringAtomTable::stringBuffer
private

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