ucommon
Data Structures | Namespaces | Defines | Typedefs
ucommon/persist.h File Reference

The GNU Common C++ persistance engine by Daniel Silverstone. More...

#include <ucommon/platform.h>
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <map>
Include dependency graph for persist.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  ucommon::PersistEngine
 Stream serialization of persistent classes. More...
class  ucommon::PersistObject
 PersistObject. More...
class  ucommon::TypeManager
 Type manager for persistence engine. More...
class  ucommon::TypeManager::registration
 This manages a registration to the typemanager - attempting to remove problems with the optimizers. More...

Namespaces

namespace  ucommon
 

Common namespace for all ucommon objects.


Defines

#define CCXX_ENGINEREAD_REF(valref)   readBinary((uint8_t*)&valref,sizeof(valref))
#define CCXX_ENGINEWRITE_REF(valref)   writeBinary((const uint8_t*)&valref,sizeof(valref))
#define CCXX_RE(ar, ob)   ar.read(ob); return ar
#define CCXX_WE(ar, ob)   ar.write(ob); return ar
#define DECLARE_PERSISTENCE(ClassType)
#define IMPLEMENT_PERSISTENCE(ClassType, FullyQualifiedName)

Typedefs

typedef class PersistObject *(* ucommon::NewPersistObjectFunction )(void)

Detailed Description

The GNU Common C++ persistance engine by Daniel Silverstone.

Definition in file persist.h.


Define Documentation

#define DECLARE_PERSISTENCE (   ClassType)
Value:
public:                               \
    friend ucommon::PersistEngine& operator>>( ucommon::PersistEngine& ar, ClassType *&ob);     \
    friend ucommon::PersistEngine& operator<<( ucommon::PersistEngine& ar, ClassType const &ob);    \
    friend ucommon::PersistObject *createNew##ClassType();                \
    virtual const char* getPersistenceID() const;           \
    static ucommon::TypeManager::Registration registrationFor##ClassType;

Definition at line 104 of file persist.h.

#define IMPLEMENT_PERSISTENCE (   ClassType,
  FullyQualifiedName 
)
Value:
ucommon::PersistObject *createNew##ClassType() { return new ClassType; }              \
  const char* ClassType::getPersistenceID() const {return FullyQualifiedName;} \
  ucommon::PersistEngine& operator>>(ucommon::PersistEngine& ar, ClassType &ob)               \
    { ar >> (ucommon::PersistObject &) ob; return ar; }                     \
  ucommon::PersistEngine& operator>>(ucommon::PersistEngine& ar, ClassType *&ob)                  \
    { ar >> (ucommon::PersistObject *&) ob; return ar; }                    \
  ucommon::PersistEngine& operator<<(ucommon::PersistEngine& ar, ClassType const &ob)                 \
    { ar << (ucommon::PersistObject const *)&ob; return ar; }               \
  ucommon::TypeManager::Registration                             \
    ClassType::registrationFor##ClassType(FullyQualifiedName,         \
                          createNew##ClassType);

Definition at line 112 of file persist.h.