Portability Libraries  2015.2.0.0
Common Methods and Objects for Platform Independance.
SoftwareAndServices::Library::Common::StringCache Class Reference

#include "<SaS/Common/StringCache.hpp>"

+ Inheritance diagram for SoftwareAndServices::Library::Common::StringCache:
+ Collaboration diagram for SoftwareAndServices::Library::Common::StringCache:

Public Member Functions

 StringCache ()
 
 StringCache (const char *ToAdd)
 
 StringCache (const String &ToAdd)
 
virtual ~StringCache ()
 
- Public Member Functions inherited from SoftwareAndServices::Library::Common::instance< StringCache >
 instance ()
 
virtual InstanceCount_t decInstance () const
 
virtual InstanceCount_t getInstance () const
 
virtual InstanceCount_t incInstance () const
 
void operator delete (void *ToFree)
 

Static Public Member Functions

static const char * Add (const char *StringToCache)
 
static const unsigned char * Add (const unsigned char *StringToCache)
 
static const wchar_t * Add (const wchar_t *StringToCache)
 
static uint64_t Count (const char *LookForString)
 
static uint64_t Count (const unsigned char *LookForString)
 
static uint64_t Count (const wchar_t *LookForString)
 
static uint8_t GetHash (const char *HashThisString)
 
static uint8_t GetHash (const unsigned char *HashThisString)
 
static uint8_t GetHash (const wchar_t *HashThisString)
 
static void PrintStats (File *file)
 
static bool Remove (const char *StringToRemove)
 
static bool Remove (const unsigned char *StringToRemove)
 
static bool Remove (const wchar_t *StringToRemove)
 

Detailed Description

This class keeps a reference count of constant strings. The entry will be deleted when its reference count is zero. Once in the cache, it can have more references to it. it can have referenced removed from it. it can be deleted, when the reference count reaches zero. IT CAN NOT BE altered!

When you are done with the strings in the cache - DO NOT DELETE or FREE them.Call StringCache::remove() to keep the reference count accurate.This StromgCache is for commonly used read-only strings.

Definition at line 97 of file StringCache.hpp.


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