Open CASCADE Technology  7.3.0
Public Member Functions | Static Public Member Functions | Protected Member Functions
Storage_Schema Class Reference

Root class for basic storage/retrieval algorithms. A Storage_Schema object processes: More...

#include <Storage_Schema.hxx>

Inheritance diagram for Storage_Schema:
Inheritance graph
[legend]

Public Member Functions

 Storage_Schema ()
 Builds a storage/retrieval algorithm based on a given data schema. Example For example, if ShapeSchema is the class inheriting from Storage_Schema and containing the description of your application data schema, you create a storage/retrieval algorithm as follows: Handle(ShapeSchema) s = new ShapeSchema;


USER API – -----------------------------------------------------------—


More...
 
void SetVersion (const TCollection_AsciiString &aVersion)
 returns version of the schema More...
 
TCollection_AsciiString Version () const
 returns the version of the schema More...
 
void SetName (const TCollection_AsciiString &aSchemaName)
 set the schema's name More...
 
TCollection_AsciiString Name () const
 returns the schema's name More...
 
void Write (Storage_BaseDriver &s, const Handle< Storage_Data > &aData) const
 Writes the data aggregated in aData into the container defined by the driver s. The storage operation is performed according to the data schema with which this algorithm is working. Note: aData may aggregate several root objects to be stored together. More...
 
void AddReadUnknownTypeCallBack (const TCollection_AsciiString &aTypeName, const Handle< Storage_CallBack > &aCallBack)
 add two functions to the callback list More...
 
void RemoveReadUnknownTypeCallBack (const TCollection_AsciiString &aTypeName)
 remove a callback for a type More...
 
Handle< TColStd_HSequenceOfAsciiString > InstalledCallBackList () const
 returns a list of type name with installed callback. More...
 
void ClearCallBackList ()
 clear all callback from schema instance. More...
 
void UseDefaultCallBack ()
 install a callback for all unknown type. the objects with unknown types will be skipped. (look SkipObject method in BaseDriver) More...
 
void DontUseDefaultCallBack ()
 tells schema to uninstall the default callback. More...
 
Standard_Boolean IsUsingDefaultCallBack () const
 ask if the schema is using the default callback. More...
 
void SetDefaultCallBack (const Handle< Storage_CallBack > &f)
 overload the default function for build.(use to set an error message or skip an object while reading an unknown type). More...
 
void ResetDefaultCallBack ()
 reset the default function defined by Storage package. More...
 
Handle< Storage_CallBackDefaultCallBack () const
 returns the read function used when the UseDefaultCallBack() is set. More...
 
void WritePersistentObjectHeader (const Handle< Standard_Persistent > &sp, Storage_BaseDriver &s)
 
void WritePersistentReference (const Handle< Standard_Persistent > &sp, Storage_BaseDriver &s)
 
Standard_Boolean AddPersistent (const Handle< Standard_Persistent > &sp, const Standard_CString tName) const
 
Standard_Boolean PersistentToAdd (const Handle< Standard_Persistent > &sp) const
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object. More...
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const opencascade::handle< Standard_Type > &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 
void IncrementRefCounter () const
 Increments the reference counter of this object. More...
 
Standard_Integer DecrementRefCounter () const
 Decrements the reference counter of this object; returns the decremented value. More...
 

Static Public Member Functions

static TCollection_AsciiString ICreationDate ()
 return a current date string More...
 
static Standard_Boolean CheckTypeMigration (const TCollection_AsciiString &theTypeName, TCollection_AsciiString &theNewName)
 returns True if theType migration is identified the callback support provides a way to read a file with a incomplete schema. ex. : A file contains 3 types a,b and c. The application's schema contains only 2 type a and b. If you try to read the file in the application, you will have an error.To bypass this problem you can give to your application's schema a callback used when the schema dosent know how to handle this type. More...
 
- Static Public Member Functions inherited from Standard_Transient
static const char * get_type_name ()
 Returns a type descriptor about this object. More...
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class. More...
 

Protected Member Functions

Standard_Boolean HasTypeBinding (const TCollection_AsciiString &aTypeName) const
 
void BindType (const TCollection_AsciiString &aTypeName, const Handle< Storage_CallBack > &aCallBack) const
 
Handle< Storage_CallBackTypeBinding (const TCollection_AsciiString &aTypeName) const
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object. More...
 

Detailed Description

Root class for basic storage/retrieval algorithms. A Storage_Schema object processes:

Constructor & Destructor Documentation

◆ Storage_Schema()

Storage_Schema::Storage_Schema ( )

Builds a storage/retrieval algorithm based on a given data schema. Example For example, if ShapeSchema is the class inheriting from Storage_Schema and containing the description of your application data schema, you create a storage/retrieval algorithm as follows: Handle(ShapeSchema) s = new ShapeSchema;


USER API – -----------------------------------------------------------—


Member Function Documentation

◆ AddPersistent()

Standard_Boolean Storage_Schema::AddPersistent ( const Handle< Standard_Persistent > &  sp,
const Standard_CString  tName 
) const

◆ AddReadUnknownTypeCallBack()

void Storage_Schema::AddReadUnknownTypeCallBack ( const TCollection_AsciiString aTypeName,
const Handle< Storage_CallBack > &  aCallBack 
)

add two functions to the callback list

◆ BindType()

void Storage_Schema::BindType ( const TCollection_AsciiString aTypeName,
const Handle< Storage_CallBack > &  aCallBack 
) const
protected

◆ CheckTypeMigration()

static Standard_Boolean Storage_Schema::CheckTypeMigration ( const TCollection_AsciiString theTypeName,
TCollection_AsciiString theNewName 
)
static

returns True if theType migration is identified the callback support provides a way to read a file with a incomplete schema. ex. : A file contains 3 types a,b and c. The application's schema contains only 2 type a and b. If you try to read the file in the application, you will have an error.To bypass this problem you can give to your application's schema a callback used when the schema dosent know how to handle this type.

◆ ClearCallBackList()

void Storage_Schema::ClearCallBackList ( )

clear all callback from schema instance.

◆ DefaultCallBack()

Handle< Storage_CallBack > Storage_Schema::DefaultCallBack ( ) const

returns the read function used when the UseDefaultCallBack() is set.

◆ DontUseDefaultCallBack()

void Storage_Schema::DontUseDefaultCallBack ( )

tells schema to uninstall the default callback.

◆ HasTypeBinding()

Standard_Boolean Storage_Schema::HasTypeBinding ( const TCollection_AsciiString aTypeName) const
protected

◆ ICreationDate()

static TCollection_AsciiString Storage_Schema::ICreationDate ( )
static

return a current date string

◆ InstalledCallBackList()

Handle< TColStd_HSequenceOfAsciiString > Storage_Schema::InstalledCallBackList ( ) const

returns a list of type name with installed callback.

◆ IsUsingDefaultCallBack()

Standard_Boolean Storage_Schema::IsUsingDefaultCallBack ( ) const

ask if the schema is using the default callback.

◆ Name()

TCollection_AsciiString Storage_Schema::Name ( ) const

returns the schema's name

◆ PersistentToAdd()

Standard_Boolean Storage_Schema::PersistentToAdd ( const Handle< Standard_Persistent > &  sp) const

◆ RemoveReadUnknownTypeCallBack()

void Storage_Schema::RemoveReadUnknownTypeCallBack ( const TCollection_AsciiString aTypeName)

remove a callback for a type

◆ ResetDefaultCallBack()

void Storage_Schema::ResetDefaultCallBack ( )

reset the default function defined by Storage package.

◆ SetDefaultCallBack()

void Storage_Schema::SetDefaultCallBack ( const Handle< Storage_CallBack > &  f)

overload the default function for build.(use to set an error message or skip an object while reading an unknown type).

◆ SetName()

void Storage_Schema::SetName ( const TCollection_AsciiString aSchemaName)

set the schema's name

◆ SetVersion()

void Storage_Schema::SetVersion ( const TCollection_AsciiString aVersion)

returns version of the schema

◆ TypeBinding()

Handle< Storage_CallBack > Storage_Schema::TypeBinding ( const TCollection_AsciiString aTypeName) const
protected

◆ UseDefaultCallBack()

void Storage_Schema::UseDefaultCallBack ( )

install a callback for all unknown type. the objects with unknown types will be skipped. (look SkipObject method in BaseDriver)

◆ Version()

TCollection_AsciiString Storage_Schema::Version ( ) const

returns the version of the schema

◆ Write()

void Storage_Schema::Write ( Storage_BaseDriver s,
const Handle< Storage_Data > &  aData 
) const

Writes the data aggregated in aData into the container defined by the driver s. The storage operation is performed according to the data schema with which this algorithm is working. Note: aData may aggregate several root objects to be stored together.

◆ WritePersistentObjectHeader()

void Storage_Schema::WritePersistentObjectHeader ( const Handle< Standard_Persistent > &  sp,
Storage_BaseDriver s 
)

◆ WritePersistentReference()

void Storage_Schema::WritePersistentReference ( const Handle< Standard_Persistent > &  sp,
Storage_BaseDriver s 
)

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