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

#include <stringatomtablebase.h>

Detailed Description

This implements the base class for thread-local and global string atom table classes.

In order to reduce thread-synchronization, there are 2 levels of string atom tables in N3. One global string atom table for all threads, and one thread-local string atom table in each thread which acts as a cache for the global table. If a new string atom is created from a string, the thread-local string atom table will be searched first. If the string has already been registered in the thread-local table, the string atom will be setup and no locking at all is necessary. Only if the string is not in the thread local table, the global string atom table will be consulted (which requires locking). If the string is in the global table, the pointer to the string will be sorted into the thread-local atom table and the string will be setup. If the string is completely new (not even in the global atom table), then the string needs to be sorted both into the global, and the thread-local atom table.

Inherited by Util::GlobalStringAtomTable, and Util::LocalStringAtomTable.

Classes

struct  StaticString
 a static string class for sorting the array More...
 

Public Member Functions

 StringAtomTableBase ()
 constructor
 
 ~StringAtomTableBase ()
 destructor
 

Protected Member Functions

const char * Find (const char *str) const
 find a string pointer in the atom table
 

Protected Attributes

Util::Array< StaticStringtable
 

Friends

class StringAtom
 

Constructor & Destructor Documentation

◆ StringAtomTableBase()

Util::StringAtomTableBase::StringAtomTableBase ( )

constructor

◆ ~StringAtomTableBase()

Util::StringAtomTableBase::~StringAtomTableBase ( )

destructor

Member Function Documentation

◆ Find()

const char * Util::StringAtomTableBase::Find ( const char * str) const
protected

find a string pointer in the atom table

Friends And Related Symbol Documentation

◆ StringAtom

friend class StringAtom
friend

Member Data Documentation

◆ table

Util::Array<StaticString> Util::StringAtomTableBase::table
protected

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