Photon C++ Client API
5.0.7.3
|
Public Member Functions | |
virtual | ~DictionaryBase (void) |
DictionaryBase (const DictionaryBase &toCopy) | |
virtual DictionaryBase & | operator= (const DictionaryBase &toCopy) |
virtual const nByte * | getKeyTypes (void) const |
virtual const nByte * | getValueTypes (void) const |
template<typename FKeyType > | |
const int * | getValueSizes (const FKeyType &key) const |
virtual const unsigned int * | getValueDimensions (void) const |
virtual nByte | getValueCustomType (void) const |
JString | typeToString (void) const |
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 GenericAssociativeContainerBase< DictionaryBase, Hashtable, Object > | |
virtual | ~GenericAssociativeContainerBase (void)=0 |
virtual bool | operator== (const DictionaryBase &toCompare) const |
virtual bool | operator!= (const DictionaryBase &toCompare) const |
virtual void | put (const DictionaryBase &src) |
virtual void | removeAt (unsigned int index) |
virtual void | removeAllElements (void) |
virtual JString & | toString (JString &retStr, bool withTypes=false) const =0 |
JString | toString (bool withTypes=false) const |
virtual const Hashtable & | getHashtable (void) const |
virtual unsigned int | getSize (void) 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) |
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 DictionaryBase class is the base class for the Dictionary class template and intended to be used instead of Dictionary in cases, when the key type and/or value type of a Dictionary instance can't be known at compile time, but only at runtime.
Whenever possible you should use the class template Dictionary instead of DictionaryBase to enable compile time type safety and optimizations that need compile time type identification. However, when for example receiving unknown data over the network at runtime, the type of that data can't be non at compile time. In those cases DictionaryBase instances are used.
DictionaryBase instances only offer read only API: They can't be modified with the exception of replacing the complete instance with the content of another one. No single entries can be added, removed, or changed. Use the Dictionary sub class template for modifiable Dictionary instances.
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 Dictionary.
|
virtual |
Destructor.
DictionaryBase | ( | const DictionaryBase & | toCopy | ) |
Copy-Constructor: Creates a deep copy of the argument.
toCopy | The instance to copy. |
|
virtual |
operator=. Makes a deep copy of its right operand into its left operand. This overwrites old data in the left operand.
Reimplemented in Dictionary< EKeyType, EValueType >, Dictionary< nByte, ExitGames::Common::Object >, Dictionary< ExitGames::Common::Object, ExitGames::Common::Object >, and Dictionary< nByte, Common::Object >.
|
virtual |
Only index 0 of the returned array is guaranteed to be valid. The existence of elements at other indices depends on the value of the element in the array returned by getValueTypes() at the previous index in the following way: Only when getValueTypes()[i] == TypeCode::DICTIONARY, then getKeyTypes()[i+1] will be valid.
Type information for nested Dictionaries will be stored like in the following example: Dictionary<int, Dictionary<short, float**>*> This is a Dictionary, with the key type being int and the value type being a 1D array of type Dictionary<short, float**>, so that all values are Dictionaries, which keys are shorts and which values are 2D arrays of float. This function's return value in this example will hold the values TypeCode::INTEGER at index 0 and TypeCode::SHORT at index 1.
The codes returned by this function match the ones, that are stored in member variable "typename" of class template Helpers::ConfirmAllowedKey's specializations. Only the types, for which specializations of that template exist, are valid Dictionary keys.
Reimplemented in Dictionary< EKeyType, EValueType >, Dictionary< nByte, ExitGames::Common::Object >, Dictionary< ExitGames::Common::Object, ExitGames::Common::Object >, and Dictionary< nByte, Common::Object >.
|
virtual |
Only index 0 of the returned array is guaranteed to be valid. The existence of elements at other indices depends on the value of the element at the previous index in the following way: Only when getValueTypes()[i] == TypeCode::DICTIONARY, then getValueTypes()[i+1] will be valid.
Type information for nested Dictionaries will be stored like in the following example: Dictionary<int, Dictionary<short, float**>*> This is a Dictionary, with the key type being int and the value type being a 1D array of type Dictionary<short, float**>, so that all values are Dictionaries, which keys are shorts and which values are 2D arrays of float. This function's return value in this example will hold the values TypeCode::DICTIONARY at index 0 and TypeCode::FLOAT at index 1.
The codes returned by this function match the ones, that are stored in member variable "typename" of class template Helpers::ConfirmAllowed's specializations. Only the types, for which specializations of that template exist, are valid Dictionary values.
Reimplemented in Dictionary< EKeyType, EValueType >, Dictionary< nByte, ExitGames::Common::Object >, Dictionary< ExitGames::Common::Object, ExitGames::Common::Object >, and Dictionary< nByte, Common::Object >.
const int * getValueSizes | ( | const FKeyType & | key | ) | const |
key | Reference to the key to return the corresponding value sizes for |
|
virtual |
Only index 0 of the returned array is guaranteed to be valid. The existence of elements at other indices depends on the value of the element in the array returned by getValueTypes() at the previous index in the following way: Only when getValueTypes()[i] == TypeCode::DICTIONARY, then getValueDimensions()[i+1] will be valid.
Type information for nested Dictionaries will be stored like in the following example: Dictionary<int, Dictionary<short, float**>*> This is a Dictionary, with the key type being int and the value type being a 1D array of type Dictionary<short, float**>, so that all array-elements are Dictionaries, which keys are shorts and which values are 2D arrays of float. This function's return value in this example will hold the value 1 (for 1D array) at index 0 and 2 (for 2D) at index 1. If a value type is no array, then this functions return value will contain 0 at the corresponding index.
Reimplemented in Dictionary< EKeyType, EValueType >, Dictionary< nByte, ExitGames::Common::Object >, Dictionary< ExitGames::Common::Object, ExitGames::Common::Object >, and Dictionary< nByte, Common::Object >.
|
virtual |
The returned value will be the custom type code, if the type at the last index of the array that is returned by getValueTypes() is TypeCode::CUSTOM (aka if the Dictionary (or in case of nested Dictionaries the most inner Dictionary) has a subclass of class CustomType as value type), otherwise it will will be 0.
Reimplemented in Dictionary< EKeyType, EValueType >, Dictionary< nByte, ExitGames::Common::Object >, Dictionary< ExitGames::Common::Object, ExitGames::Common::Object >, and Dictionary< nByte, Common::Object >.
|
virtual |
Reimplemented from ToString.
Reimplemented in Dictionary< nByte, ExitGames::Common::Object >, Dictionary< ExitGames::Common::Object, ExitGames::Common::Object >, Dictionary< nByte, Common::Object >, Dictionary< nByte, ExitGames::Common::Object >, Dictionary< ExitGames::Common::Object, ExitGames::Common::Object >, and Dictionary< nByte, Common::Object >.
retStr | reference to a string, to store the return-value in; the information, which is generated by this function, will be attached at the end of any eventually existing previous content of the string |
withTypes | set to true, to include type information in the generated string |
Reimplemented from GenericAssociativeContainerBase< DictionaryBase, Hashtable, Object >.
Reimplemented in Dictionary< EKeyType, EValueType >, Dictionary< nByte, ExitGames::Common::Object >, Dictionary< ExitGames::Common::Object, ExitGames::Common::Object >, and Dictionary< nByte, Common::Object >.
toString |
retStr | reference to a string, to store the return-value in; the information, which is generated by this function, will be attached at the end of any eventually existing previous content of the string |
withTypes | set to true, to include type information in the generated string |
JString toString |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
withTypes | set to true, to include type information in the generated string |