Serialization::UID Class Reference

Unique identifier referring to one specific native C++ object, member, fundamental variable, or any other native C++ data. More...

`#include <Serialization.h>`

## Public Member Functions

bool | isValid () const
| Check whether this is a valid unique identifier.
| operator bool () const
| Same as calling isValid().
bool | operator== (const UID &other) const
bool | operator!= (const UID &other) const
bool | operator< (const UID &other) const
bool | operator> (const UID &other) const

## Static Public Member Functions

template<typename T>
static UID | from (const T &obj)
| Create an unique indentifier for a native C++ object/member/variable.

## Public Attributes

ID | id
| Abstract non-unique ID of the object or member in question.
size_t | size
| Memory size of the object or member in question.

## Detailed Description

Unique identifier referring to one specific native C++ object, member, fundamental variable, or any other native C++ data.

Reflects a unique identifier for one specific serialized C++ data, i.e. C++ class instance, C/C++ struct instance, member, primitive pointer, fundamental variables, or any other native C/C++ data originally being serialized.

A unique identifier is composed of an id (an identifier which is not necessarily unique) and a size. Since the underlying ID is derived from the original C++ object's memory location, such an ID is not sufficient to distinguish a particular C++ object from the first member of that C++ object, since both typically share the same memory address. So additionally the memory size of the respective object or member is bundled with UID objects to make them unique and distinguishable.

Definition at line 349 of file Serialization.h.

## Member Function Documentation

## from()

template<typename T>

UID Serialization::UID::from | ( | const T & | obj | ) |

inline static

Create an unique indentifier for a native C++ object/member/variable.

Creates and returns an unique identifier for the passed native C++ object, object member or variable. For the same C++ object/member/variable this function will always return the same UID. For all other ones, this function is guaranteed to return a different UID.

Definition at line 370 of file Serialization.h.

Referenced by Serialization::Archive::deserialize(), Serialization::Archive::serialize(), Serialization::Archive::serializeHeapMember(), Serialization::Archive::serializeMember(), Serialization::Archive::setMinVersion(), and Serialization::Archive::setVersion().

## isValid()

bool Serialization::UID::isValid | ( |  | ) | const

Check whether this is a valid unique identifier.

Returns `false` if this UID can be considered an invalid unique identifier. This is for example the case if this UID object was not explicitly set to some certain meaningful unique identifier value, or if this UID object was intentionally assigned the constant `NO_UID` value. Both represent essentially an UID object which is all zero.

Note that this class also implements the `bool` operator, both return the same boolean result.

Definition at line 66 of file Serialization.cpp.

References size.

Referenced by operator bool().

## operator bool()

Serialization::UID::operator bool | ( |  | ) | const

inline

Same as calling isValid().

Definition at line 355 of file Serialization.h.

References isValid().

## operator!=()

bool Serialization::UID::operator!= | ( | const UID & | other | ) | const

inline

Definition at line 358 of file Serialization.h.

## operator<()

bool Serialization::UID::operator< | ( | const UID & | other | ) | const

inline

Definition at line 359 of file Serialization.h.

## operator==()

bool Serialization::UID::operator== | ( | const UID & | other | ) | const

inline

Definition at line 357 of file Serialization.h.

## operator>()

bool Serialization::UID::operator> | ( | const UID & | other | ) | const

inline

Definition at line 360 of file Serialization.h.

## Member Data Documentation

## id

ID Serialization::UID::id

Abstract non-unique ID of the object or member in question.

Definition at line 351 of file Serialization.h.

Referenced by Serialization::Archive::objectByBaseUID(), and Serialization::Object::setNativeValueFromString().

## size

size_t Serialization::UID::size

Memory size of the object or member in question.

Definition at line 352 of file Serialization.h.

Referenced by isValid(), and Serialization::Archive::objectByBaseUID().

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

- Serialization.h
- Serialization.cpp