alaCarte Maps
Renderer for OpenStreetMap tiles
CachedString Class Reference

Represents a string which is cached into an internal cache. More...

#include <cached_string.hpp>

Classes

class  StringStorage
 Storage class for cached strings. More...
 
struct  StringStorageElement
 

Public Member Functions

 CachedString ()
 Cretaes a new Cached string. More...
 
 CachedString (const char *str)
 Creates a new cached string from a char ptr. More...
 
 CachedString (const string &str)
 Creates a new cached string from a std string. More...
 
 CachedString (const CachedString &other)
 Creates a new cached string from another cached string. More...
 
 ~CachedString ()
 Tidies up the cached string. More...
 
CachedStringoperator= (const string &str)
 Assigns a std string. More...
 
CachedStringoperator= (const CachedString &other)
 Assigns a cached string. More...
 
bool equals (const string &other) const
 Compares this cached string with an non cached string. More...
 
bool equals (const CachedString &other) const
 Creates a new cached string from another cached string. More...
 
void assign (const string &str)
 Assigns a std string. More...
 
void assign (const CachedString &other)
 Assigns a cached string. More...
 
void clear ()
 Sets this string to the empty string. More...
 
const char * c_str () const
 Returns the internal c string. More...
 
const stringstr () const
 Returns the internal string. More...
 
std::size_t hash () const
 
bool operator< (const CachedString &other) const
 

Static Public Member Functions

static void Shutdown ()
 Frees all internal memory used by the cache mechanism. More...
 

Private Member Functions

template<typename Archive >
void save (Archive &ar, const unsigned int version) const
 
template<class Archive >
void load (Archive &ar, const unsigned int version)
 

Private Attributes

const StringStorageElementinternalString
 

Friends

class boost::serialization::access
 
class MaybeCachedString
 

Detailed Description

Represents a string which is cached into an internal cache.

It is not safe to use an instance of this class in more than one thread!!!

Definition at line 40 of file cached_string.hpp.

Constructor & Destructor Documentation

CachedString::CachedString ( )

Cretaes a new Cached string.

Definition at line 182 of file cached_string.cpp.

CachedString::CachedString ( const char *  str)
explicit

Creates a new cached string from a char ptr.

Definition at line 191 of file cached_string.cpp.

CachedString::CachedString ( const string str)
explicit

Creates a new cached string from a std string.

Definition at line 200 of file cached_string.cpp.

CachedString::CachedString ( const CachedString other)

Creates a new cached string from another cached string.

Definition at line 209 of file cached_string.cpp.

CachedString::~CachedString ( )

Tidies up the cached string.

Definition at line 219 of file cached_string.cpp.

Member Function Documentation

void CachedString::assign ( const string str)

Assigns a std string.

Definition at line 272 of file cached_string.cpp.

void CachedString::assign ( const CachedString other)

Assigns a cached string.

Definition at line 281 of file cached_string.cpp.

const char * CachedString::c_str ( ) const

Returns the internal c string.

Definition at line 301 of file cached_string.cpp.

void CachedString::clear ( )

Sets this string to the empty string.

Definition at line 291 of file cached_string.cpp.

bool CachedString::equals ( const string other) const

Compares this cached string with an non cached string.

Definition at line 227 of file cached_string.cpp.

bool CachedString::equals ( const CachedString other) const

Creates a new cached string from another cached string.

Definition at line 236 of file cached_string.cpp.

std::size_t CachedString::hash ( ) const

Definition at line 317 of file cached_string.cpp.

template<class Archive >
void CachedString::load ( Archive ar,
const unsigned int  version 
)
inlineprivate

Definition at line 99 of file cached_string.hpp.

bool CachedString::operator< ( const CachedString other) const
inline

Definition at line 84 of file cached_string.hpp.

CachedString & CachedString::operator= ( const string str)

Assigns a std string.

Definition at line 251 of file cached_string.cpp.

CachedString & CachedString::operator= ( const CachedString other)

Assigns a cached string.

Definition at line 261 of file cached_string.cpp.

template<typename Archive >
void CachedString::save ( Archive ar,
const unsigned int  version 
) const
inlineprivate

Definition at line 93 of file cached_string.hpp.

void CachedString::Shutdown ( )
static

Frees all internal memory used by the cache mechanism.

Definition at line 327 of file cached_string.cpp.

const string & CachedString::str ( ) const

Returns the internal string.

Definition at line 311 of file cached_string.cpp.

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 42 of file cached_string.hpp.

friend class MaybeCachedString
friend

Definition at line 43 of file cached_string.hpp.

Member Data Documentation

const StringStorageElement* CachedString::internalString
private

Definition at line 108 of file cached_string.hpp.


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