alaCarte Maps
Renderer for OpenStreetMap tiles
MaybeCachedString Class Reference

Represents a string which could be cached into an internal cache. More...

#include <cached_string.hpp>

Public Member Functions

 MaybeCachedString ()
 Returns the internal c string. More...
 
 MaybeCachedString (const string &str)
 Creates a non cached string from a string. More...
 
 MaybeCachedString (const CachedString &other)
 Creates a cached string from a cached string. More...
 
 MaybeCachedString (const MaybeCachedString &other)
 Creates a maybe cached string from another maybe cached string. More...
 
 ~MaybeCachedString ()
 Destroys this object. More...
 
MaybeCachedStringoperator= (const string &str)
 Assigns a non cached std string. More...
 
MaybeCachedStringoperator= (const CachedString &other)
 Assigns a cached string. More...
 
MaybeCachedStringoperator= (const MaybeCachedString &other)
 Assigns a maybe cached string. More...
 
bool equals (const string &other) const
 Compares this string with a given std string. More...
 
bool equals (const CachedString &other) const
 Compares this string with a cached string. More...
 
bool equals (const MaybeCachedString &other) const
 Compares this string with another maybe cached string. More...
 
void assign (const string &str)
 Assigns a non cached std string. More...
 
void assign (const MaybeCachedString &other)
 Assigns a maybe cached string. More...
 
void assign (const CachedString &other)
 Assigns a cached string. More...
 
const char * c_str () const
 Returns the internal c string. More...
 
const stringstr () const
 Returns the internal string. More...
 
void clear ()
 Sets this string to be the empty string. More...
 
std::size_t hash () const
 Returns the internal hash. More...
 
bool isCached () const
 Returns weather this string is cached. More...
 
bool operator< (const MaybeCachedString &other) const
 

Private Types

typedef CachedString::StringStorageElement StringStorageElement
 
typedef CachedString::StringStorage StringStorage
 

Private Member Functions

void reset ()
 deletes rge internal string if it is not cached More...
 

Private Attributes

bool cached
 
const StringStorageElementinternalString
 

Friends

class CachedString
 

Detailed Description

Represents a string which could be cached into an internal cache.

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

Definition at line 126 of file cached_string.hpp.

Member Typedef Documentation

Constructor & Destructor Documentation

MaybeCachedString::MaybeCachedString ( )

Returns the internal c string.

Definition at line 337 of file cached_string.cpp.

MaybeCachedString::MaybeCachedString ( const string str)
explicit

Creates a non cached string from a string.

Definition at line 353 of file cached_string.cpp.

MaybeCachedString::MaybeCachedString ( const CachedString other)

Creates a cached string from a cached string.

Definition at line 363 of file cached_string.cpp.

MaybeCachedString::MaybeCachedString ( const MaybeCachedString other)

Creates a maybe cached string from another maybe cached string.

Definition at line 372 of file cached_string.cpp.

MaybeCachedString::~MaybeCachedString ( )

Destroys this object.

Definition at line 382 of file cached_string.cpp.

Member Function Documentation

void MaybeCachedString::assign ( const string str)

Assigns a non cached std string.

Definition at line 428 of file cached_string.cpp.

void MaybeCachedString::assign ( const MaybeCachedString other)

Assigns a maybe cached string.

Definition at line 439 of file cached_string.cpp.

void MaybeCachedString::assign ( const CachedString other)

Assigns a cached string.

Definition at line 454 of file cached_string.cpp.

const char * MaybeCachedString::c_str ( ) const

Returns the internal c string.

Definition at line 501 of file cached_string.cpp.

void MaybeCachedString::clear ( )

Sets this string to be the empty string.

Definition at line 531 of file cached_string.cpp.

bool MaybeCachedString::equals ( const string other) const

Compares this string with a given std string.

Definition at line 464 of file cached_string.cpp.

bool MaybeCachedString::equals ( const CachedString other) const

Compares this string with a cached string.

Definition at line 473 of file cached_string.cpp.

bool MaybeCachedString::equals ( const MaybeCachedString other) const

Compares this string with another maybe cached string.

Definition at line 487 of file cached_string.cpp.

std::size_t MaybeCachedString::hash ( ) const

Returns the internal hash.

Definition at line 521 of file cached_string.cpp.

bool MaybeCachedString::isCached ( ) const

Returns weather this string is cached.

Definition at line 552 of file cached_string.cpp.

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

Definition at line 159 of file cached_string.hpp.

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

Assigns a non cached std string.

Definition at line 397 of file cached_string.cpp.

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

Assigns a cached string.

Definition at line 407 of file cached_string.cpp.

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

Assigns a maybe cached string.

Definition at line 417 of file cached_string.cpp.

void MaybeCachedString::reset ( )
private

deletes rge internal string if it is not cached

Definition at line 542 of file cached_string.cpp.

const string & MaybeCachedString::str ( ) const

Returns the internal string.

Definition at line 511 of file cached_string.cpp.

Friends And Related Function Documentation

friend class CachedString
friend

Definition at line 128 of file cached_string.hpp.

Member Data Documentation

bool MaybeCachedString::cached
private

Definition at line 172 of file cached_string.hpp.

const StringStorageElement* MaybeCachedString::internalString
private

Definition at line 173 of file cached_string.hpp.


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