34 #ifndef _NetworkSerialise_H__ 35 #define _NetworkSerialise_H__ 51 return sizeof(uint32_t);
65 *(uint32_t*)(mem) =
static_cast<uint32_t
>(variable->getObjectID());
75 return *(uint32_t*)(mem) == variable->getObjectID();
77 return variable == variable->getSynchronisable(*(uint32_t*)(mem));
85 return sizeof(uint32_t);
92 *
const_cast<typename
Loki::TypeTraits<StrongPtr<T>>::UnqualifiedType*>(&variable) = orxonox_cast<T*>(T::getSynchronisable(*(uint32_t*)(mem)));
100 *(uint32_t*)(mem) = static_cast<uint32_t>(variable->getObjectID());
109 if ( variable.
get() )
110 return *(uint32_t*)(mem) == variable->getObjectID();
120 return sizeof(uint32_t);
127 *
const_cast<typename
Loki::TypeTraits<WeakPtr<T>>::UnqualifiedType*>(&variable) = orxonox_cast<T*>(T::getSynchronisable(*(uint32_t*)(mem)));
134 if ( variable.
get() )
135 *(uint32_t*)(mem) = static_cast<uint32_t>(variable->getObjectID());
144 if ( variable.
get() )
145 return *(uint32_t*)(mem) == variable->getObjectID();
Shared library macros, enums, constants and forward declarations for the network library ...
Functions to serialise most of the types/classed used in Orxonox.
Shared library macros, enums, constants and forward declarations for the core library ...
bool checkEquality(T *&variable, uint8_t *mem)
checks whether the objectID of the variable is the same as in the bytestream
Definition: Serialise.h:72
uint32_t returnSize(T *&variable)
returns the size of the objectID needed to synchronise the pointer
Definition: Serialise.h:49
A strong pointer which wraps a pointer to an object and keeps this object alive as long as the strong...
Definition: CorePrereqs.h:227
WeakPtr wraps a pointer to an object, which becomes nullptr if the object is deleted.
Definition: CorePrereqs.h:236
T * get() const
Returns the wrapped pointer as T*.
Definition: WeakPtr.h:154
T * get() const
Returns the wrapped pointer as T*.
Definition: StrongPtr.h:219
UnVolatile< typename UnConst< T >::Result >::Result UnqualifiedType
Definition: TypeTraits.h:256
Definition: TypeTraits.h:165
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
void saveAndIncrease(T *&variable, uint8_t *&mem)
saves the objectID of a pointer into the bytestream and increases the mem pointer ...
Definition: Serialise.h:62
Definition: InputPrereqs.h:78
static constexpr uint32_t OBJECTID_UNKNOWN
Definition: CorePrereqs.h:71
void loadAndIncrease(T *&variable, uint8_t *&mem)
reads the objectID of a pointer out of the bytestream and increases the mem pointer ...
Definition: Serialise.h:55