SST/macro
serialize_serializable.h
Go to the documentation of this file.
1 #ifndef SERIALIZE_SERIALIZABLE_H
2 #define SERIALIZE_SERIALIZABLE_H
3 
5 #include <sprockit/serializer.h>
6 #include <sprockit/serialize.h>
7 #include <sprockit/ptr_type.h>
8 
9 namespace sprockit {
10 
11 template <class T>
12 void
14 {
15  serializable* s = t;
16  switch (ser.mode()){
19  break;
20 case serializer::PACK:
22  break;
25  t = dynamic_cast<T*>(s);
26  break;
27  }
28 }
29 
30 template <class T>
32  public:
34  T* tmp = o.get();
35  serialize_intrusive_ptr(tmp, ser);
36  o = tmp;
37  }
38 };
39 
40 template <class T>
41 class serialize<const sprockit::refcount_ptr<T> > {
42  public:
44  T* tmp = o.get();
45  serialize_intrusive_ptr(tmp, ser);
46  }
47 };
48 
49 
50 template <class T>
51 class serialize<sprockit::refcount_ptr<const T> > {
52  public:
54  T* tmp = const_cast<T*>(o.get());
55  serialize_intrusive_ptr(tmp, ser);
56  o = tmp;
57  }
58 };
59 
60 
61 }
62 
63 #endif // SERIALIZE_SERIALIZABLE_H
void operator()(sprockit::refcount_ptr< T > &o, serializer &ser)
void operator()(sprockit::refcount_ptr< const T > &o, serializer &ser)
void size_serializable(serializable *s, serializer &ser)
SERIALIZE_MODE mode() const
Definition: serializer.h:84
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition: serializer.h:33
void operator()(const sprockit::refcount_ptr< T > &o, serializer &ser)
void pack_serializable(serializable *s, serializer &ser)
void unpack_serializable(serializable *&s, serializer &ser)
void serialize_intrusive_ptr(T *&t, serializer &ser)