Open CASCADE Technology 7.8.0
Static Public Member Functions | Protected Member Functions | Static Protected Member Functions
TObj_Persistence Class Referenceabstract

#include <TObj_Persistence.hxx>

Static Public Member Functions

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

Protected Member Functions

 TObj_Persistence (const Standard_CString theType)
 The constructor registers the object.
 
virtual ~TObj_Persistence ()
 The destructor unregisters the object.
 
virtual Handle< TObj_ObjectNew (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 TObj_DataMapOfStringPointergetMapOfTypes ()
 Dictionary storing all the registered types. It is implemented as static variable inside member function in order to ensure initialization at first call.
 

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

◆ TObj_Persistence()

TObj_Persistence::TObj_Persistence ( const Standard_CString  theType)
protected

The constructor registers the object.

Protected methods, to be used or defined by descendants

◆ ~TObj_Persistence()

virtual TObj_Persistence::~TObj_Persistence ( )
protectedvirtual

The destructor unregisters the object.

Member Function Documentation

◆ CreateNewObject()

static Handle< TObj_Object > TObj_Persistence::CreateNewObject ( const Standard_CString  theType,
const TDF_Label theLabel 
)
static

Creates and returns a new object of the registered type If the type is not registered, returns Null handle.

Public methods, to be called externally

◆ DumpTypes()

static void TObj_Persistence::DumpTypes ( Standard_OStream theOs)
static

Dumps names of all the types registered for persistence to the specified stream.

◆ getMapOfTypes()

static TObj_DataMapOfStringPointer & TObj_Persistence::getMapOfTypes ( )
staticprotected

Dictionary storing all the registered types. It is implemented as static variable inside member function in order to ensure initialization at first call.

◆ New()

virtual Handle< TObj_Object > TObj_Persistence::New ( const TDF_Label theLabel) const
protectedpure virtual

The method must be redefined in the derived class and return new object of the proper type.


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