This class can be used to implement a string factory that will be used by the class IlsString
.
More...
#include <ilserver/sstring.h>
Public Member Functions | |
virtual IlsString::RefCount | getMinCount ()=0 |
Return the minimum value of the reference counter that is of interest to the factory. More... | |
virtual IlsString | getString (const char *value, int count=-1)=0 |
Returns a pointer to an IlsString object built from the string value. More... | |
virtual void | reachedMinCount (IlsString &)=0 |
Called by the class IlsString every time the reference counter is equal or less than the value returned by the method getMinCount() . More... | |
Static Public Member Functions | |
static IlsStringFactory * | GetSingletonPtr () |
Gets a pointer to the IlsString factory if there is one. | |
static IlsStringFactory * | SetSingleton (IlsStringFactory *newFactory) |
Sets the IlsString factory. More... | |
Protected Member Functions | |
void | deleteString (IlsString &) |
Deletes the internal representation of the string and resets the string to the null string. | |
IlsString | makeNonFactoryString (const char *, int=-1) |
Creates a new instance of a string when needed. More... | |
This class can be used to implement a string factory that will be used by the class IlsString
.
Library: server
and mvcomp
IlsString
.
|
pure virtual |
Return the minimum value of the reference counter that is of interest to the factory.
If the factory is not interested in being notified, via the callback reachMinCount()
, then this method should always return a negative number.
|
pure virtual |
Returns a pointer to an IlsString
object built from the string value.
An example of the use of this method would be to cache IlsString
instances and to return a copy of the string if it exists already. If the count parameter is greater than zero, only the first count characters of the string should be used to create the new string.
|
protected |
Creates a new instance of a string when needed.
This function calls the protected constructor of the class IlsString
, which creates a string without using the string factory.
|
pure virtual |
Called by the class IlsString
every time the reference counter is equal or less than the value returned by the method getMinCount()
.
An example of the use of this method is to remove a string from a cache every time the reference count drops to zero, or to one if the string is also held by the cache.
|
static |
Sets the IlsString
factory.
The function returns the pointer to the old factory if any. It is the responsibility of the user to delete any factories created if necessary.
newFactory | the new string factory |