---
name: "persist.h"
section: "3"
platform: "linux"
package: "libcommoncpp2-doc"
version: "1.8.1-10"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/persist.h"
---

# persist.h(3)

Persistence library classes.

## NAME

persist.h - Persistence library classes.

## SYNOPSIS

`#include <cc++/config.h>`\
 `#include <cc++/exception.h>`\
 `#include <cc++/missing.h>`\
 `#include <cc++/string.h>`\
 `#include <iostream>`\
 `#include <string>`\
 `#include <vector>`\
 `#include <deque>`\
 `#include <map>`\

### Classes

class **ost::TypeManager**\
 This class manages the types for generation of the persistent objects.  class **ost::TypeManager::Registration**\
 This manages a registration to the typemanager - attempting to remove problems with the optimisers.  class **ost::BaseObject**\
 **BaseObject**.  class **ost::Engine**\
 **Engine**.

### Namespaces

 **ost**\

### Macros

\#define **NO\_COMPRESSION**\
 \#define **NS\_PREFIX**   ost::\
 \#define **DECLARE\_PERSISTENCE**(ClassType)\
 \#define **IMPLEMENT\_PERSISTENCE**(ClassType,  FullyQualifiedName)\
 \#define **CCXX\_ENGINEWRITE\_REF**(valref)   writeBinary((const **uint8**\*)&valref,sizeof(valref))\
 \#define **CCXX\_ENGINEREAD\_REF**(valref)   readBinary((**uint8**\*)&valref,sizeof(valref))\

### Typedefs

typedef class BaseObject \*(\* **ost::NewBaseObjectFunction**) (void)\

## Detailed Description

Persistence library classes.

## Macro Definition Documentation

### #define CCXX\_ENGINEREAD\_REF(valref) readBinary((uint8\*)&valref,sizeof(valref))

### #define CCXX\_ENGINEWRITE\_REF(valref) writeBinary((const uint8\*)&valref,sizeof(valref))

### #define DECLARE\_PERSISTENCE(ClassType)

**Value:**

```
  public:                                   friend NS_PREFIX Engine& operator>>( NS_PREFIX Engine& ar, ClassType *&ob);         friend NS_PREFIX Engine& operator<<( NS_PREFIX Engine& ar, ClassType const &ob);        friend NS_PREFIX BaseObject *createNew##ClassType();                    virtual const char* getPersistenceID() const;               static NS_PREFIX TypeManager::Registration registrationFor##ClassType;
```

### #define IMPLEMENT\_PERSISTENCE(ClassType, FullyQualifiedName)

**Value:**

```
  NS_PREFIX BaseObject *createNew##ClassType() { return new ClassType; }                const char* ClassType::getPersistenceID() const {return FullyQualifiedName;}   NS_PREFIX Engine& operator>>(NS_PREFIX Engine& ar, ClassType &ob)                   { ar >> (NS_PREFIX BaseObject &) ob; return ar; }                       NS_PREFIX Engine& operator>>(NS_PREFIX Engine& ar, ClassType *&ob)                      { ar >> (NS_PREFIX BaseObject *&) ob; return ar; }                      NS_PREFIX Engine& operator<<(NS_PREFIX Engine& ar, ClassType const &ob)                     { ar << (NS_PREFIX BaseObject const *)&ob; return ar; }                 NS_PREFIX TypeManager::Registration                                 ClassType::registrationFor##ClassType(FullyQualifiedName,                                   createNew##ClassType);
```

### #define NO\_COMPRESSION

### #define NS\_PREFIX ost::

## Author

Generated automatically by Doxygen for GNU CommonC++ from the source code.
