MIRA
Public Member Functions | Public Attributes | List of all members
Serializer< Derived >::AObject Struct Reference

Is used to store the type and the address of all previously serialized objects in a map. More...

#include <serialization/Serializer.h>

Public Member Functions

 AObject (void *iAddress, int iType)
 
bool operator< (const AObject &rhs) const
 
AObjectoperator= (const AObject &rhs)
 

Public Attributes

void * address
 
int type
 
int objectID
 

Detailed Description

template<typename Derived>
struct mira::Serializer< Derived >::AObject

Is used to store the type and the address of all previously serialized objects in a map.

The type is an id that is obtained by the typeId(). typeId() gives a unique id that is unique for a single run of the program. It may change between different starts of the application and is only used to check for the same types here. And to resolve the following case

class Class1
{
void reflect(...)
{
member("member", i);
}
int i
}
class Class2 {
Class1 c;
void reflect(...)
{
member("object1", c);
}
}

When serialized, Class2::c has the same address as Class1::i. If we would use the address only, we cannot distinguish between both, therefore we use the typeId which will be different, since Class2::c is of type Class1 and Class1:i is of type int.

Constructor & Destructor Documentation

◆ AObject()

AObject ( void *  iAddress,
int  iType 
)
inline

Member Function Documentation

◆ operator<()

bool operator< ( const AObject rhs) const
inline

◆ operator=()

AObject& operator= ( const AObject rhs)
inline

Member Data Documentation

◆ address

void* address

◆ type

int type

◆ objectID

int objectID

The documentation for this struct was generated from the following file: