---
name: "persist.h"
section: "3cc"
platform: "linux"
package: "libcommoncpp2-dev"
version: "1.0.13-5"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/persist.h/3cc"
---

# persist.h(3cc)

Persistence library classes.

## NAME

persist.h - Persistence library classes.

## SYNOPSIS

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

### Compounds

class **BaseObject**\
 *BaseObject Base class for classes that will be persistent.* class **Engine**\
 *Engine stream serialization of persistent classes.* class **Exception**\
 *If problems happen which are fatal - expect one of these thrown at you.* class **PersistException**\
 class **Registration**\
 *This manages a registration to the typemanager - attempting to remove problems with the optimisers.* class **TypeManager**\
 *This class manages the types for generation of the persistent objects. Type manager for persistence engine.*

### Defines

\#define **NO\_COMPRESSION**\
 \#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 **BaseObject** \*(\* **NewBaseObjectFunction** )(void)\

### Functions

**BaseObject** &ob **THROWS** (**Engine::Exception**)\

## DETAILED DESCRIPTION

Persistence library classes.

## DEFINE 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 Engine& operator>>(Engine& ar, ClassType *&ob);                  friend Engine& operator<<(Engine& ar, ClassType const &ob);     friend BaseObject *createNew##ClassType();                              virtual const char* getPersistenceID() const;                           static TypeManager::Registration registrationFor##ClassType;
```

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

**Value:**

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

### #define NO\_COMPRESSION

## TYPEDEF DOCUMENTATION

### typedef class BaseObject\*(\* NewBaseObjectFunction)(void)

## FUNCTION DOCUMENTATION

### bool ob THROWS (Engine::Exception)

## AUTHOR

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