OCCT3D OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    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:

    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: occ::handle<ShapeSchema> s = new ShapeSchema;.
    void SetVersion (const TCollection_AsciiString &aVersion)
     returns version of the schema
    TCollection_AsciiString Version () const
     returns the version of the schema
    void SetName (const TCollection_AsciiString &aSchemaName)
     set the schema's name
    TCollection_AsciiString Name () const
     returns the schema's name
    void Write (const occ::handle< Storage_BaseDriver > &ss, const occ::handle< Storage_Data > &aData) const
     Writes the data aggregated in aData into the container defined by the driver . 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.
    void AddReadUnknownTypeCallBack (const TCollection_AsciiString &aTypeName, const occ::handle< Storage_CallBack > &aCallBack)
     add two functions to the callback list
    void RemoveReadUnknownTypeCallBack (const TCollection_AsciiString &aTypeName)
     remove a callback for a type
    occ::handle< NCollection_HSequence< TCollection_AsciiString > > InstalledCallBackList () const
     returns a list of type name with installed callback.
    void ClearCallBackList ()
     clear all callback from schema instance.
    void UseDefaultCallBack ()
     install a callback for all unknown type. the objects with unknown types will be skipped. (look SkipObject method in BaseDriver)
    void DontUseDefaultCallBack ()
     tells schema to uninstall the default callback.
    bool IsUsingDefaultCallBack () const
     ask if the schema is using the default callback.
    void SetDefaultCallBack (const occ::handle< Storage_CallBack > &ff)
     overload the default function for build. (use to set an error message or skip an object while reading an unknown type).
    void ResetDefaultCallBack ()
     reset the default function defined by Storage package.
    occ::handle< Storage_CallBackDefaultCallBack () const
     returns the read function used when the UseDefaultCallBack() is set.
    void WritePersistentObjectHeader (const occ::handle< Standard_Persistent > &sp, const occ::handle< Storage_BaseDriver > &theDriver)
    void WritePersistentReference (const occ::handle< Standard_Persistent > &sp, const occ::handle< Storage_BaseDriver > &theDriver)
    bool AddPersistent (const occ::handle< Standard_Persistent > &sp, const char *const tName) const
    bool PersistentToAdd (const occ::handle< Standard_Persistent > &sp) const
    Public Member Functions inherited from Standard_Transient
     Standard_Transient ()
     Empty constructor.
     Standard_Transient (const Standard_Transient &)
     Copy constructor – does nothing.
    Standard_Transientoperator= (const Standard_Transient &)
     Assignment operator, needed to avoid copying reference counter.
    virtual ~Standard_Transient ()=default
     Destructor must be virtual.
    virtual const opencascade::handle< Standard_Type > & DynamicType () const
     Returns a type descriptor about this object.
    bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
     Returns a true value if this is an instance of Type.
    bool IsInstance (const char *const theTypeName) const
     Returns a true value if this is an instance of TypeName.
    bool 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.
    bool IsKind (const char *const 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.
    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.
    int GetRefCount () const noexcept
     Get the reference counter of this object.
    void IncrementRefCounter () noexcept
     Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
    int DecrementRefCounter () noexcept
     Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
    virtual void Delete () const
     Memory deallocator for transient classes.

    Static Public Member Functions

    static TCollection_AsciiString ICreationDate ()
     return a current date string
    static bool 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 doesn't know how to handle this type.
    static constexpr const char * get_type_name ()
     Returns a type descriptor about this object.
    static const opencascade::handle< Standard_Type > & get_type_descriptor ()
     Returns type descriptor of Standard_Transient class.

    Protected Member Functions

    bool HasTypeBinding (const TCollection_AsciiString &aTypeName) const
    void BindType (const TCollection_AsciiString &aTypeName, const occ::handle< Storage_CallBack > &aCallBack) const
    occ::handle< Storage_CallBackTypeBinding (const TCollection_AsciiString &aTypeName) const

    Additional Inherited Members

    typedef void base_type
     Returns a type descriptor about this object.

    Detailed Description

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

    • writing of a set of persistent data into a container (store mechanism),
    • reading of a container to extract all the contained persistent data (retrieve mechanism). A Storage_Schema object is based on the data schema for the persistent data of the application, i.e.:
    • the list of all persistent objects which may be known by the application,
    • the organization of their data; a data schema knows how to browse each persistent object it contains. During the store or retrieve operation, only persistent objects known from the data schema can be processed; they are then stored or retrieved according to their description in the schema. A data schema is specific to the object classes to be read or written. Tools dedicated to the environment in use allow a description of the application persistent data structure. Storage_Schema algorithms are called basic because they do not support external references between containers.

    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: occ::handle<ShapeSchema> s = new ShapeSchema;.


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


    Member Function Documentation

    ◆ AddPersistent()

    bool Storage_Schema::AddPersistent ( const occ::handle< Standard_Persistent > & sp,
    const char *const tName ) const

    ◆ AddReadUnknownTypeCallBack()

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

    add two functions to the callback list

    ◆ BindType()

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

    ◆ CheckTypeMigration()

    bool 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 doesn't know how to handle this type.

    ◆ ClearCallBackList()

    void Storage_Schema::ClearCallBackList ( )

    clear all callback from schema instance.

    ◆ DefaultCallBack()

    occ::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()

    bool Storage_Schema::HasTypeBinding ( const TCollection_AsciiString & aTypeName) const
    inlineprotected

    ◆ ICreationDate()

    TCollection_AsciiString Storage_Schema::ICreationDate ( )
    static

    return a current date string

    ◆ InstalledCallBackList()

    occ::handle< NCollection_HSequence< TCollection_AsciiString > > Storage_Schema::InstalledCallBackList ( ) const

    returns a list of type name with installed callback.

    ◆ IsUsingDefaultCallBack()

    bool 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()

    bool Storage_Schema::PersistentToAdd ( const occ::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 occ::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()

    occ::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 ( const occ::handle< Storage_BaseDriver > & s,
    const occ::handle< Storage_Data > & aData ) const

    Writes the data aggregated in aData into the container defined by the driver . 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 occ::handle< Standard_Persistent > & sp,
    const occ::handle< Storage_BaseDriver > & theDriver )
    inline

    ◆ WritePersistentReference()

    void Storage_Schema::WritePersistentReference ( const occ::handle< Standard_Persistent > & sp,
    const occ::handle< Storage_BaseDriver > & theDriver )
    inline

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