All Classes Namespaces Functions Variables Typedefs Enumerator Friends
chunk< T, Allocator > Class Template Reference

Serialization of arrays with and without automatic memory handling. More...

List of all members.

Detailed Description

template<class T, class Allocator = std::allocator< T >>
class CnC::chunk< T, Allocator >

Serialization of arrays with and without automatic memory handling.

Specified (to serializer::operator&) via

where your_ptr is a pointer variable to your array of <type>s.

If the allocator is the special type CnC::no_alloc, the runtime assumes that the programer appropriately allocates (if ser.is_unpacking()) and deallocates (if ser:is_cleaning_up()) the array. This implies that the using serialize method/function needs to make sure it passes valid and correct pointers to chunk.

If not CnC::no_alloc , the Allocator class must meet "allocator" requirements of ISO C++ Standard, Section 20.1.5

When unpacking, your_ptr must be NULL, and it is allocated automatically using the given allocator and when cleaning up, your_ptr is deallocated accordingly.

If using an allocator (in particular hre default std::allocator) object/array allocation and deallocation is greatly simplified for the programmer. There is no need to allocate and/or deallocate objects/arrays manually.

Definition at line 283 of file serializer.h.

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerator Friends