# ApplicationFramework
TKTObj
TObj

# TObj_Persistence Class Reference

`#include <TObj_Persistence.hxx>`

## Static Public Member Functions

static Standard_EXPORT | Handle (TObj_Object) CreateNewObject(const Standard_CString theType
| Creates and returns a new object of the registered type If the type is not registered, returns Null handle.
static Standard_EXPORT void | DumpTypes (Standard_OStream &theOs)
| Dumps names of all the types registered for persistence to the specified stream.

## Data Fields

static Standard_EXPORT const TDF_Label & | theLabel

## Protected Member Functions

Standard_EXPORT | TObj_Persistence (const Standard_CString theType)
| The constructor registers the object.
virtual Standard_EXPORT | ~TObj_Persistence ()
| The destructor unregisters the object.
virtual Standard_EXPORT | Handle (TObj_Object) New(const TDF_Label &theLabel) const =0
| The method must be redefined in the derived class and return new object of the proper type.

## Static Protected Member Functions

static Standard_EXPORT TObj_DataMapOfStringPointer & | getMapOfTypes ()
| Dictionary storing all the registered types. It is implemented as static variable inside member function in order to ensure initialization at first call.

## Private Attributes

Standard_CString | myType
| Name of managed type (recorded for unregistering).

## Detailed Description

This class is intended to be a root of tools (one per class) to manage persistence of objects inherited from TObj_Object It provides a mechanism to recover correctly typed objects (subtypes of TObj_Object) out of their persistent names

This is a special kind of object, it automatically registers itself in a global map when created, and the only thing it does is to create a new object of the type that it manages, by request

## Constructor & Destructor Documentation

Standard_EXPORT TObj_Persistence::TObj_Persistence | ( | const Standard_CString | theType | ) | `[protected]`

| Protected methods, to be used or defined by descendants

virtual Standard_EXPORT TObj_Persistence::~TObj_Persistence | ( |  | ) | `[protected, virtual]`

## Member Function Documentation

static Standard_EXPORT void TObj_Persistence::DumpTypes | ( | Standard_OStream & | theOs | ) | `[static]`

static Standard_EXPORT TObj_DataMapOfStringPointer& TObj_Persistence::getMapOfTypes | ( |  | ) | `[static, protected]`

virtual Standard_EXPORT TObj_Persistence::Handle | ( | TObj_Object |  | ) | const`[protected, pure virtual]`

static Standard_EXPORT TObj_Persistence::Handle | ( | TObj_Object |  | ) | const`[static]`

| Public methods, to be called externally

## Field Documentation

Standard_CString TObj_Persistence::myType `[private]`

Standard_EXPORT const TDF_Label& TObj_Persistence::theLabel

The documentation for this class was generated from the following file:

- TObj_Persistence.hxx