Photon C++ Client API
5.0.7.3
|
Public Member Functions | |
KeyObject (const KeyObject< Etype > &toCopy) | |
KeyObject (const Object &obj) | |
KeyObject (const Object *obj) | |
KeyObject (const typename Helpers::ConfirmAllowedKey< Etype >::type &data) | |
virtual | ~KeyObject (void) |
virtual KeyObject< Etype > & | operator= (const KeyObject< Etype > &toCopy) |
virtual KeyObject< Etype > & | operator= (const Object &toCopy) |
Etype | getDataCopy (void) const |
Etype * | getDataAddress (void) const |
Public Member Functions inherited from Object | |
Object (void) | |
virtual | ~Object (void) |
Object (const Object &toCopy) | |
bool | operator== (const Object &toCompare) const |
bool | operator!= (const Object &toCompare) const |
nByte | getType (void) const |
nByte | getCustomType (void) const |
const int * | getSizes (void) const |
unsigned int | getDimensions (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 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) |
Container class template for objects to be stored as keys in a Hashtable or Dictionary.
Copy-Constructor.
Creates an object out of a deep copy of its parameter.
The parameter has to be of the same template instantiation as the object, you want to create.
toCopy | The object to copy. |
Constructor.
Creates an object out of a deep copy of the passed Object&.
If the type of the content of the passed object does not match the template instantiation of the object to create, an empty object is created instead of a copy of the passed object, which leads to getDataCopy() and getDataAddress() return 0.
obj | The Object& to copy. |
Constructor.
Creates an object out of a deep copy of the passed Object*.
If the type of the content of the passed object does not match the template instantiation of the object to create, an empty object is created instead of a copy of the passed object, which leads to getDataCopy() and getDataAddress() return 0.
obj | The Object* to copy. |
KeyObject | ( | const typename Helpers::ConfirmAllowedKey< Etype >::type & | data | ) |
Constructor.
Creates an object out of a deep copy of the passed Etype.
data | The value to copy. Has to be of a supported type. |
|
virtual |
Destructor.
operator= : Makes a deep copy of its right operand into its left operand. This overwrites old data in the left operand.
operator= : Makes a deep copy of its right operand into its left operand. This overwrites old data in the left operand.
If the type of the content of the right operand does not match the template instantiation of the left operand, then the left operand stays unchanged.
Reimplemented from Object.
Etype getDataCopy | ( | void | ) | const |
Returns a deep copy of the content of the object. If you only need access to the content, while the object still exists, you can use getDataAddress() instead to avoid the deep copy. That is especially interesting for large content, of course.
If successful, the template instantiations for array types of this function allocate the data for the copy, so you have to free (for arrays of primitive types) or delete (for arrays of class objects) it, as soon, as you do not need the array anymore. All non-array copies free there memory automatically, as soon as they leave their scope, same as the single indices of the array, as soon, as the array is freed.
In case of an error this function returns 0 for primitive return types and empty objects for classes.
Etype * getDataAddress | ( | void | ) | const |
Returns the address of the original content of the object. If you need access to the data above lifetime of the object, call getDataCopy().
The return type is a pointer to the data, so it is a double-pointer, of course, for template instantiations, which data already is a pointer.
In case of an error, this function returns 0.