alaCarte Maps
Renderer for OpenStreetMap tiles
CachedString::StringStorage Class Reference

Storage class for cached strings. More...

Inheritance diagram for CachedString::StringStorage:

Public Member Functions

void shutdown ()
 Frees all memory allocated by this storage. More...
 
const StringStorageElementgetEmptyString () const
 Returns the storage element for an empty string. More...
 
const StringStorageElementresolveString (const string &str)
 Returns the storage element for a given string. More...
 

Static Public Member Functions

static StringStorageInst ()
 Returns the Storage. More...
 

Private Member Functions

 StringStorage ()
 Creates the StringStorage. More...
 

Private Attributes

StringStorageElement::Hasher stringStorageElementHasher
 The hasher used for StringStorageELements. More...
 
StringStorageElement::StringComparator stringComperator
 The comparator for strings and storage elements. More...
 
const StringStorageElementemptyString
 Pointer to the storage element holding the empty string. More...
 
boost::unordered_set< StringStorageElement, StringStorageElement::Hasherstorage
 internal storage as an hash map More...
 
boost::shared_mutex accessMutex
 The mutex used to lock this class. More...
 

Detailed Description

Storage class for cached strings.

This is an singleton

Definition at line 96 of file cached_string.cpp.

Constructor & Destructor Documentation

CachedString::StringStorage::StringStorage ( )
inlineprivate

Creates the StringStorage.

Definition at line 157 of file cached_string.cpp.

Member Function Documentation

const StringStorageElement* CachedString::StringStorage::getEmptyString ( ) const
inline

Returns the storage element for an empty string.

Definition at line 126 of file cached_string.cpp.

static StringStorage& CachedString::StringStorage::Inst ( )
inlinestatic

Returns the Storage.

If no storage exists a new one will be created once!

Definition at line 106 of file cached_string.cpp.

const StringStorageElement* CachedString::StringStorage::resolveString ( const string str)
inline

Returns the storage element for a given string.

If no element exists for the string a new element is created.

Definition at line 137 of file cached_string.cpp.

void CachedString::StringStorage::shutdown ( )
inline

Frees all memory allocated by this storage.

Definition at line 116 of file cached_string.cpp.

Member Data Documentation

boost::shared_mutex CachedString::StringStorage::accessMutex
private

The mutex used to lock this class.

Definition at line 173 of file cached_string.cpp.

const StringStorageElement* CachedString::StringStorage::emptyString
private

Pointer to the storage element holding the empty string.

Definition at line 169 of file cached_string.cpp.

boost::unordered_set<StringStorageElement, StringStorageElement::Hasher> CachedString::StringStorage::storage
private

internal storage as an hash map

Definition at line 171 of file cached_string.cpp.

StringStorageElement::StringComparator CachedString::StringStorage::stringComperator
private

The comparator for strings and storage elements.

Definition at line 166 of file cached_string.cpp.

StringStorageElement::Hasher CachedString::StringStorage::stringStorageElementHasher
private

The hasher used for StringStorageELements.

Definition at line 164 of file cached_string.cpp.


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