33#include <Pt/SerializationError.h>
46 typedef void (*FixupHandler)(
void* fixme,
77 {
return _target == 0; }
83 if( _target == 0 ||
typeid(T) != *_type )
88 return static_cast<T*
>( _target );
101 const std::type_info* _type;
109 static void fixupPointer(
void* fixme,
111 const std::type_info& targetType,
114 T** from =
static_cast<T**
>(fixme);
115 FixupInfo fi(target, targetType, mid);
119 static void fixupReference(
void* fixme,
121 const std::type_info& targetType,
124 T* from =
static_cast<T*
>(fixme);
125 FixupInfo fi(target, targetType, mid);
140 if( !
fixup.isNull() )
142 fixme =
fixup.getTarget<T>();
154 T* to =
fixup.getTarget<T>();
Fixup of references during serialization.
Definition FixupInfo.h:43
FixupInfo(void *target, const std::type_info &targetType, unsigned mid)
Construct from referenced type.
Definition FixupInfo.h:53
const std::type_info & targetType() const
Returns the referenced type.
Definition FixupInfo.h:68
~FixupInfo()
Destructor.
Definition FixupInfo.h:60
T * getTarget() const
Returns a pointer to the refernced type.
Definition FixupInfo.h:81
void * target() const
Returns a pointer to the refernced type.
Definition FixupInfo.h:64
bool isNull() const
Returns true if null.
Definition FixupInfo.h:76
unsigned memberId() const
Returns the member ID.
Definition FixupInfo.h:72
SerializationError(const std::string &msg)
Construct with message.
void fixup(const FixupInfo &fixup, T &fixme)
Fixup references during serialization.
Definition FixupInfo.h:152
void fixup(const FixupInfo &fixup, T *&fixme)
Fixup references during serialization.
Definition FixupInfo.h:136
Core module.
Definition Allocator.h:33