19 #ifndef INCLUDE_SF_SERIALIZEPOLYMORPHIC_HPP 20 #define INCLUDE_SF_SERIALIZEPOLYMORPHIC_HPP 26 class I_SerializerPolymorphic
29 virtual ~I_SerializerPolymorphic() {}
30 virtual bool invoke(
void **ppvb, Archive &ar) = 0;
33 template<
typename Base,
typename Derived>
34 class SerializerPolymorphic :
public I_SerializerPolymorphic
38 SerializerPolymorphic()
41 virtual bool invoke(
void **ppvb, Archive &ar);
46 #include <SF/Archive.hpp> 51 template<
typename Base,
typename Derived>
52 bool SerializerPolymorphic<Base,Derived>::invoke(
void **ppvb, Archive &ar)
56 Base *pb =
reinterpret_cast<Base *
>(*ppvb);
57 Derived *pd =
static_cast<Derived *
>(pb);
62 if (ar.isFlagSet(Archive::POINTER))
66 Base *pb =
static_cast<Base *
>(pd);
71 Base *pb =
reinterpret_cast<Base *
>(*ppvb);
72 Derived *pd =
static_cast<Derived *
>(pb);
81 #endif // ! INCLUDE_SF_SERIALIZEPOLYMORPHIC_HPP
Definition: ByteBuffer.hpp:189