OpenCascade.js
API ReferenceFoundationClassesTKernel

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_Data class 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_Data class, then add the persistent data to write with the function AddRoot,
  • call the function Write from the schema, setting the driver and the Storage_Data instance as parameters,
  • close the driver.

Constructors(1)

Static methods(1)

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_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

Constructors(1)

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

Static methods(2)

Instance methods(34)

Storage_Error

Properties(14)

Storage_HeaderData

Constructors(1)

Static methods(2)

Instance methods(24)

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)

Static methods(2)

Instance methods(9)

Storage_RootData

Constructors(1)

Static methods(2)

Instance methods(10)

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

Constructors(1)

  • 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 - -------------------------------------------------------------

Static methods(4)

  • return a current date string

  • 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)
    • theTypeName
    • theNewName
      Mutated in place; read the updated value from this argument after the call.
  • get_type_name(): string

Instance methods(16)

Storage_TypeData

Constructors(1)

Static methods(2)

Instance methods(10)

Storage_TypedCallBack

Constructors(2)

Static methods(2)

Instance methods(7)