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_Data Class Reference

    A picture memorizing the data stored in a container (for example, in a file). A Storage_Data object represents either: More...

    #include <Storage_Data.hxx>

    Inheritance diagram for Storage_Data:

    Public Member Functions

     Storage_Data ()
     Creates an empty set of data. You explicitly create a Storage_Data object when preparing the set of objects to be stored together in a container (for example, in a file). Then use the function AddRoot to add persistent objects to the set of data. A Storage_Data object is also returned by the Read function of a Storage_Schema storage/retrieval algorithm. Use the functions NumberOfRoots and Roots to find the roots which were stored in the read container.
    Storage_Error ErrorStatus () const
     Returns Storage_VSOk if.
    void ClearErrorStatus ()
     Clears the error status positioned either by:
    TCollection_AsciiString ErrorStatusExtension () const
    TCollection_AsciiString CreationDate () const
     return the creation date
    TCollection_AsciiString StorageVersion () const
     return the Storage package version
    TCollection_AsciiString SchemaVersion () const
     get the version of the schema
    TCollection_AsciiString SchemaName () const
     get the schema's name
    void SetApplicationVersion (const TCollection_AsciiString &aVersion)
     set the version of the application
    TCollection_AsciiString ApplicationVersion () const
     get the version of the application
    void SetApplicationName (const TCollection_ExtendedString &aName)
     set the name of the application
    TCollection_ExtendedString ApplicationName () const
     get the name of the application
    void SetDataType (const TCollection_ExtendedString &aType)
     set the data type
    TCollection_ExtendedString DataType () const
     returns data type
    void AddToUserInfo (const TCollection_AsciiString &anInfo)
     add <theUserInfo> to the user information
    const NCollection_Sequence< TCollection_AsciiString > & UserInfo () const
     return the user information
    void AddToComments (const TCollection_ExtendedString &aComment)
     add <theUserInfo> to the user information
    const NCollection_Sequence< TCollection_ExtendedString > & Comments () const
     return the user information
    int NumberOfObjects () const
     the number of persistent objects Return: the number of persistent objects readed
    int NumberOfRoots () const
     Returns the number of root objects in this set of data.
    void AddRoot (const occ::handle< Standard_Persistent > &anObject) const
     add a persistent root to write. the name of the root is a driver reference number.
    void AddRoot (const TCollection_AsciiString &aName, const occ::handle< Standard_Persistent > &anObject) const
     Adds the root anObject to this set of data. The name of the root is aName if given; if not, it will be a reference number assigned by the driver when writing the set of data into the container. When naming the roots, it is easier to retrieve objects by significant references rather than by references without any semantic values.
    void RemoveRoot (const TCollection_AsciiString &aName)
     Removes from this set of data the root object named aName. Warning Nothing is done if there is no root object whose name is aName in this set of data.
    occ::handle< NCollection_HSequence< occ::handle< Storage_Root > > > Roots () const
     Returns the roots of this set of data in a sequence.
    occ::handle< Storage_RootFind (const TCollection_AsciiString &aName) const
     Gives the root object whose name is aName in this set of data. The returned object is a Storage_Root object, from which the object it encapsulates may be extracted. Warning A null handle is returned if there is no root object whose name is aName in this set of data.
    bool IsRoot (const TCollection_AsciiString &aName) const
     returns true if <me> contains a root named <aName>
    int NumberOfTypes () const
     Returns the number of types of objects used in this set of data.
    bool IsType (const TCollection_AsciiString &aName) const
     Returns true if this set of data contains an object of type aName. Persistent objects from this set of data must have types which are recognized by the Storage_Schema algorithm used to store or retrieve them.
    occ::handle< NCollection_HSequence< TCollection_AsciiString > > Types () const
     Gives the list of types of objects used in this set of data in a sequence.
    occ::handle< Storage_HeaderDataHeaderData () const
    occ::handle< Storage_RootDataRootData () const
    occ::handle< Storage_TypeDataTypeData () const
    occ::handle< Storage_InternalDataInternalData () const
    void Clear () 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.

    Additional Inherited Members

    typedef void base_type
     Returns a type descriptor about this object.
    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.

    Detailed Description

    A picture memorizing the data stored in a container (for example, in a file). A Storage_Data object represents either:

    • persistent data to be written into a container, or
    • persistent data which are read from a container. A Storage_Data object is used in both the storage and retrieval operations:
    • Storage mechanism: create an empty Storage_Data object, then add successively persistent objects (roots) to be stored using the function AddRoot. When the set of data is complete, write it to a container using the function Write in your Storage_Schema storage/retrieval algorithm.
    • Retrieval mechanism: a Storage_Data object is returned by the Read function from your Storage_Schema storage/retrieval algorithm. Use the functions NumberOfRoots and Roots to find the roots which were stored in the read container. The roots of a Storage_Data object may share references on objects. The shared internal references of a Storage_Data object are maintained by the storage/retrieval mechanism. Note: References shared by objects which are contained in two distinct Storage_Data objects are not maintained by the storage/retrieval mechanism: external references are not supported by Storage_Schema algorithm

    Constructor & Destructor Documentation

    ◆ Storage_Data()

    Storage_Data::Storage_Data ( )

    Creates an empty set of data. You explicitly create a Storage_Data object when preparing the set of objects to be stored together in a container (for example, in a file). Then use the function AddRoot to add persistent objects to the set of data. A Storage_Data object is also returned by the Read function of a Storage_Schema storage/retrieval algorithm. Use the functions NumberOfRoots and Roots to find the roots which were stored in the read container.

    Member Function Documentation

    ◆ AddRoot() [1/2]

    void Storage_Data::AddRoot ( const occ::handle< Standard_Persistent > & anObject) const

    add a persistent root to write. the name of the root is a driver reference number.

    ◆ AddRoot() [2/2]

    void Storage_Data::AddRoot ( const TCollection_AsciiString & aName,
    const occ::handle< Standard_Persistent > & anObject ) const

    Adds the root anObject to this set of data. The name of the root is aName if given; if not, it will be a reference number assigned by the driver when writing the set of data into the container. When naming the roots, it is easier to retrieve objects by significant references rather than by references without any semantic values.

    ◆ AddToComments()

    void Storage_Data::AddToComments ( const TCollection_ExtendedString & aComment)

    add <theUserInfo> to the user information

    ◆ AddToUserInfo()

    void Storage_Data::AddToUserInfo ( const TCollection_AsciiString & anInfo)

    add <theUserInfo> to the user information

    ◆ ApplicationName()

    TCollection_ExtendedString Storage_Data::ApplicationName ( ) const

    get the name of the application

    ◆ ApplicationVersion()

    TCollection_AsciiString Storage_Data::ApplicationVersion ( ) const

    get the version of the application

    ◆ Clear()

    void Storage_Data::Clear ( ) const

    ◆ ClearErrorStatus()

    void Storage_Data::ClearErrorStatus ( )

    Clears the error status positioned either by:

    • the last storage operation performed with the Read function, or
    • the last retrieval operation performed with the Write function by a Storage_Schema algorithm, on this set of data. This error status may be read by the function ErrorStatus.

    ◆ Comments()

    const NCollection_Sequence< TCollection_ExtendedString > & Storage_Data::Comments ( ) const

    return the user information

    ◆ CreationDate()

    TCollection_AsciiString Storage_Data::CreationDate ( ) const

    return the creation date

    ◆ DataType()

    TCollection_ExtendedString Storage_Data::DataType ( ) const

    returns data type

    ◆ ErrorStatus()

    Storage_Error Storage_Data::ErrorStatus ( ) const

    Returns Storage_VSOk if.

    • the last storage operation performed with the function Read, or
    • the last retrieval operation performed with the function Write by a Storage_Schema algorithm, on this set of data was successful. If the storage or retrieval operation was not performed, the returned error status indicates the reason why the operation failed. The algorithm stops its analysis at the first detected error

    ◆ ErrorStatusExtension()

    TCollection_AsciiString Storage_Data::ErrorStatusExtension ( ) const

    ◆ Find()

    occ::handle< Storage_Root > Storage_Data::Find ( const TCollection_AsciiString & aName) const

    Gives the root object whose name is aName in this set of data. The returned object is a Storage_Root object, from which the object it encapsulates may be extracted. Warning A null handle is returned if there is no root object whose name is aName in this set of data.

    ◆ HeaderData()

    occ::handle< Storage_HeaderData > Storage_Data::HeaderData ( ) const

    ◆ InternalData()

    occ::handle< Storage_InternalData > Storage_Data::InternalData ( ) const

    ◆ IsRoot()

    bool Storage_Data::IsRoot ( const TCollection_AsciiString & aName) const

    returns true if <me> contains a root named <aName>

    ◆ IsType()

    bool Storage_Data::IsType ( const TCollection_AsciiString & aName) const

    Returns true if this set of data contains an object of type aName. Persistent objects from this set of data must have types which are recognized by the Storage_Schema algorithm used to store or retrieve them.

    ◆ NumberOfObjects()

    int Storage_Data::NumberOfObjects ( ) const

    the number of persistent objects Return: the number of persistent objects readed

    ◆ NumberOfRoots()

    int Storage_Data::NumberOfRoots ( ) const

    Returns the number of root objects in this set of data.

    • When preparing a storage operation, the result is the number of roots inserted into this set of data with the function AddRoot.
    • When retrieving an object, the result is the number of roots stored in the read container. Use the Roots function to get these roots in a sequence.

    ◆ NumberOfTypes()

    int Storage_Data::NumberOfTypes ( ) const

    Returns the number of types of objects used in this set of data.

    ◆ RemoveRoot()

    void Storage_Data::RemoveRoot ( const TCollection_AsciiString & aName)

    Removes from this set of data the root object named aName. Warning Nothing is done if there is no root object whose name is aName in this set of data.

    ◆ RootData()

    occ::handle< Storage_RootData > Storage_Data::RootData ( ) const

    ◆ Roots()

    occ::handle< NCollection_HSequence< occ::handle< Storage_Root > > > Storage_Data::Roots ( ) const

    Returns the roots of this set of data in a sequence.

    • When preparing a storage operation, the sequence contains the roots inserted into this set of data with the function AddRoot.
    • When retrieving an object, the sequence contains the roots stored in the container read.
    • An empty sequence is returned if there is no root in this set of data.

    ◆ SchemaName()

    TCollection_AsciiString Storage_Data::SchemaName ( ) const

    get the schema's name

    ◆ SchemaVersion()

    TCollection_AsciiString Storage_Data::SchemaVersion ( ) const

    get the version of the schema

    ◆ SetApplicationName()

    void Storage_Data::SetApplicationName ( const TCollection_ExtendedString & aName)

    set the name of the application

    ◆ SetApplicationVersion()

    void Storage_Data::SetApplicationVersion ( const TCollection_AsciiString & aVersion)

    set the version of the application

    ◆ SetDataType()

    void Storage_Data::SetDataType ( const TCollection_ExtendedString & aType)

    set the data type

    ◆ StorageVersion()

    TCollection_AsciiString Storage_Data::StorageVersion ( ) const

    return the Storage package version

    ◆ TypeData()

    occ::handle< Storage_TypeData > Storage_Data::TypeData ( ) const

    ◆ Types()

    occ::handle< NCollection_HSequence< TCollection_AsciiString > > Storage_Data::Types ( ) const

    Gives the list of types of objects used in this set of data in a sequence.

    ◆ UserInfo()

    const NCollection_Sequence< TCollection_AsciiString > & Storage_Data::UserInfo ( ) const

    return the user information


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