# FoundationClasses
TKernel
Storage

# Storage_Data Class Reference

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
.

`#include <Storage_Data.hxx>`

Inheritance diagram for Storage_Data:

[legend]

## Public Member Functions

Standard_EXPORT | 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.
.

Standard_EXPORT Storage_Error | 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
.

Standard_EXPORT void | 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. .
Standard_EXPORT TCollection_AsciiString | ErrorStatusExtension () const
Standard_EXPORT TCollection_AsciiString | CreationDate () const
| return the creation date
Standard_EXPORT TCollection_AsciiString | StorageVersion () const
| return the Storage package version
Standard_EXPORT TCollection_AsciiString | SchemaVersion () const
| get the version of the schema
Standard_EXPORT TCollection_AsciiString | SchemaName () const
| get the schema's name
Standard_EXPORT void | SetApplicationVersion (const TCollection_AsciiString &aVersion)
| set the version of the application
Standard_EXPORT TCollection_AsciiString | ApplicationVersion () const
| get the version of the application
Standard_EXPORT void | SetApplicationName (const TCollection_ExtendedString &aName)
| set the name of the application
Standard_EXPORT TCollection_ExtendedString | ApplicationName () const
| get the name of the application
Standard_EXPORT void | SetDataType (const TCollection_ExtendedString &aType)
| set the data type
Standard_EXPORT TCollection_ExtendedString | DataType () const
| returns data type
Standard_EXPORT void | AddToUserInfo (const TCollection_AsciiString &anInfo)
| add <theuserinfo> to the user informations
Standard_EXPORT const TColStd_SequenceOfAsciiString & | UserInfo () const
| return the user informations
Standard_EXPORT void | AddToComments (const TCollection_ExtendedString &aComment)
| add <theuserinfo> to the user informations
Standard_EXPORT const TColStd_SequenceOfExtendedString & | Comments () const
| return the user informations
Standard_EXPORT Standard_Integer | NumberOfObjects () const
| the the number of persistent objects Return: the number of persistent objects readed
Standard_EXPORT Standard_Integer | 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. .
Standard_EXPORT void | AddRoot (const Handle(Standard_Persistent)&anObject) const
| add a persistent root to write. the name of the root is a driver reference number.
Standard_EXPORT void | AddRoot (const TCollection_AsciiString &aName, const 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. .
Standard_EXPORT 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. .
Standard_EXPORT Handle_Storage_HSeqOfRoot | 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. .
Standard_EXPORT Handle_Storage_Root | 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. .
Standard_EXPORT Standard_Boolean | IsRoot (const TCollection_AsciiString &aName) const
| returns Standard_True if <me> contains a root named <aname>
Standard_EXPORT Standard_Integer | NumberOfTypes () const
| Returns the number of types of objects used in this set of data. .
Standard_EXPORT Standard_Boolean | 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. .
Standard_EXPORT Handle_TColStd_HSequenceOfAsciiString | Types () const
| Gives the list of types of objects used in this set of data in a sequence. .
Standard_EXPORT const | Handle (Standard_Type)&DynamicType() const

## Private Member Functions

Standard_EXPORT Handle_Storage_HeaderData | HeaderData () const
Standard_EXPORT Handle_Storage_RootData | RootData () const
Standard_EXPORT Handle_Storage_TypeData | TypeData () const
Standard_EXPORT Handle_Storage_InternalData | InternalData () const
Standard_EXPORT void | Clear () const
Standard_EXPORT void | SetErrorStatus (const Storage_Error anError)
Standard_EXPORT void | SetErrorStatusExtension (const TCollection_AsciiString &anErrorExt)

## Private Attributes

Handle_Storage_HeaderData | myHeaderData
Handle_Storage_RootData | myRootData
Handle_Storage_TypeData | myTypeData
Handle_Storage_InternalData | myInternal
Storage_Error | myErrorStatus
TCollection_AsciiString | myErrorStatusExt

## Constructor & Destructor Documentation

Standard_EXPORT Storage_Data::Storage_Data | ( |  | ) |

## Member Function Documentation

Standard_EXPORT void Storage_Data::AddRoot | ( | const TCollection_AsciiString & | aName,
|  | const Handle(Standard_Persistent)& | anObject
| ) | const

Standard_EXPORT void Storage_Data::AddRoot | ( | const Handle(Standard_Persistent)& | anObject | ) | const

Standard_EXPORT void Storage_Data::AddToComments | ( | const TCollection_ExtendedString & | aComment | ) |

Standard_EXPORT void Storage_Data::AddToUserInfo | ( | const TCollection_AsciiString & | anInfo | ) |

Standard_EXPORT TCollection_ExtendedString Storage_Data::ApplicationName | ( |  | ) | const

Standard_EXPORT TCollection_AsciiString Storage_Data::ApplicationVersion | ( |  | ) | const

Standard_EXPORT void Storage_Data::Clear | ( |  | ) | const`[private]`

Standard_EXPORT void Storage_Data::ClearErrorStatus | ( |  | ) |

Standard_EXPORT const TColStd_SequenceOfExtendedString& Storage_Data::Comments | ( |  | ) | const

Standard_EXPORT TCollection_AsciiString Storage_Data::CreationDate | ( |  | ) | const

Standard_EXPORT TCollection_ExtendedString Storage_Data::DataType | ( |  | ) | const

Standard_EXPORT Storage_Error Storage_Data::ErrorStatus | ( |  | ) | const

Standard_EXPORT TCollection_AsciiString Storage_Data::ErrorStatusExtension | ( |  | ) | const

Standard_EXPORT Handle_Storage_Root Storage_Data::Find | ( | const TCollection_AsciiString & | aName | ) | const

Standard_EXPORT const Storage_Data::Handle | ( | Standard_Type |  | ) | const

| Reimplemented from MMgt_TShared.

Standard_EXPORT Handle_Storage_HeaderData Storage_Data::HeaderData | ( |  | ) | const`[private]`

Standard_EXPORT Handle_Storage_InternalData Storage_Data::InternalData | ( |  | ) | const`[private]`

Standard_EXPORT Standard_Boolean Storage_Data::IsRoot | ( | const TCollection_AsciiString & | aName | ) | const

Standard_EXPORT Standard_Boolean Storage_Data::IsType | ( | const TCollection_AsciiString & | aName | ) | const

Standard_EXPORT Standard_Integer Storage_Data::NumberOfObjects | ( |  | ) | const

Standard_EXPORT Standard_Integer Storage_Data::NumberOfRoots | ( |  | ) | const

Standard_EXPORT Standard_Integer Storage_Data::NumberOfTypes | ( |  | ) | const

Standard_EXPORT void Storage_Data::RemoveRoot | ( | const TCollection_AsciiString & | aName | ) |

Standard_EXPORT Handle_Storage_RootData Storage_Data::RootData | ( |  | ) | const`[private]`

Standard_EXPORT Handle_Storage_HSeqOfRoot Storage_Data::Roots | ( |  | ) | const

Standard_EXPORT TCollection_AsciiString Storage_Data::SchemaName | ( |  | ) | const

Standard_EXPORT TCollection_AsciiString Storage_Data::SchemaVersion | ( |  | ) | const

Standard_EXPORT void Storage_Data::SetApplicationName | ( | const TCollection_ExtendedString & | aName | ) |

Standard_EXPORT void Storage_Data::SetApplicationVersion | ( | const TCollection_AsciiString & | aVersion | ) |

Standard_EXPORT void Storage_Data::SetDataType | ( | const TCollection_ExtendedString & | aType | ) |

Standard_EXPORT void Storage_Data::SetErrorStatus | ( | const Storage_Error | anError | ) | `[private]`

Standard_EXPORT void Storage_Data::SetErrorStatusExtension | ( | const TCollection_AsciiString & | anErrorExt | ) | `[private]`

Standard_EXPORT TCollection_AsciiString Storage_Data::StorageVersion | ( |  | ) | const

Standard_EXPORT Handle_Storage_TypeData Storage_Data::TypeData | ( |  | ) | const`[private]`

Standard_EXPORT Handle_TColStd_HSequenceOfAsciiString Storage_Data::Types | ( |  | ) | const

Standard_EXPORT const TColStd_SequenceOfAsciiString& Storage_Data::UserInfo | ( |  | ) | const

## Field Documentation

Storage_Error Storage_Data::myErrorStatus `[private]`

TCollection_AsciiString Storage_Data::myErrorStatusExt `[private]`

Handle_Storage_HeaderData Storage_Data::myHeaderData `[private]`

Handle_Storage_InternalData Storage_Data::myInternal `[private]`

Handle_Storage_RootData Storage_Data::myRootData `[private]`

Handle_Storage_TypeData Storage_Data::myTypeData `[private]`

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

- Storage_Data.hxx