Photon C++ Client API
5.0.7.3
|
Public Member Functions | |
virtual void | put (const Hashtable &src) |
template<typename FKeyType , typename FValueType > | |
void | put (const FKeyType &key, const FValueType &val) |
template<typename FKeyType > | |
void | put (const FKeyType &key) |
template<typename FKeyType , typename FValueType > | |
void | put (const FKeyType &key, const FValueType pVal, int size) |
template<typename FKeyType , typename FValueType > | |
void | put (const FKeyType &key, const FValueType pVal, const int *sizes) |
Public Member Functions inherited from AssociativeContainerBase< Hashtable, Object > | |
virtual | ~AssociativeContainerBase (void)=0 |
AssociativeContainerBase< Hashtable, Object > & | operator= (const AssociativeContainerBase< Hashtable, Object > &toCopy) |
virtual bool | operator== (const AssociativeContainerBase< Hashtable, Object > &toCompare) const |
virtual bool | operator!= (const AssociativeContainerBase< Hashtable, Object > &toCompare) const |
virtual const Object & | operator[] (unsigned int index) const |
virtual const Object & | operator[] (int index) const |
virtual Object & | operator[] (unsigned int index) |
virtual Object & | operator[] (int index) |
void | put (const FKeyType &key, const FValueType &val) |
void | put (const FKeyType &key, const FValueType pVal, int size) |
void | put (const FKeyType &key, const FValueType pVal, const int *sizes) |
const Object * | getValue (const FKeyType &key) const |
Object * | getValue (const FKeyType &key) |
virtual unsigned int | getSize (void) const |
virtual const JVector< Object > & | getKeys (void) const |
void | remove (const FKeyType &key) |
virtual void | removeAt (unsigned int index) |
bool | contains (const FKeyType &key) const |
virtual void | removeAllElements (void) |
virtual JString & | toString (JString &retStr, bool withTypes=false) const |
virtual JString & | toString (JString &retStr, bool withTypes=false) const =0 |
JString | toString (bool withTypes=false) const |
Public Member Functions inherited from Base | |
virtual | ~Base (void)=0 |
Public Member Functions inherited from LoggingBase< Base > | |
virtual | ~LoggingBase (void)=0 |
Public Member Functions inherited from ToString | |
virtual | ~ToString (void) |
virtual JString | typeToString (void) const |
JString | toString (bool withTypes=false) const |
Additional Inherited Members | |
Static Public Member Functions inherited from LoggingBase< Base > | |
static void | setListener (const BaseListener *pBaseListener) |
static int | getDebugOutputLevel (void) |
static bool | setDebugOutputLevel (int debugLevel) |
static const LogFormatOptions & | getLogFormatOptions (void) |
static void | setLogFormatOptions (const LogFormatOptions &options) |
The Hashtable class together with the Dictionary class template is one of the two main container classes for objects to be transmitted over Photon when using the C++ Client.
This class implements the well-known concept of a container structure storing an arbitrary number of key/value-pairs.
In contrast to a Dictionary, the types of both the keys and also the values in a Hashtable can differ for every entry. This adds flexibility, but it also reduces type safety and means, that the type infos have to be stored twice (once for the key and once for the value) per entry in a Hashtable, while in a Dictionary it only has to be stored twice for the whole Dictionary, no matter how many entries are in there. Therefor with Dictionaries transferring the same amount of key-value pairs will cause less traffic than with Hashtables.
Please have a look at the Table of Datatypes for a list of types, that are supported as keys and as values.
Please refer to the documentation for put() and getValue() to see how to store and access data in a Hashtable.
|
virtual |
Adds all pairs of a key and a corresponding value from the passed instance to the instance, on which it is called on. If a key is already existing, then its old value will be replaced with the new one.
src | instance, from which to add the content |
Reimplemented from AssociativeContainerBase< Hashtable, Object >.
void put | ( | const FKeyType & | key, |
const FValueType & | val | ||
) |
Adds a pair of a key and a corresponding value to the instance.
If the key is already existing, then it's old value will be replaced with the new one. Please have a look at the table of datatypes for a list of supported types for keys and values
key | the key to add |
val | the value to add |
void put | ( | const FKeyType & | key | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
This overload adds an empty object as value for the provided key.
void put | ( | const FKeyType & | key, |
const FValueType | pVal, | ||
int | size | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
This overload accepts singledimensional arrays and NULL-pointers passed for parameter pVal. NULL pointers are only legal input, if size is 0
key | the key to add |
pVal | the value array to add |
size | the size of the value array |
void put | ( | const FKeyType & | key, |
const FValueType | pVal, | ||
const int * | sizes | ||
) |