18 #ifndef INCLUDE_SF_SERIALIZEPOLYMORPHIC_HPP 19 #define INCLUDE_SF_SERIALIZEPOLYMORPHIC_HPP 25 class I_SerializerPolymorphic
28 virtual ~I_SerializerPolymorphic() {}
29 virtual bool invoke(
void **ppvb, Archive &ar) = 0;
32 template<
typename Base,
typename Derived>
33 class SerializerPolymorphic :
public I_SerializerPolymorphic
37 SerializerPolymorphic()
40 virtual bool invoke(
void **ppvb, Archive &ar);
45 #include <SF/Archive.hpp> 50 template<
typename Base,
typename Derived>
51 bool SerializerPolymorphic<Base,Derived>::invoke(
void **ppvb, Archive &ar)
55 Base *pb =
reinterpret_cast<Base *
>(*ppvb);
56 Derived *pd =
static_cast<Derived *
>(pb);
61 if (ar.isFlagSet(Archive::POINTER))
65 Base *pb =
static_cast<Base *
>(pd);
70 Base *pb =
reinterpret_cast<Base *
>(*ppvb);
71 Derived *pd =
static_cast<Derived *
>(pb);
80 #endif // ! INCLUDE_SF_SERIALIZEPOLYMORPHIC_HPP
Definition: ByteBuffer.hpp:188