Storage
OCCT package Storage: Storage, Storage_Bucket, Storage_BucketIterator, Storage_BucketOfPersistent, and 20 more bound classes.
Storage
Storage package is used to write and read persistent objects. These objects are read and written by a retrieval or storage algorithm (Storage_Schema object) in a container (disk, memory, network ...). Drivers (FSD_File objects) assign a physical container for data to be stored or retrieved. The standard procedure for an application in reading a container is the following:
- open the driver in reading mode,
- call the Read function from the schema, setting the driver as a parameter. This function returns an instance of the
Storage_Dataclass which contains the data being read, - close the driver. The standard procedure for an application in writing a container is the following:
- open the driver in writing mode,
- create an instance of the
Storage_Dataclass, then add the persistent data to write with the function AddRoot, - call the function Write from the schema, setting the driver and the
Storage_Datainstance as parameters, - close the driver.
Constructors(1)
Static methods(1)
returns the version of
Storage's read/write routines
Storage_Bucket
Constructors(2)
- constructor(theSpaceSize: number): Storage_BucketParameters (1)
theSpaceSize
Instance methods(1)
- Clear(): void
Storage_BucketIterator
Constructors(1)
- Parameters (1)
a0
Instance methods(5)
- Init(argNo0: Storage_BucketOfPersistent): voidParameters (1)
argNo0
- Reset(): void
- More(): boolean
- Next(): void
Storage_BucketOfPersistent
Constructors(1)
- constructor(theBucketSize?: number, theBucketNumber?: number): Storage_BucketOfPersistentParameters (2)
theBucketSizetheBucketNumber
Instance methods(4)
- Length(): number
- Append(sp: Standard_Persistent): voidParameters (1)
sp
- Value(theIndex: number): Standard_PersistentParameters (1)
theIndex
- Clear(): void
Storage_CallBack
Static methods(2)
- get_type_name(): string
Instance methods(2)
- Add(aPers: Standard_Persistent, aSchema: Storage_Schema): voidParameters (2)
aPersaSchema
Storage_Data
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_Dataobject is used in both the storage and retrieval operations: Storagemechanism: create an emptyStorage_Dataobject, 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 yourStorage_Schemastorage/retrieval algorithm.- Retrieval mechanism: a
Storage_Dataobject is returned by the Read function from yourStorage_Schemastorage/retrieval algorithm. Use the functions NumberOfRoots and Roots to find the roots which were stored in the read container. The roots of aStorage_Dataobject may share references on objects. The shared internal references of aStorage_Dataobject are maintained by the storage/retrieval mechanism.
Note: References shared by objects which are contained in two distinctStorage_Dataobjects are not maintained by the storage/retrieval mechanism: external references are not supported byStorage_Schemaalgorithm
Constructors(1)
Creates an empty set of data. You explicitly create a
Storage_Dataobject 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. AStorage_Dataobject is also returned by the Read function of aStorage_Schemastorage/retrieval algorithm. Use the functions NumberOfRoots and Roots to find the roots which were stored in the read container.
Static methods(2)
- get_type_name(): string
Instance methods(34)
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_Schemaalgorithm, 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
- ClearErrorStatus(): void
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_Schemaalgorithm, on this set of data. This error status may be read by the function ErrorStatus.
return the creation date
return the
Storagepackage versionget the version of the schema
get the schema's name
- SetApplicationVersion(aVersion: TCollection_AsciiString): void
set the version of the application
Parameters (1)aVersion
get the version of the application
- SetApplicationName(aName: TCollection_ExtendedString): void
set the name of the application
Parameters (1)aName
get the name of the application
- SetDataType(aType: TCollection_ExtendedString): void
set the data type
Parameters (1)aType
returns data type
- AddToUserInfo(anInfo: TCollection_AsciiString): void
add <theUserInfo> to the user information
Parameters (1)anInfo
return the user information
- AddToComments(aComment: TCollection_ExtendedString): void
add <theUserInfo> to the user information
Parameters (1)aComment
return the user information
- NumberOfObjects(): number
the number of persistent objects Return: the number of persistent objects readed
- NumberOfRoots(): number
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.
- AddRoot(anObject: Standard_Persistent): void
add a persistent root to write. the name of the root is a driver reference number.
Parameters (1)anObject
- AddRoot(aName: TCollection_AsciiString, anObject: Standard_Persistent): void
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.
Parameters (2)aNameanObject
- RemoveRoot(aName: TCollection_AsciiString): void
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.
Parameters (1)aName
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.
- Find(aName: TCollection_AsciiString): Storage_Root
Gives the root object whose name is aName in this set of data. The returned object is a
Storage_Rootobject, 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.Parameters (1)aName
- IsRoot(aName: TCollection_AsciiString): boolean
returns true if <me> contains a root named <aName>
Parameters (1)aName
- NumberOfTypes(): number
Returns the number of types of objects used in this set of data.
- IsType(aName: TCollection_AsciiString): boolean
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_Schemaalgorithm used to store or retrieve them.Parameters (1)aName
Gives the list of types of objects used in this set of data in a sequence.
- Clear(): void
Storage_DefaultCallBack
Constructors(1)
Static methods(2)
- get_type_name(): string
Instance methods(2)
- Add(aPers: Standard_Persistent, aSchema: Storage_Schema): voidParameters (2)
aPersaSchema
Storage_Error
Properties(14)
Storage_HeaderData
Constructors(1)
Static methods(2)
- get_type_name(): string
Instance methods(24)
return the
Storagepackage versionget the version of the schema
get the schema's name
- SetApplicationVersion(aVersion: TCollection_AsciiString): void
set the version of the application
Parameters (1)aVersion
get the version of the application
- SetApplicationName(aName: TCollection_ExtendedString): void
set the name of the application
Parameters (1)aName
get the name of the application
- SetDataType(aType: TCollection_ExtendedString): void
set the data type
Parameters (1)aType
returns data type
- AddToUserInfo(theUserInfo: TCollection_AsciiString): void
add <theUserInfo> to the user information
Parameters (1)theUserInfo
return the user information
- AddToComments(aComment: TCollection_ExtendedString): void
add <theUserInfo> to the user information
Parameters (1)aComment
return the user information
- NumberOfObjects(): number
the number of persistent objects Return: the number of persistent objects readed
- ClearErrorStatus(): void
- SetNumberOfObjects(anObjectNumber: number): voidParameters (1)
anObjectNumber
- SetStorageVersion(aVersion: TCollection_AsciiString): voidParameters (1)
aVersion
- SetStorageVersion(theVersion: number): voidParameters (1)
theVersion
- SetCreationDate(aDate: TCollection_AsciiString): voidParameters (1)
aDate
- SetSchemaVersion(aVersion: TCollection_AsciiString): voidParameters (1)
aVersion
- SetSchemaName(aName: TCollection_AsciiString): voidParameters (1)
aName
Storage_InternalData
Constructors(1)
Static methods(2)
- get_type_name(): string
Instance methods(3)
- Clear(): void
Storage_OpenMode
Properties(4)
Storage_Root
A root object extracted from a Storage_Data object.
A Storage_Root encapsulates a persistent object which is a root of a Storage_Data object. It contains additional information: the name and the data type of the persistent object.
When retrieving a Storage_Data object from a container (for example, a file) you access its roots with the function Roots which returns a sequence of root objects. The provided functions allow you to request information about each root of the sequence.
You do not create explicit roots: when inserting data in a Storage_Data object, you just provide the persistent object and optionally its name to the function AddRoot.
Constructors(3)
- constructor(theName: TCollection_AsciiString, theObject: Standard_Persistent): Storage_RootParameters (2)
theNametheObject
- constructor(theName: TCollection_AsciiString, theRef: number, theType: TCollection_AsciiString): Storage_RootParameters (3)
theNametheReftheType
Static methods(2)
- get_type_name(): string
Instance methods(9)
- SetName(theName: TCollection_AsciiString): voidParameters (1)
theName
Returns the name of this root object.
The name may have been given explicitly when the root was inserted into theStorage_Dataobject.
If not, the name is a reference number which was assigned automatically 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.
Warning The returned string will be empty if you call this function before having named this root object, either explicitly, or when writing the set of data into the container.- SetObject(anObject: Standard_Persistent): voidParameters (1)
anObject
Returns the persistent object encapsulated by this root.
Returns the name of this root type.
- SetReference(aRef: number): voidParameters (1)
aRef
- Reference(): number
- SetType(aType: TCollection_AsciiString): voidParameters (1)
aType
Storage_RootData
Constructors(1)
Static methods(2)
- get_type_name(): string
Instance methods(10)
- AddRoot(aRoot: Storage_Root): void
add a root to <me>. If a root with same name is present, it will be replaced by <aRoot>.
Parameters (1)aRoot
- Find(aName: TCollection_AsciiString): Storage_Root
find a root with name <aName>.
Parameters (1)aName
- IsRoot(aName: TCollection_AsciiString): boolean
returns true if <me> contains a root named <aName>
Parameters (1)aName
- RemoveRoot(aName: TCollection_AsciiString): void
remove the root named <aName>.
Parameters (1)aName
- ClearErrorStatus(): void
- UpdateRoot(aName: TCollection_AsciiString, aPers: Standard_Persistent): voidParameters (2)
aNameaPers
Storage_Schema
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_Schemaobject 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_Schemaalgorithms are called basic because they do not support external references between containers.
Constructors(1)
Builds a storage/retrieval algorithm based on a given data schema. Example For example, if ShapeSchema is the class inheriting from
Storage_Schemaand containing the description of your application data schema, you create a storage/retrieval algorithm as follows:occ::handle<ShapeSchema>s = new ShapeSchema;.
USER API - -------------------------------------------------------------
Static methods(4)
return a current date string
- CheckTypeMigration(theTypeName: TCollection_AsciiString, theNewName: TCollection_AsciiString): boolean
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.
Parameters (2)theTypeNametheNewName—Mutated in place; read the updated value from this argument after the call.
- get_type_name(): string
Instance methods(16)
returns the version of the schema
- SetName(aSchemaName: TCollection_AsciiString): void
set the schema's name
Parameters (1)aSchemaName
returns the schema's name
- AddReadUnknownTypeCallBack(aTypeName: TCollection_AsciiString, aCallBack: Storage_CallBack): void
add two functions to the callback list
Parameters (2)aTypeNameaCallBack
- RemoveReadUnknownTypeCallBack(aTypeName: TCollection_AsciiString): void
remove a callback for a type
Parameters (1)aTypeName
returns a list of type name with installed callback.
- ClearCallBackList(): void
clear all callback from schema instance.
- UseDefaultCallBack(): void
install a callback for all unknown type. the objects with unknown types will be skipped. (look SkipObject method in BaseDriver)
- DontUseDefaultCallBack(): void
tells schema to uninstall the default callback.
- IsUsingDefaultCallBack(): boolean
ask if the schema is using the default callback.
- SetDefaultCallBack(f: Storage_CallBack): void
overload the default function for build. (use to set an error message or skip an object while reading an unknown type).
Parameters (1)f
- ResetDefaultCallBack(): void
reset the default function defined by
Storagepackage. returns the read function used when the
UseDefaultCallBack()is set.- AddPersistent(sp: Standard_Persistent, tName: string): booleanParameters (2)
sptName
- PersistentToAdd(sp: Standard_Persistent): booleanParameters (1)
sp
Storage_SolveMode
Properties(3)
Storage_StreamExtCharParityError
Constructors(2)
- constructor(theMessage: string): Storage_StreamExtCharParityErrorParameters (1)
theMessage
- constructor(theMessage: string, theStackTrace: string): Storage_StreamExtCharParityErrorParameters (2)
theMessagetheStackTrace
Instance methods(1)
- ExceptionType(): string
Storage_StreamFormatError
Constructors(2)
- constructor(theMessage: string): Storage_StreamFormatErrorParameters (1)
theMessage
- constructor(theMessage: string, theStackTrace: string): Storage_StreamFormatErrorParameters (2)
theMessagetheStackTrace
Instance methods(1)
- ExceptionType(): string
Storage_StreamModeError
Constructors(2)
- constructor(theMessage: string): Storage_StreamModeErrorParameters (1)
theMessage
- constructor(theMessage: string, theStackTrace: string): Storage_StreamModeErrorParameters (2)
theMessagetheStackTrace
Instance methods(1)
- ExceptionType(): string
Storage_StreamReadError
Constructors(2)
- constructor(theMessage: string): Storage_StreamReadErrorParameters (1)
theMessage
- constructor(theMessage: string, theStackTrace: string): Storage_StreamReadErrorParameters (2)
theMessagetheStackTrace
Instance methods(1)
- ExceptionType(): string
Storage_StreamTypeMismatchError
Constructors(2)
- constructor(theMessage: string): Storage_StreamTypeMismatchErrorParameters (1)
theMessage
- constructor(theMessage: string, theStackTrace: string): Storage_StreamTypeMismatchErrorParameters (2)
theMessagetheStackTrace
Instance methods(1)
- ExceptionType(): string
Storage_StreamUnknownTypeError
Constructors(2)
- constructor(theMessage: string): Storage_StreamUnknownTypeErrorParameters (1)
theMessage
- constructor(theMessage: string, theStackTrace: string): Storage_StreamUnknownTypeErrorParameters (2)
theMessagetheStackTrace
Instance methods(1)
- ExceptionType(): string
Storage_StreamWriteError
Constructors(2)
- constructor(theMessage: string): Storage_StreamWriteErrorParameters (1)
theMessage
- constructor(theMessage: string, theStackTrace: string): Storage_StreamWriteErrorParameters (2)
theMessagetheStackTrace
Instance methods(1)
- ExceptionType(): string
Storage_TypeData
Constructors(1)
Static methods(2)
- get_type_name(): string
Instance methods(10)
- AddType(aName: TCollection_AsciiString, aTypeNum: number): void
add a type to the list
Parameters (2)aNameaTypeNum
- Type(aTypeNum: number): TCollection_AsciiString
returns the name of the type with number <aTypeNum>
Parameters (1)aTypeNum
- Type(aTypeName: TCollection_AsciiString): number
returns the name of the type with number <aTypeNum>
Parameters (1)aTypeName
- IsType(aName: TCollection_AsciiString): booleanParameters (1)
aName
- ClearErrorStatus(): void
- Clear(): void
Storage_TypedCallBack
Constructors(2)
- constructor(aTypeName: TCollection_AsciiString, aCallBack: Storage_CallBack): Storage_TypedCallBackParameters (2)
aTypeNameaCallBack
Static methods(2)
- get_type_name(): string
Instance methods(7)
- SetType(aType: TCollection_AsciiString): voidParameters (1)
aType
- SetCallBack(aCallBack: Storage_CallBack): voidParameters (1)
aCallBack
- SetIndex(anIndex: number): voidParameters (1)
anIndex
- Index(): number
StdFail
OCCT package StdFail: StdFail_InfiniteSolutions, StdFail_NotDone, StdFail_Undefined, StdFail_UndefinedDerivative, and 1 more bound classes.
TCollection
OCCT package TCollection: TCollection, TCollection_AsciiString, TCollection_ExtendedString, TCollection_HAsciiString, and 1 more bound classes.