29 #ifndef Pt_FixupInfo_h
30 #define Pt_FixupInfo_h
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;
106 template <
typename T>
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);
135 template <
typename T>
151 template <
typename T>
void fixup(const FixupInfo &fixup, T &fixme)
Fixup references during serialization.
Definition: FixupInfo.h:152
T * getTarget() const
Returns a pointer to the refernced type.
Definition: FixupInfo.h:81
Fixup of references during serialization.
Definition: FixupInfo.h:42
unsigned memberId() const
Returns the member ID.
Definition: FixupInfo.h:72
Error during serialization of a type.
Definition: SerializationError.h:45
const std::type_info & targetType() const
Returns the referenced type.
Definition: FixupInfo.h:68
~FixupInfo()
Destructor.
Definition: FixupInfo.h:60
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
void fixup(const FixupInfo &fixup, T *&fixme)
Fixup references during serialization.
Definition: FixupInfo.h:136
FixupInfo(void *target, const std::type_info &targetType, unsigned mid)
Construct from referenced type.
Definition: FixupInfo.h:53