CnC
Modules | Classes | Macros | Functions
Serialization

Modules

 Serialization of simple structs/classes without pointers or virtual functions.
 
 Non bitwise serializable objects
 
 Marshalling pointer types (e.g. items which are pointers)
 
 Automatic serialization of built-in types.
 

Classes

class  explicitly_serializable
 Specifies serialization category: explicit serialization via a "serialize" function. More...
 
class  bitwise_serializable
 simple structs/classes are bitwise serializable. More...
 
class  chunk< T, Allocator >
 Serialization of arrays with and without automatic memory handling. More...
 
class  serializer
 Handles serilialization of data-objects. More...
 

Macros

#define CNC_BITWISE_SERIALIZABLE(T)
 
#define CNC_POINTER_SERIALIZABLE(T)
 

Functions

template<class T >
explicitly_serializable serializer_category (const T *)
 

Detailed Description

There are three possible ways of setting up the serialization of your struct resp. class:

Macro Definition Documentation

◆ CNC_BITWISE_SERIALIZABLE

#define CNC_BITWISE_SERIALIZABLE (   T)
Value:
static inline CnC::bitwise_serializable serializer_category( const T * ) { \
}
explicitly_serializable serializer_category(const T *)
Definition: serializer.h:225
simple structs/classes are bitwise serializable.
Definition: serializer.h:233

Convenience macro for defining that a type should be treated as bitwise serializable:

Definition at line 238 of file serializer.h.

◆ CNC_POINTER_SERIALIZABLE

#define CNC_POINTER_SERIALIZABLE (   T)
Value:
namespace CnC { \
static inline void serialize( serializer & ser, T *& t ) { \
ser & chunk< T >(t, 1); \
} \
}
CnC API.
Definition: cnc.h:49

Convenience macro for declaring serializable pointers. The object being pointed to should be serializable.

Definition at line 302 of file serializer.h.

Function Documentation

◆ serializer_category()

explicitly_serializable CnC::serializer_category ( const T *  )
inline

General case: a type belongs to the category explicitly_serializable, unless there is a specialization of the function template "serializer_category" (see below).

Definition at line 225 of file serializer.h.

226  {
227  return explicitly_serializable();
228  }