1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0024002: Overall code and build procedure refactoring -- automatic

Automatic upgrade of OCCT code by command "occt_upgrade . -nocdl":
- WOK-generated header files from inc and sources from drv are moved to src
- CDL files removed
- All packages are converted to nocdlpack
This commit is contained in:
abv
2015-07-12 07:42:38 +03:00
parent 543a996496
commit 42cf5bc1ca
15354 changed files with 623957 additions and 509844 deletions

View File

@@ -1,16 +1,54 @@
Storage_Macros.hxx
Storage_BucketOfPersistent.hxx
Storage_Position.hxx
Storage_SeqOfRoot.hxx
Storage_HSeqOfRoot.hxx
Storage_PType.hxx
Storage_MapOfPers.hxx
Storage_DataMapIteratorOfMapOfPers.hxx
Storage_MapOfCallBack.hxx
Storage_DataMapIteratorOfMapOfCallBack.hxx
Storage.cxx
Storage.hxx
Storage_ArrayOfCallBack.hxx
Storage_HArrayOfCallBack.hxx
Storage_ArrayOfSchema.hxx
Storage_BaseDriver.cxx
Storage_BaseDriver.hxx
Storage_BaseDriver.lxx
Storage_BucketOfPersistent.hxx
Storage_CallBack.cxx
Storage_CallBack.hxx
Storage_Data.cxx
Storage_Data.hxx
Storage_DataMapIteratorOfMapOfCallBack.hxx
Storage_DataMapIteratorOfMapOfPers.hxx
Storage_DefaultCallBack.cxx
Storage_DefaultCallBack.hxx
Storage_Error.hxx
Storage_HArrayOfCallBack.hxx
Storage_HArrayOfSchema.hxx
Storage_PArray.hxx
Storage_HeaderData.cxx
Storage_HeaderData.hxx
Storage_HPArray.hxx
Storage_HSeqOfRoot.hxx
Storage_InternalData.cxx
Storage_InternalData.hxx
Storage_Macros.hxx
Storage_MapOfCallBack.hxx
Storage_MapOfPers.hxx
Storage_OpenMode.hxx
Storage_PArray.hxx
Storage_Position.hxx
Storage_PType.hxx
Storage_Root.cxx
Storage_Root.hxx
Storage_RootData.cxx
Storage_RootData.hxx
Storage_Schema.cxx
Storage_Schema.hxx
Storage_Schema.lxx
Storage_SeqOfRoot.hxx
Storage_SolveMode.hxx
Storage_stCONSTclCOM.cxx
Storage_stCONSTclCOM.hxx
Storage_StreamExtCharParityError.hxx
Storage_StreamFormatError.hxx
Storage_StreamModeError.hxx
Storage_StreamReadError.hxx
Storage_StreamTypeMismatchError.hxx
Storage_StreamUnknownTypeError.hxx
Storage_StreamWriteError.hxx
Storage_TypeData.cxx
Storage_TypeData.hxx
Storage_TypedCallBack.cxx
Storage_TypedCallBack.hxx

View File

@@ -1,166 +0,0 @@
-- Created on: 1996-04-30
-- Created by: cle
-- Copyright (c) 1996-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
package Storage
---Purpose: 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.
uses TCollection,
TColStd,
MMgt
is
exception StreamModeError inherits Failure from Standard;
exception StreamFormatError inherits Failure from Standard;
exception StreamWriteError inherits Failure from Standard;
exception StreamReadError inherits Failure from Standard;
exception StreamUnknownTypeError inherits StreamReadError from Storage;
exception StreamTypeMismatchError inherits StreamReadError from Storage;
exception StreamExtCharParityError inherits StreamReadError from Storage;
enumeration Error
is
VSOk, -- no problem
VSOpenError, -- while opening the stream
VSModeError, -- the stream is opened with a wrong mode for operation
VSCloseError, -- while closing the stream
VSAlreadyOpen, -- stream is already opened
VSNotOpen, -- stream not opened
VSSectionNotFound, -- the section is not found
VSWriteError, -- error during writing
VSFormatError, -- wrong format error occured while reading
VSUnknownType, -- try to read an unknown type
VSTypeMismatch, -- try to read a wrong primitive type (read a char while expecting a real)
VSInternalError, -- internal error
VSExtCharParityError, -- problem with 16bit characters, may be a 8bit character is inserted inside 16bit string
VSWrongFileDriver -- we try to read a file with a wrong driver (occured while reading header section)
end;
---Purpose: Error codes returned by the ErrorStatus
-- function on a Storage_Data set of data during a
-- storage or retrieval operation :
-- - Storage_VSOk : no problem has been detected
-- - Storage_VSOpenError : an error has
-- occurred when opening the driver
-- - Storage_VSModeError : the driver has not
-- been opened in the correct mode
-- - Storage_VSCloseError : an error has
-- occurred when closing the driver
-- - Storage_VSAlreadyOpen : the driver is already open
-- - Storage_VSNotOpen : the driver is not open
-- - Storage_VSSectionNotFound : a section
-- has not been found in the driver
-- - Storage_VSWriteError : an error occurred when writing the driver
-- - Storage_VSFormatError : the file format is wrong
-- - Storage_VSUnknownType : a type is not known from the schema
-- - Storage_VSTypeMismatch : trying to read a wrong type
-- - Storage_VSInternalError : an internal error has been detected
-- - Storage_VSExtCharParityError : an error
-- has occurred while reading 16 bit characte
enumeration OpenMode
is
VSNone,
VSRead,
VSWrite,
VSReadWrite
end;
---Purpose:
-- Specifies opening modes for a file:
-- - Storage_VSNone : no mode is specified
-- - Storage_VSRead : the file is open for reading operations
-- - Storage_VSWrite : the file is open for writing operations
-- - Storage_VSReadWrite : the file is open
-- for both reading and writing operations.
enumeration SolveMode
is
AddSolve,
WriteSolve,
ReadSolve
end;
imported BucketOfPersistent;
imported Position; -- typedef long
deferred class BaseDriver;
deferred class CallBack;
class DefaultCallBack;
class HeaderData;
class Data;
class TypeData;
class RootData;
class Root;
class Schema;
imported SeqOfRoot;
imported transient class HSeqOfRoot;
-- PRIVATE
private class InternalData;
private class stCONSTclCOM;
private class TypedCallBack;
imported PType;
imported MapOfPers;
imported DataMapIteratorOfMapOfPers;
imported MapOfCallBack;
imported DataMapIteratorOfMapOfCallBack;
imported ArrayOfCallBack;
imported transient class HArrayOfCallBack;
imported ArrayOfSchema;
imported transient class HArrayOfSchema;
imported PArray;
imported transient class HPArray;
-- METHODS
Version returns AsciiString from TCollection;
---Purpose: returns the version of Storage's read/write routines
end;

103
src/Storage/Storage.hxx Normal file
View File

@@ -0,0 +1,103 @@
// Created on: 1996-04-30
// Created by: cle
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Storage_HeaderFile
#define _Storage_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
class TCollection_AsciiString;
class Storage_BaseDriver;
class Storage_CallBack;
class Storage_DefaultCallBack;
class Storage_HeaderData;
class Storage_Data;
class Storage_TypeData;
class Storage_RootData;
class Storage_Root;
class Storage_Schema;
class Storage_InternalData;
class Storage_stCONSTclCOM;
class Storage_TypedCallBack;
//! 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.
class Storage
{
public:
DEFINE_STANDARD_ALLOC
//! returns the version of Storage's read/write routines
Standard_EXPORT static TCollection_AsciiString Version();
protected:
private:
friend class Storage_BaseDriver;
friend class Storage_CallBack;
friend class Storage_DefaultCallBack;
friend class Storage_HeaderData;
friend class Storage_Data;
friend class Storage_TypeData;
friend class Storage_RootData;
friend class Storage_Root;
friend class Storage_Schema;
friend class Storage_InternalData;
friend class Storage_stCONSTclCOM;
friend class Storage_TypedCallBack;
};
#endif // _Storage_HeaderFile

View File

@@ -1,367 +0,0 @@
-- Created on: 1996-11-25
-- Created by: Christophe LEYNADIER
-- Copyright (c) 1996-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
deferred class BaseDriver from Storage
---Purpose: Root class for drivers. A driver assigns a physical container
-- to data to be stored or retrieved, for instance a file.
-- The FSD package provides two derived concrete classes :
-- - FSD_File is a general driver which defines a
-- file as the container of data.
uses Position from Storage,
AsciiString from TCollection,
OpenMode from Storage,
Error from Storage,
ExtendedString from TCollection,
SequenceOfAsciiString from TColStd,
SequenceOfExtendedString from TColStd
raises StreamTypeMismatchError from Storage,
StreamFormatError from Storage,
StreamWriteError from Storage,
StreamExtCharParityError from Storage
is
Delete ( me : out ) ;
---C++: alias "Standard_EXPORT virtual ~Storage_BaseDriver(){Delete();}"
Initialize;
Open(me : in out; aName : AsciiString from TCollection; aMode : OpenMode from Storage) returns Error from Storage is deferred;
Name(me) returns AsciiString from TCollection;
---C++: inline
OpenMode(me) returns OpenMode from Storage;
---C++: inline
IsEnd(me : in out) returns Boolean from Standard is deferred;
---Purpose: returns True if we are at end of the stream
Tell( me : in out ) returns Position from Storage is deferred;
---Purpose: return position in the file. Return -1 upon error.
-- INFO SECTION
-- write
--
BeginWriteInfoSection(me : in out) returns Error from Storage is deferred;
WriteInfo(me : in out; nbObj : Integer from Standard;
dbVersion : AsciiString from TCollection;
date : AsciiString from TCollection;
schemaName : AsciiString from TCollection;
schemaVersion : AsciiString from TCollection;
appName : ExtendedString from TCollection;
appVersion : AsciiString from TCollection;
objectType : ExtendedString from TCollection;
userInfo : SequenceOfAsciiString from TColStd)
raises StreamWriteError
is deferred;
EndWriteInfoSection(me : in out) returns Error from Storage is deferred;
-- read
--
BeginReadInfoSection(me : in out) returns Error from Storage
is deferred;
ReadInfo(me : in out; nbObj : in out Integer from Standard;
dbVersion : in out AsciiString from TCollection;
date : in out AsciiString from TCollection;
schemaName : in out AsciiString from TCollection;
schemaVersion : in out AsciiString from TCollection;
appName : in out ExtendedString from TCollection;
appVersion : in out AsciiString from TCollection;
objectType : in out ExtendedString from TCollection;
userInfo : in out SequenceOfAsciiString from TColStd)
raises StreamTypeMismatchError,StreamExtCharParityError
is deferred;
EndReadInfoSection(me : in out) returns Error from Storage
is deferred;
-- COMMENTS SECTION
-- write
--
BeginWriteCommentSection(me : in out) returns Error from Storage is deferred;
WriteComment(me : in out; userComments : SequenceOfExtendedString from TColStd)
raises StreamWriteError is deferred;
EndWriteCommentSection(me : in out) returns Error from Storage is deferred;
-- read
--
BeginReadCommentSection(me : in out) returns Error from Storage is deferred;
ReadComment(me : in out; userComments : in out SequenceOfExtendedString from TColStd)
raises StreamTypeMismatchError,StreamExtCharParityError
is deferred;
EndReadCommentSection(me : in out) returns Error from Storage is deferred;
-- TYPE SECTION
-- write
--
BeginWriteTypeSection(me : in out) returns Error from Storage is deferred;
SetTypeSectionSize(me : in out; aSize : Integer from Standard)
raises StreamWriteError
is deferred;
WriteTypeInformations(me : in out; typeNum : Integer from Standard; typeName : AsciiString from TCollection)
raises StreamWriteError
is deferred;
EndWriteTypeSection(me : in out) returns Error from Storage is deferred;
-- read
--
BeginReadTypeSection(me : in out) returns Error from Storage
is deferred;
TypeSectionSize(me : in out) returns Integer from Standard
raises StreamTypeMismatchError
is deferred;
ReadTypeInformations(me : in out; typeNum : in out Integer from Standard; typeName : in out AsciiString from TCollection)
raises StreamTypeMismatchError
is deferred;
EndReadTypeSection(me : in out) returns Error from Storage
is deferred;
-- ROOT SECTION
-- write
--
BeginWriteRootSection(me : in out) returns Error from Storage is deferred;
SetRootSectionSize(me : in out; aSize : Integer from Standard)
raises StreamWriteError
is deferred;
WriteRoot(me : in out; rootName : AsciiString from TCollection; aRef : Integer from Standard; aType : AsciiString from TCollection)
raises StreamWriteError
is deferred;
EndWriteRootSection(me : in out) returns Error from Storage is deferred;
-- read
--
BeginReadRootSection(me : in out) returns Error from Storage
is deferred;
RootSectionSize(me : in out) returns Integer from Standard
raises StreamTypeMismatchError
is deferred;
ReadRoot(me : in out; rootName : in out AsciiString from TCollection; aRef : in out Integer from Standard; aType : in out AsciiString from TCollection)
raises StreamTypeMismatchError
is deferred;
EndReadRootSection(me : in out) returns Error from Storage
is deferred;
-- REF SECTION
-- write
--
BeginWriteRefSection(me : in out) returns Error from Storage is deferred;
SetRefSectionSize(me : in out; aSize : Integer from Standard)
raises StreamWriteError
is deferred;
WriteReferenceType(me : in out; reference : Integer from Standard; typeNum : Integer from Standard)
raises StreamWriteError
is deferred;
EndWriteRefSection(me : in out) returns Error from Storage is deferred;
-- read
--
BeginReadRefSection(me : in out) returns Error from Storage
is deferred;
RefSectionSize(me : in out) returns Integer from Standard
raises StreamTypeMismatchError
is deferred;
ReadReferenceType(me : in out; reference : in out Integer from Standard; typeNum : in out Integer from Standard)
raises StreamTypeMismatchError
is deferred;
EndReadRefSection(me : in out) returns Error from Storage
is deferred;
-- DATA SECTION
-- write
--
BeginWriteDataSection(me : in out) returns Error from Storage is deferred;
WritePersistentObjectHeader(me : in out; aRef : Integer from Standard; aType : Integer from Standard)
raises StreamWriteError
is deferred;
BeginWritePersistentObjectData(me : in out)
raises StreamWriteError
is deferred;
BeginWriteObjectData(me : in out)
raises StreamWriteError
is deferred;
EndWriteObjectData(me : in out)
raises StreamWriteError
is deferred;
EndWritePersistentObjectData(me : in out)
raises StreamWriteError
is deferred;
EndWriteDataSection(me : in out) returns Error from Storage is deferred;
-- read
--
BeginReadDataSection(me : in out) returns Error from Storage
is deferred;
ReadPersistentObjectHeader(me : in out; aRef : in out Integer from Standard; aType : in out Integer from Standard)
raises StreamTypeMismatchError,StreamFormatError
is deferred;
BeginReadPersistentObjectData(me : in out)
raises StreamFormatError
is deferred;
BeginReadObjectData(me : in out)
raises StreamFormatError
is deferred;
EndReadObjectData(me : in out)
raises StreamFormatError
is deferred;
EndReadPersistentObjectData(me : in out)
raises StreamFormatError
is deferred;
EndReadDataSection(me : in out) returns Error from Storage
is deferred;
-- jump to the next object to read
--
SkipObject(me : in out) is deferred;
--
PutReference(me : in out; aValue : Integer from Standard) returns BaseDriver from Storage
raises StreamWriteError
is deferred;
---C++: return &
PutCharacter(me : in out; aValue : Character from Standard) returns BaseDriver from Storage
raises StreamWriteError
is deferred;
---C++: alias operator <<
---C++: return &
PutExtCharacter(me : in out; aValue : ExtCharacter from Standard) returns BaseDriver from Storage
raises StreamWriteError
is deferred;
---C++: alias operator <<
---C++: return &
PutInteger(me : in out; aValue : Integer from Standard) returns BaseDriver from Storage
raises StreamWriteError
is deferred;
---C++: alias operator <<
---C++: return &
PutBoolean(me : in out; aValue : Boolean from Standard) returns BaseDriver from Storage
raises StreamWriteError
is deferred;
---C++: alias operator <<
---C++: return &
PutReal(me : in out; aValue : Real from Standard) returns BaseDriver from Storage
raises StreamWriteError
is deferred;
---C++: alias operator <<
---C++: return &
PutShortReal(me : in out; aValue : ShortReal from Standard) returns BaseDriver from Storage
raises StreamWriteError
is deferred;
---C++: alias operator <<
---C++: return &
GetReference(me : in out; aValue : in out Integer from Standard) returns BaseDriver from Storage
raises StreamTypeMismatchError
is deferred;
---C++: return &
GetCharacter(me : in out; aValue : in out Character from Standard) returns BaseDriver from Storage
raises StreamTypeMismatchError
is deferred;
---C++: alias operator >>
---C++: return &
GetExtCharacter(me : in out; aValue :in out ExtCharacter from Standard) returns BaseDriver from Storage
raises StreamTypeMismatchError
is deferred;
---C++: alias operator >>
---C++: return &
GetInteger(me : in out; aValue : in out Integer from Standard) returns BaseDriver from Storage
raises StreamTypeMismatchError
is deferred;
---C++: alias operator >>
---C++: return &
GetBoolean(me : in out; aValue : in out Boolean from Standard) returns BaseDriver from Storage
raises StreamTypeMismatchError
is deferred;
---C++: alias operator >>
---C++: return &
GetReal(me : in out; aValue :in out Real from Standard) returns BaseDriver from Storage
raises StreamTypeMismatchError
is deferred;
---C++: alias operator >>
---C++: return &
GetShortReal(me : in out; aValue : in out ShortReal from Standard) returns BaseDriver from Storage
raises StreamTypeMismatchError
is deferred;
---C++: alias operator >>
---C++: return &
Close(me : in out) returns Error from Storage is deferred;
-- PROTECTED
SetName(me : in out; aName : AsciiString from TCollection) is protected;
---C++: inline
SetOpenMode(me : in out; aMode : OpenMode from Storage) is protected;
---C++: inline
fields
myOpenMode : OpenMode from Storage;
myName : AsciiString from TCollection;
end;

View File

@@ -12,7 +12,14 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Storage_BaseDriver.ixx>
#include <Storage_BaseDriver.hxx>
#include <Storage_StreamExtCharParityError.hxx>
#include <Storage_StreamFormatError.hxx>
#include <Storage_StreamTypeMismatchError.hxx>
#include <Storage_StreamWriteError.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
Storage_BaseDriver::Storage_BaseDriver() : myOpenMode(Storage_VSNone)
{

View File

@@ -0,0 +1,283 @@
// Created on: 1996-11-25
// Created by: Christophe LEYNADIER
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Storage_BaseDriver_HeaderFile
#define _Storage_BaseDriver_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Storage_OpenMode.hxx>
#include <TCollection_AsciiString.hxx>
#include <Storage_Error.hxx>
#include <Standard_Boolean.hxx>
#include <Storage_Position.hxx>
#include <Standard_Integer.hxx>
#include <TColStd_SequenceOfAsciiString.hxx>
#include <TColStd_SequenceOfExtendedString.hxx>
#include <Standard_Character.hxx>
#include <Standard_ExtCharacter.hxx>
#include <Standard_Real.hxx>
#include <Standard_ShortReal.hxx>
class Storage_StreamTypeMismatchError;
class Storage_StreamFormatError;
class Storage_StreamWriteError;
class Storage_StreamExtCharParityError;
class TCollection_AsciiString;
class TCollection_ExtendedString;
//! Root class for drivers. A driver assigns a physical container
//! to data to be stored or retrieved, for instance a file.
//! The FSD package provides two derived concrete classes :
//! - FSD_File is a general driver which defines a
//! file as the container of data.
class Storage_BaseDriver
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT void Delete();
Standard_EXPORT virtual ~Storage_BaseDriver(){Delete();}
Standard_EXPORT virtual Storage_Error Open (const TCollection_AsciiString& aName, const Storage_OpenMode aMode) = 0;
TCollection_AsciiString Name() const;
Storage_OpenMode OpenMode() const;
//! returns True if we are at end of the stream
Standard_EXPORT virtual Standard_Boolean IsEnd() = 0;
//! return position in the file. Return -1 upon error.
Standard_EXPORT virtual Storage_Position Tell() = 0;
Standard_EXPORT virtual Storage_Error BeginWriteInfoSection() = 0;
Standard_EXPORT virtual void WriteInfo (const Standard_Integer nbObj, const TCollection_AsciiString& dbVersion, const TCollection_AsciiString& date, const TCollection_AsciiString& schemaName, const TCollection_AsciiString& schemaVersion, const TCollection_ExtendedString& appName, const TCollection_AsciiString& appVersion, const TCollection_ExtendedString& objectType, const TColStd_SequenceOfAsciiString& userInfo) = 0;
Standard_EXPORT virtual Storage_Error EndWriteInfoSection() = 0;
Standard_EXPORT virtual Storage_Error BeginReadInfoSection() = 0;
Standard_EXPORT virtual void ReadInfo (Standard_Integer& nbObj, TCollection_AsciiString& dbVersion, TCollection_AsciiString& date, TCollection_AsciiString& schemaName, TCollection_AsciiString& schemaVersion, TCollection_ExtendedString& appName, TCollection_AsciiString& appVersion, TCollection_ExtendedString& objectType, TColStd_SequenceOfAsciiString& userInfo) = 0;
Standard_EXPORT virtual Storage_Error EndReadInfoSection() = 0;
Standard_EXPORT virtual Storage_Error BeginWriteCommentSection() = 0;
Standard_EXPORT virtual void WriteComment (const TColStd_SequenceOfExtendedString& userComments) = 0;
Standard_EXPORT virtual Storage_Error EndWriteCommentSection() = 0;
Standard_EXPORT virtual Storage_Error BeginReadCommentSection() = 0;
Standard_EXPORT virtual void ReadComment (TColStd_SequenceOfExtendedString& userComments) = 0;
Standard_EXPORT virtual Storage_Error EndReadCommentSection() = 0;
Standard_EXPORT virtual Storage_Error BeginWriteTypeSection() = 0;
Standard_EXPORT virtual void SetTypeSectionSize (const Standard_Integer aSize) = 0;
Standard_EXPORT virtual void WriteTypeInformations (const Standard_Integer typeNum, const TCollection_AsciiString& typeName) = 0;
Standard_EXPORT virtual Storage_Error EndWriteTypeSection() = 0;
Standard_EXPORT virtual Storage_Error BeginReadTypeSection() = 0;
Standard_EXPORT virtual Standard_Integer TypeSectionSize() = 0;
Standard_EXPORT virtual void ReadTypeInformations (Standard_Integer& typeNum, TCollection_AsciiString& typeName) = 0;
Standard_EXPORT virtual Storage_Error EndReadTypeSection() = 0;
Standard_EXPORT virtual Storage_Error BeginWriteRootSection() = 0;
Standard_EXPORT virtual void SetRootSectionSize (const Standard_Integer aSize) = 0;
Standard_EXPORT virtual void WriteRoot (const TCollection_AsciiString& rootName, const Standard_Integer aRef, const TCollection_AsciiString& aType) = 0;
Standard_EXPORT virtual Storage_Error EndWriteRootSection() = 0;
Standard_EXPORT virtual Storage_Error BeginReadRootSection() = 0;
Standard_EXPORT virtual Standard_Integer RootSectionSize() = 0;
Standard_EXPORT virtual void ReadRoot (TCollection_AsciiString& rootName, Standard_Integer& aRef, TCollection_AsciiString& aType) = 0;
Standard_EXPORT virtual Storage_Error EndReadRootSection() = 0;
Standard_EXPORT virtual Storage_Error BeginWriteRefSection() = 0;
Standard_EXPORT virtual void SetRefSectionSize (const Standard_Integer aSize) = 0;
Standard_EXPORT virtual void WriteReferenceType (const Standard_Integer reference, const Standard_Integer typeNum) = 0;
Standard_EXPORT virtual Storage_Error EndWriteRefSection() = 0;
Standard_EXPORT virtual Storage_Error BeginReadRefSection() = 0;
Standard_EXPORT virtual Standard_Integer RefSectionSize() = 0;
Standard_EXPORT virtual void ReadReferenceType (Standard_Integer& reference, Standard_Integer& typeNum) = 0;
Standard_EXPORT virtual Storage_Error EndReadRefSection() = 0;
Standard_EXPORT virtual Storage_Error BeginWriteDataSection() = 0;
Standard_EXPORT virtual void WritePersistentObjectHeader (const Standard_Integer aRef, const Standard_Integer aType) = 0;
Standard_EXPORT virtual void BeginWritePersistentObjectData() = 0;
Standard_EXPORT virtual void BeginWriteObjectData() = 0;
Standard_EXPORT virtual void EndWriteObjectData() = 0;
Standard_EXPORT virtual void EndWritePersistentObjectData() = 0;
Standard_EXPORT virtual Storage_Error EndWriteDataSection() = 0;
Standard_EXPORT virtual Storage_Error BeginReadDataSection() = 0;
Standard_EXPORT virtual void ReadPersistentObjectHeader (Standard_Integer& aRef, Standard_Integer& aType) = 0;
Standard_EXPORT virtual void BeginReadPersistentObjectData() = 0;
Standard_EXPORT virtual void BeginReadObjectData() = 0;
Standard_EXPORT virtual void EndReadObjectData() = 0;
Standard_EXPORT virtual void EndReadPersistentObjectData() = 0;
Standard_EXPORT virtual Storage_Error EndReadDataSection() = 0;
Standard_EXPORT virtual void SkipObject() = 0;
Standard_EXPORT virtual Storage_BaseDriver& PutReference (const Standard_Integer aValue) = 0;
Standard_EXPORT virtual Storage_BaseDriver& PutCharacter (const Standard_Character aValue) = 0;
Storage_BaseDriver& operator << (const Standard_Character aValue)
{
return PutCharacter(aValue);
}
Standard_EXPORT virtual Storage_BaseDriver& PutExtCharacter (const Standard_ExtCharacter aValue) = 0;
Storage_BaseDriver& operator << (const Standard_ExtCharacter aValue)
{
return PutExtCharacter(aValue);
}
Standard_EXPORT virtual Storage_BaseDriver& PutInteger (const Standard_Integer aValue) = 0;
Storage_BaseDriver& operator << (const Standard_Integer aValue)
{
return PutInteger(aValue);
}
Standard_EXPORT virtual Storage_BaseDriver& PutBoolean (const Standard_Boolean aValue) = 0;
Storage_BaseDriver& operator << (const Standard_Boolean aValue)
{
return PutBoolean(aValue);
}
Standard_EXPORT virtual Storage_BaseDriver& PutReal (const Standard_Real aValue) = 0;
Storage_BaseDriver& operator << (const Standard_Real aValue)
{
return PutReal(aValue);
}
Standard_EXPORT virtual Storage_BaseDriver& PutShortReal (const Standard_ShortReal aValue) = 0;
Storage_BaseDriver& operator << (const Standard_ShortReal aValue)
{
return PutShortReal(aValue);
}
Standard_EXPORT virtual Storage_BaseDriver& GetReference (Standard_Integer& aValue) = 0;
Standard_EXPORT virtual Storage_BaseDriver& GetCharacter (Standard_Character& aValue) = 0;
Storage_BaseDriver& operator >> (Standard_Character& aValue)
{
return GetCharacter(aValue);
}
Standard_EXPORT virtual Storage_BaseDriver& GetExtCharacter (Standard_ExtCharacter& aValue) = 0;
Storage_BaseDriver& operator >> (Standard_ExtCharacter& aValue)
{
return GetExtCharacter(aValue);
}
Standard_EXPORT virtual Storage_BaseDriver& GetInteger (Standard_Integer& aValue) = 0;
Storage_BaseDriver& operator >> (Standard_Integer& aValue)
{
return GetInteger(aValue);
}
Standard_EXPORT virtual Storage_BaseDriver& GetBoolean (Standard_Boolean& aValue) = 0;
Storage_BaseDriver& operator >> (Standard_Boolean& aValue)
{
return GetBoolean(aValue);
}
Standard_EXPORT virtual Storage_BaseDriver& GetReal (Standard_Real& aValue) = 0;
Storage_BaseDriver& operator >> (Standard_Real& aValue)
{
return GetReal(aValue);
}
Standard_EXPORT virtual Storage_BaseDriver& GetShortReal (Standard_ShortReal& aValue) = 0;
Storage_BaseDriver& operator >> (Standard_ShortReal& aValue)
{
return GetShortReal(aValue);
}
Standard_EXPORT virtual Storage_Error Close() = 0;
protected:
Standard_EXPORT Storage_BaseDriver();
void SetName (const TCollection_AsciiString& aName);
void SetOpenMode (const Storage_OpenMode aMode);
private:
Storage_OpenMode myOpenMode;
TCollection_AsciiString myName;
};
#include <Storage_BaseDriver.lxx>
#endif // _Storage_BaseDriver_HeaderFile

View File

@@ -1,33 +0,0 @@
-- Created on: 1997-02-27
-- Created by: Christophe LEYNADIER
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
deferred class CallBack from Storage
inherits TShared from MMgt
uses Schema from Storage,
BaseDriver from Storage
is
New(me) returns Persistent is deferred;
Add(me; aPers : Persistent from Standard; aSchema : Schema from Storage) is deferred;
Write(me; aPers : Persistent from Standard; aDriver : in out BaseDriver from Storage; aSchema : Schema from Storage) is deferred;
Read(me; aPers : Persistent from Standard; aDriver : in out BaseDriver from Storage; aSchema : Schema from Storage) is deferred;
end;

View File

@@ -12,4 +12,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Storage_CallBack.ixx>
#include <Standard_Persistent.hxx>
#include <Standard_Type.hxx>
#include <Storage_BaseDriver.hxx>
#include <Storage_CallBack.hxx>
#include <Storage_Schema.hxx>

View File

@@ -0,0 +1,70 @@
// Created on: 1997-02-27
// Created by: Christophe LEYNADIER
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Storage_CallBack_HeaderFile
#define _Storage_CallBack_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <MMgt_TShared.hxx>
class Standard_Persistent;
class Storage_Schema;
class Storage_BaseDriver;
class Storage_CallBack;
DEFINE_STANDARD_HANDLE(Storage_CallBack, MMgt_TShared)
class Storage_CallBack : public MMgt_TShared
{
public:
Standard_EXPORT virtual Handle(Standard_Persistent) New() const = 0;
Standard_EXPORT virtual void Add (const Handle(Standard_Persistent)& aPers, const Handle(Storage_Schema)& aSchema) const = 0;
Standard_EXPORT virtual void Write (const Handle(Standard_Persistent)& aPers, Storage_BaseDriver& aDriver, const Handle(Storage_Schema)& aSchema) const = 0;
Standard_EXPORT virtual void Read (const Handle(Standard_Persistent)& aPers, Storage_BaseDriver& aDriver, const Handle(Storage_Schema)& aSchema) const = 0;
DEFINE_STANDARD_RTTI(Storage_CallBack,MMgt_TShared)
protected:
private:
};
#endif // _Storage_CallBack_HeaderFile

View File

@@ -1,239 +0,0 @@
-- Created on: 1997-02-06
-- Created by: Kernel
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class Data from Storage
inherits TShared from MMgt
--- Purpose: 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
uses TypeData from Storage,
RootData from Storage,
Root from Storage,
InternalData from Storage,
HSeqOfRoot from Storage,
AsciiString from TCollection,
HSequenceOfAsciiString from TColStd,
SequenceOfAsciiString from TColStd,
HeaderData from Storage,
Error from Storage,
ExtendedString from TCollection,
SequenceOfExtendedString from TColStd
is
Create returns Data from Storage;
---Purpose:
-- 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.
ErrorStatus(me) returns Error from Storage;
---Purpose: 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
ClearErrorStatus(me : mutable);
---Purpose:
-- 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.
ErrorStatusExtension(me) returns AsciiString from TCollection;
-- HEADER
CreationDate(me) returns AsciiString from TCollection;
---Purpose: return the creation date
StorageVersion(me) returns AsciiString from TCollection;
---Purpose: return the Storage package version
SchemaVersion(me) returns AsciiString from TCollection;
---Purpose: get the version of the schema
SchemaName(me) returns AsciiString from TCollection;
---Purpose: get the schema's name
SetApplicationVersion(me : mutable; aVersion : AsciiString from TCollection);
---Purpose: set the version of the application
ApplicationVersion(me) returns AsciiString from TCollection;
---Purpose: get the version of the application
SetApplicationName(me : mutable; aName : ExtendedString from TCollection);
---Purpose: set the name of the application
ApplicationName(me) returns ExtendedString from TCollection;
---Purpose: get the name of the application
SetDataType(me : mutable; aType : ExtendedString from TCollection);
---Purpose: set the data type
DataType(me) returns ExtendedString from TCollection;
---Purpose: returns data type
AddToUserInfo(me : mutable; anInfo : AsciiString from TCollection);
---Purpose: add <theUserInfo> to the user informations
UserInfo(me) returns SequenceOfAsciiString from TColStd;
---Purpose: return the user informations
---C++: return const &
AddToComments(me : mutable; aComment : ExtendedString from TCollection);
---Purpose: add <theUserInfo> to the user informations
Comments(me) returns SequenceOfExtendedString from TColStd;
---Purpose: return the user informations
---C++: return const &
NumberOfObjects(me) returns Integer;
---Purpose: the the number of persistent objects
-- Return:
-- the number of persistent objects readed
-- ROOTS
NumberOfRoots(me) returns Integer from Standard;
---Purpose: 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(me; anObject : Persistent from Standard);
---Purpose: add a persistent root to write. the name of the root
-- is a driver reference number.
AddRoot(me; aName : AsciiString from TCollection; anObject : Persistent from Standard);
---Purpose: 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.
RemoveRoot(me : mutable; aName : AsciiString from TCollection);
---Purpose: 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.
Roots(me) returns HSeqOfRoot from Storage;
---Purpose: 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(me; aName : AsciiString from TCollection) returns Root from Storage;
---Purpose: 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.
IsRoot(me; aName : AsciiString from TCollection) returns Boolean from Standard;
---Purpose: returns Standard_True if <me> contains a root named <aName>
-- TYPES
NumberOfTypes(me) returns Integer from Standard;
---Purpose: Returns the number of types of objects used in this set of data.
IsType(me; aName : AsciiString from TCollection) returns Boolean from Standard;
---Purpose: 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.
Types(me) returns HSequenceOfAsciiString from TColStd;
---Purpose:
-- Gives the list of types of objects used in this set of data in a sequence.
-- PRIVATE
HeaderData(me) returns HeaderData from Storage is private;
RootData(me) returns RootData from Storage is private;
TypeData(me) returns TypeData from Storage is private;
InternalData(me) returns InternalData from Storage is private;
Clear(me) is private;
SetErrorStatus(me : mutable; anError : Error from Storage) is private;
SetErrorStatusExtension(me : mutable; anErrorExt : AsciiString from TCollection) is private;
fields
myHeaderData : HeaderData from Storage;
myRootData : RootData from Storage;
myTypeData : TypeData from Storage;
myInternal : InternalData from Storage;
myErrorStatus : Error from Storage;
myErrorStatusExt : AsciiString from TCollection;
friends class Schema from Storage
end;

View File

@@ -12,8 +12,18 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Storage_Data.ixx>
#include <Standard_Persistent.hxx>
#include <Standard_Type.hxx>
#include <Storage_Data.hxx>
#include <Storage_HeaderData.hxx>
#include <Storage_InternalData.hxx>
#include <Storage_Root.hxx>
#include <Storage_RootData.hxx>
#include <Storage_Schema.hxx>
#include <Storage_TypeData.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
Storage_Data::Storage_Data()
{

View File

@@ -0,0 +1,271 @@
// Created on: 1997-02-06
// Created by: Kernel
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Storage_Data_HeaderFile
#define _Storage_Data_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Storage_Error.hxx>
#include <TCollection_AsciiString.hxx>
#include <MMgt_TShared.hxx>
#include <TColStd_SequenceOfAsciiString.hxx>
#include <TColStd_SequenceOfExtendedString.hxx>
#include <Standard_Integer.hxx>
#include <Storage_HSeqOfRoot.hxx>
#include <Standard_Boolean.hxx>
#include <TColStd_HSequenceOfAsciiString.hxx>
class Storage_HeaderData;
class Storage_RootData;
class Storage_TypeData;
class Storage_InternalData;
class Storage_Schema;
class TCollection_AsciiString;
class TCollection_ExtendedString;
class Standard_Persistent;
class Storage_Root;
class Storage_Data;
DEFINE_STANDARD_HANDLE(Storage_Data, MMgt_TShared)
//! 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
class Storage_Data : public MMgt_TShared
{
public:
//! 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_Data();
//! 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 Storage_Error ErrorStatus() const;
//! 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 void ClearErrorStatus();
Standard_EXPORT TCollection_AsciiString ErrorStatusExtension() const;
//! return the creation date
Standard_EXPORT TCollection_AsciiString CreationDate() const;
//! return the Storage package version
Standard_EXPORT TCollection_AsciiString StorageVersion() const;
//! get the version of the schema
Standard_EXPORT TCollection_AsciiString SchemaVersion() const;
//! get the schema's name
Standard_EXPORT TCollection_AsciiString SchemaName() const;
//! set the version of the application
Standard_EXPORT void SetApplicationVersion (const TCollection_AsciiString& aVersion);
//! get the version of the application
Standard_EXPORT TCollection_AsciiString ApplicationVersion() const;
//! set the name of the application
Standard_EXPORT void SetApplicationName (const TCollection_ExtendedString& aName);
//! get the name of the application
Standard_EXPORT TCollection_ExtendedString ApplicationName() const;
//! set the data type
Standard_EXPORT void SetDataType (const TCollection_ExtendedString& aType);
//! returns data type
Standard_EXPORT TCollection_ExtendedString DataType() const;
//! add <theUserInfo> to the user informations
Standard_EXPORT void AddToUserInfo (const TCollection_AsciiString& anInfo);
//! return the user informations
Standard_EXPORT const TColStd_SequenceOfAsciiString& UserInfo() const;
//! add <theUserInfo> to the user informations
Standard_EXPORT void AddToComments (const TCollection_ExtendedString& aComment);
//! return the user informations
Standard_EXPORT const TColStd_SequenceOfExtendedString& Comments() const;
//! the the number of persistent objects
//! Return:
//! the number of persistent objects readed
Standard_EXPORT Standard_Integer NumberOfObjects() 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 Standard_Integer NumberOfRoots() const;
//! add a persistent root to write. the name of the root
//! is a driver reference number.
Standard_EXPORT void AddRoot (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 AddRoot (const TCollection_AsciiString& aName, const Handle(Standard_Persistent)& anObject) const;
//! 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 void RemoveRoot (const TCollection_AsciiString& 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.
Standard_EXPORT Handle(Storage_HSeqOfRoot) Roots() 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 Handle(Storage_Root) Find (const TCollection_AsciiString& aName) const;
//! returns Standard_True if <me> contains a root named <aName>
Standard_EXPORT Standard_Boolean IsRoot (const TCollection_AsciiString& aName) const;
//! Returns the number of types of objects used in this set of data.
Standard_EXPORT Standard_Integer NumberOfTypes() 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 Standard_Boolean IsType (const TCollection_AsciiString& aName) const;
//! Gives the list of types of objects used in this set of data in a sequence.
Standard_EXPORT Handle(TColStd_HSequenceOfAsciiString) Types() const;
friend class Storage_Schema;
DEFINE_STANDARD_RTTI(Storage_Data,MMgt_TShared)
protected:
private:
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);
Handle(Storage_HeaderData) myHeaderData;
Handle(Storage_RootData) myRootData;
Handle(Storage_TypeData) myTypeData;
Handle(Storage_InternalData) myInternal;
Storage_Error myErrorStatus;
TCollection_AsciiString myErrorStatusExt;
};
#endif // _Storage_Data_HeaderFile

View File

@@ -1,35 +0,0 @@
-- Created on: 1997-03-03
-- Created by: Christophe LEYNADIER
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class DefaultCallBack from Storage
inherits CallBack from Storage
uses Schema from Storage,
BaseDriver from Storage
is
Create returns DefaultCallBack from Storage;
New(me) returns Persistent;
Add(me; aPers : Persistent from Standard; aSchema : Schema from Storage);
Write(me; aPers : Persistent from Standard; aDriver : in out BaseDriver from Storage; aSchema : Schema from Storage);
Read(me; aPers : Persistent from Standard; aDriver : in out BaseDriver from Storage; aSchema : Schema from Storage);
end;

View File

@@ -12,7 +12,12 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Storage_DefaultCallBack.ixx>
#include <Standard_Persistent.hxx>
#include <Standard_Type.hxx>
#include <Storage_BaseDriver.hxx>
#include <Storage_DefaultCallBack.hxx>
#include <Storage_Schema.hxx>
Storage_DefaultCallBack::Storage_DefaultCallBack()
{

View File

@@ -0,0 +1,72 @@
// Created on: 1997-03-03
// Created by: Christophe LEYNADIER
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Storage_DefaultCallBack_HeaderFile
#define _Storage_DefaultCallBack_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Storage_CallBack.hxx>
class Standard_Persistent;
class Storage_Schema;
class Storage_BaseDriver;
class Storage_DefaultCallBack;
DEFINE_STANDARD_HANDLE(Storage_DefaultCallBack, Storage_CallBack)
class Storage_DefaultCallBack : public Storage_CallBack
{
public:
Standard_EXPORT Storage_DefaultCallBack();
Standard_EXPORT Handle(Standard_Persistent) New() const;
Standard_EXPORT void Add (const Handle(Standard_Persistent)& aPers, const Handle(Storage_Schema)& aSchema) const;
Standard_EXPORT void Write (const Handle(Standard_Persistent)& aPers, Storage_BaseDriver& aDriver, const Handle(Storage_Schema)& aSchema) const;
Standard_EXPORT void Read (const Handle(Standard_Persistent)& aPers, Storage_BaseDriver& aDriver, const Handle(Storage_Schema)& aSchema) const;
DEFINE_STANDARD_RTTI(Storage_DefaultCallBack,Storage_CallBack)
protected:
private:
};
#endif // _Storage_DefaultCallBack_HeaderFile

View File

@@ -0,0 +1,59 @@
// Created on: 1996-04-30
// Created by: cle
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Storage_Error_HeaderFile
#define _Storage_Error_HeaderFile
//! Error codes returned by the ErrorStatus
//! function on a Storage_Data set of data during a
//! storage or retrieval operation :
//! - Storage_VSOk : no problem has been detected
//! - Storage_VSOpenError : an error has
//! occurred when opening the driver
//! - Storage_VSModeError : the driver has not
//! been opened in the correct mode
//! - Storage_VSCloseError : an error has
//! occurred when closing the driver
//! - Storage_VSAlreadyOpen : the driver is already open
//! - Storage_VSNotOpen : the driver is not open
//! - Storage_VSSectionNotFound : a section
//! has not been found in the driver
//! - Storage_VSWriteError : an error occurred when writing the driver
//! - Storage_VSFormatError : the file format is wrong
//! - Storage_VSUnknownType : a type is not known from the schema
//! - Storage_VSTypeMismatch : trying to read a wrong type
//! - Storage_VSInternalError : an internal error has been detected
//! - Storage_VSExtCharParityError : an error
//! has occurred while reading 16 bit characte
enum Storage_Error
{
Storage_VSOk,
Storage_VSOpenError,
Storage_VSModeError,
Storage_VSCloseError,
Storage_VSAlreadyOpen,
Storage_VSNotOpen,
Storage_VSSectionNotFound,
Storage_VSWriteError,
Storage_VSFormatError,
Storage_VSUnknownType,
Storage_VSTypeMismatch,
Storage_VSInternalError,
Storage_VSExtCharParityError,
Storage_VSWrongFileDriver
};
#endif // _Storage_Error_HeaderFile

View File

@@ -1,113 +0,0 @@
-- Created on: 1997-02-06
-- Created by: Kernel
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class HeaderData from Storage
inherits TShared from MMgt
uses AsciiString from TCollection,
SequenceOfAsciiString from TColStd,
Error from Storage,
ExtendedString from TCollection,
SequenceOfExtendedString from TColStd
is
Create returns HeaderData from Storage;
CreationDate(me) returns AsciiString from TCollection;
---Purpose: return the creation date
StorageVersion(me) returns AsciiString from TCollection;
---Purpose: return the Storage package version
SchemaVersion(me) returns AsciiString from TCollection;
---Purpose: get the version of the schema
SchemaName(me) returns AsciiString from TCollection;
---Purpose: get the schema's name
SetApplicationVersion(me : mutable; aVersion : AsciiString from TCollection);
---Purpose: set the version of the application
ApplicationVersion(me) returns AsciiString from TCollection;
---Purpose: get the version of the application
SetApplicationName(me : mutable; aName : ExtendedString from TCollection);
---Purpose: set the name of the application
ApplicationName(me) returns ExtendedString from TCollection;
---Purpose: get the name of the application
SetDataType(me : mutable; aType : ExtendedString from TCollection);
---Purpose: set the data type
DataType(me) returns ExtendedString from TCollection;
---Purpose: returns data type
AddToUserInfo(me : mutable; theUserInfo : AsciiString from TCollection);
---Purpose: add <theUserInfo> to the user informations
UserInfo(me) returns SequenceOfAsciiString from TColStd;
---Purpose: return the user informations
---C++: return const &
AddToComments(me : mutable; aComment : ExtendedString from TCollection);
---Purpose: add <theUserInfo> to the user informations
Comments(me) returns SequenceOfExtendedString from TColStd;
---Purpose: return the user informations
---C++: return const &
NumberOfObjects(me) returns Integer;
---Purpose: the the number of persistent objects
-- Return:
-- the number of persistent objects readed
ErrorStatus(me) returns Error from Storage;
ErrorStatusExtension(me) returns AsciiString from TCollection;
ClearErrorStatus(me : mutable);
-- PRIVATE
SetNumberOfObjects(me : mutable; anObjectNumber : Integer from Standard) is private;
SetStorageVersion(me : mutable; aVersion : AsciiString from TCollection) is private;
SetCreationDate(me : mutable; aDate : AsciiString from TCollection) is private;
SetSchemaVersion(me : mutable; aVersion : AsciiString from TCollection) is private;
SetSchemaName(me : mutable; aName : AsciiString from TCollection) is private;
SetErrorStatus(me : mutable; anError : Error from Storage) is private;
SetErrorStatusExtension(me : mutable; anErrorExt : AsciiString from TCollection) is private;
fields
myNBObj : Integer from Standard;
myStorageVersion : AsciiString from TCollection;
mySchemaVersion : AsciiString from TCollection;
mySchemaName : AsciiString from TCollection;
myApplicationVersion : AsciiString from TCollection;
myApplicationName : ExtendedString from TCollection;
myDataType : ExtendedString from TCollection;
myDate : AsciiString from TCollection;
myUserInfo : SequenceOfAsciiString from TColStd;
myComments : SequenceOfExtendedString from TColStd;
myErrorStatus : Error from Storage;
myErrorStatusExt : AsciiString from TCollection;
friends class Schema from Storage
end;

View File

@@ -12,7 +12,12 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Storage_HeaderData.ixx>
#include <Standard_Type.hxx>
#include <Storage_HeaderData.hxx>
#include <Storage_Schema.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
Storage_HeaderData::Storage_HeaderData() : myNBObj(0), myErrorStatus(Storage_VSOk)
{

View File

@@ -0,0 +1,150 @@
// Created on: 1997-02-06
// Created by: Kernel
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Storage_HeaderData_HeaderFile
#define _Storage_HeaderData_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Integer.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TColStd_SequenceOfAsciiString.hxx>
#include <TColStd_SequenceOfExtendedString.hxx>
#include <Storage_Error.hxx>
#include <MMgt_TShared.hxx>
class Storage_Schema;
class TCollection_AsciiString;
class TCollection_ExtendedString;
class Storage_HeaderData;
DEFINE_STANDARD_HANDLE(Storage_HeaderData, MMgt_TShared)
class Storage_HeaderData : public MMgt_TShared
{
public:
Standard_EXPORT Storage_HeaderData();
//! return the creation date
Standard_EXPORT TCollection_AsciiString CreationDate() const;
//! return the Storage package version
Standard_EXPORT TCollection_AsciiString StorageVersion() const;
//! get the version of the schema
Standard_EXPORT TCollection_AsciiString SchemaVersion() const;
//! get the schema's name
Standard_EXPORT TCollection_AsciiString SchemaName() const;
//! set the version of the application
Standard_EXPORT void SetApplicationVersion (const TCollection_AsciiString& aVersion);
//! get the version of the application
Standard_EXPORT TCollection_AsciiString ApplicationVersion() const;
//! set the name of the application
Standard_EXPORT void SetApplicationName (const TCollection_ExtendedString& aName);
//! get the name of the application
Standard_EXPORT TCollection_ExtendedString ApplicationName() const;
//! set the data type
Standard_EXPORT void SetDataType (const TCollection_ExtendedString& aType);
//! returns data type
Standard_EXPORT TCollection_ExtendedString DataType() const;
//! add <theUserInfo> to the user informations
Standard_EXPORT void AddToUserInfo (const TCollection_AsciiString& theUserInfo);
//! return the user informations
Standard_EXPORT const TColStd_SequenceOfAsciiString& UserInfo() const;
//! add <theUserInfo> to the user informations
Standard_EXPORT void AddToComments (const TCollection_ExtendedString& aComment);
//! return the user informations
Standard_EXPORT const TColStd_SequenceOfExtendedString& Comments() const;
//! the the number of persistent objects
//! Return:
//! the number of persistent objects readed
Standard_EXPORT Standard_Integer NumberOfObjects() const;
Standard_EXPORT Storage_Error ErrorStatus() const;
Standard_EXPORT TCollection_AsciiString ErrorStatusExtension() const;
Standard_EXPORT void ClearErrorStatus();
friend class Storage_Schema;
DEFINE_STANDARD_RTTI(Storage_HeaderData,MMgt_TShared)
protected:
private:
Standard_EXPORT void SetNumberOfObjects (const Standard_Integer anObjectNumber);
Standard_EXPORT void SetStorageVersion (const TCollection_AsciiString& aVersion);
Standard_EXPORT void SetCreationDate (const TCollection_AsciiString& aDate);
Standard_EXPORT void SetSchemaVersion (const TCollection_AsciiString& aVersion);
Standard_EXPORT void SetSchemaName (const TCollection_AsciiString& aName);
Standard_EXPORT void SetErrorStatus (const Storage_Error anError);
Standard_EXPORT void SetErrorStatusExtension (const TCollection_AsciiString& anErrorExt);
Standard_Integer myNBObj;
TCollection_AsciiString myStorageVersion;
TCollection_AsciiString mySchemaVersion;
TCollection_AsciiString mySchemaName;
TCollection_AsciiString myApplicationVersion;
TCollection_ExtendedString myApplicationName;
TCollection_ExtendedString myDataType;
TCollection_AsciiString myDate;
TColStd_SequenceOfAsciiString myUserInfo;
TColStd_SequenceOfExtendedString myComments;
Storage_Error myErrorStatus;
TCollection_AsciiString myErrorStatusExt;
};
#endif // _Storage_HeaderData_HeaderFile

View File

@@ -1,39 +0,0 @@
-- Created on: 1997-02-06
-- Created by: Kernel
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
private class InternalData from Storage
inherits TShared from MMgt
uses BucketOfPersistent from Storage,
HPArray from Storage,
MapOfCallBack from Storage
is
Create returns InternalData from Storage;
Clear(me : mutable);
fields
myPtoA : BucketOfPersistent from Storage;
myObjId : Integer from Standard;
myTypeId : Integer from Standard;
myReadArray : HPArray from Storage;
myTypeBinding : MapOfCallBack from Storage;
friends class Schema from Storage
end;

View File

@@ -12,7 +12,10 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Storage_InternalData.ixx>
#include <Standard_Type.hxx>
#include <Storage_InternalData.hxx>
#include <Storage_Schema.hxx>
Storage_InternalData::Storage_InternalData() : myObjId(1), myTypeId(1)
{

View File

@@ -0,0 +1,74 @@
// Created on: 1997-02-06
// Created by: Kernel
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Storage_InternalData_HeaderFile
#define _Storage_InternalData_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Storage_BucketOfPersistent.hxx>
#include <Standard_Integer.hxx>
#include <Storage_HPArray.hxx>
#include <Storage_MapOfCallBack.hxx>
#include <MMgt_TShared.hxx>
class Storage_Schema;
class Storage_InternalData;
DEFINE_STANDARD_HANDLE(Storage_InternalData, MMgt_TShared)
class Storage_InternalData : public MMgt_TShared
{
public:
Standard_EXPORT Storage_InternalData();
Standard_EXPORT void Clear();
friend class Storage_Schema;
DEFINE_STANDARD_RTTI(Storage_InternalData,MMgt_TShared)
protected:
private:
Storage_BucketOfPersistent myPtoA;
Standard_Integer myObjId;
Standard_Integer myTypeId;
Handle(Storage_HPArray) myReadArray;
Storage_MapOfCallBack myTypeBinding;
};
#endif // _Storage_InternalData_HeaderFile

View File

@@ -0,0 +1,35 @@
// Created on: 1996-04-30
// Created by: cle
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Storage_OpenMode_HeaderFile
#define _Storage_OpenMode_HeaderFile
//! Specifies opening modes for a file:
//! - Storage_VSNone : no mode is specified
//! - Storage_VSRead : the file is open for reading operations
//! - Storage_VSWrite : the file is open for writing operations
//! - Storage_VSReadWrite : the file is open
//! for both reading and writing operations.
enum Storage_OpenMode
{
Storage_VSNone,
Storage_VSRead,
Storage_VSWrite,
Storage_VSReadWrite
};
#endif // _Storage_OpenMode_HeaderFile

View File

@@ -1,80 +0,0 @@
-- Created on: 1997-02-24
-- Created by: Kernel
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class Root from Storage
inherits TShared from MMgt
---Purpose:
-- 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.
uses AsciiString from TCollection
is
Create returns Root from Storage;
Create(aName : AsciiString from TCollection;
anObject : Persistent from Standard) returns Root from Storage;
SetName(me : mutable; aName : AsciiString from TCollection);
Name(me) returns AsciiString from TCollection;
---Purpose:
-- Returns the name of this root object.
-- The name may have been given explicitly when
-- the root was inserted into the Storage_Data
-- object. 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(me : mutable; anObject : Persistent from Standard);
Object(me) returns Persistent from Standard;
---Purpose:
-- Returns the persistent object encapsulated by this root.
Type(me) returns AsciiString from TCollection;
---Purpose: Returns the name of this root type.
SetReference(me : mutable; aRef : Integer from Standard) is private;
Reference(me) returns Integer from Standard is private;
SetType(me : mutable; aType : AsciiString from TCollection) is private;
fields
myName : AsciiString from TCollection;
myType : AsciiString from TCollection;
myObject : Persistent from Standard;
myRef : Integer from Standard;
friends class Schema from Storage
end;

View File

@@ -12,7 +12,12 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Storage_Root.ixx>
#include <Standard_Persistent.hxx>
#include <Standard_Type.hxx>
#include <Storage_Root.hxx>
#include <Storage_Schema.hxx>
#include <TCollection_AsciiString.hxx>
Storage_Root::Storage_Root() : myRef(0)
{

View File

@@ -0,0 +1,120 @@
// Created on: 1997-02-24
// Created by: Kernel
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Storage_Root_HeaderFile
#define _Storage_Root_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TCollection_AsciiString.hxx>
#include <Standard_Integer.hxx>
#include <MMgt_TShared.hxx>
class Standard_Persistent;
class Storage_Schema;
class TCollection_AsciiString;
class Storage_Root;
DEFINE_STANDARD_HANDLE(Storage_Root, MMgt_TShared)
//! 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.
class Storage_Root : public MMgt_TShared
{
public:
Standard_EXPORT Storage_Root();
Standard_EXPORT Storage_Root(const TCollection_AsciiString& aName, const Handle(Standard_Persistent)& anObject);
Standard_EXPORT void SetName (const TCollection_AsciiString& aName);
//! Returns the name of this root object.
//! The name may have been given explicitly when
//! the root was inserted into the Storage_Data
//! object. 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.
Standard_EXPORT TCollection_AsciiString Name() const;
Standard_EXPORT void SetObject (const Handle(Standard_Persistent)& anObject);
//! Returns the persistent object encapsulated by this root.
Standard_EXPORT Handle(Standard_Persistent) Object() const;
//! Returns the name of this root type.
Standard_EXPORT TCollection_AsciiString Type() const;
friend class Storage_Schema;
DEFINE_STANDARD_RTTI(Storage_Root,MMgt_TShared)
protected:
private:
Standard_EXPORT void SetReference (const Standard_Integer aRef);
Standard_EXPORT Standard_Integer Reference() const;
Standard_EXPORT void SetType (const TCollection_AsciiString& aType);
TCollection_AsciiString myName;
TCollection_AsciiString myType;
Handle(Standard_Persistent) myObject;
Standard_Integer myRef;
};
#endif // _Storage_Root_HeaderFile

View File

@@ -1,74 +0,0 @@
-- Created on: 1997-02-06
-- Created by: Kernel
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class RootData from Storage
inherits TShared from MMgt
uses SequenceOfAsciiString from TColStd,
AsciiString from TCollection,
MapOfPers from Storage,
HSeqOfRoot from Storage,
Error from Storage,
Root from Storage
raises NoSuchObject from Standard
is
Create returns RootData from Storage;
NumberOfRoots(me) returns Integer from Standard;
---Purpose: returns the number of roots.
AddRoot(me : mutable; aRoot : Root from Storage);
---Purpose: add a root to <me>. If a root with same name is present, it
-- will be replaced by <aRoot>.
Roots(me) returns HSeqOfRoot from Storage;
Find(me; aName : AsciiString from TCollection) returns Root from Storage;
---Purpose: find a root with name <aName>.
IsRoot(me; aName : AsciiString from TCollection) returns Boolean from Standard;
---Purpose: returns Standard_True if <me> contains a root named <aName>
RemoveRoot(me : mutable; aName : AsciiString from TCollection);
---Purpose: remove the root named <aName>.
ErrorStatus(me) returns Error from Storage;
ErrorStatusExtension(me) returns AsciiString from TCollection;
ClearErrorStatus(me : mutable);
-- PRIVATE
UpdateRoot(me : mutable; aName : AsciiString from TCollection; aPers : Persistent from Standard)
raises NoSuchObject
is private;
SetErrorStatus(me : mutable; anError : Error from Storage) is private;
SetErrorStatusExtension(me : mutable; anErrorExt : AsciiString from TCollection) is private;
fields
myObjects : MapOfPers from Storage;
myErrorStatus : Error from Storage;
myErrorStatusExt : AsciiString from TCollection;
friends class Schema from Storage
end;

View File

@@ -12,8 +12,15 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Storage_RootData.ixx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_Persistent.hxx>
#include <Standard_Type.hxx>
#include <Storage_DataMapIteratorOfMapOfPers.hxx>
#include <Storage_Root.hxx>
#include <Storage_RootData.hxx>
#include <Storage_Schema.hxx>
#include <TCollection_AsciiString.hxx>
Storage_RootData::Storage_RootData() : myErrorStatus(Storage_VSOk)
{

View File

@@ -0,0 +1,106 @@
// Created on: 1997-02-06
// Created by: Kernel
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Storage_RootData_HeaderFile
#define _Storage_RootData_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Storage_MapOfPers.hxx>
#include <Storage_Error.hxx>
#include <TCollection_AsciiString.hxx>
#include <MMgt_TShared.hxx>
#include <Standard_Integer.hxx>
#include <Storage_HSeqOfRoot.hxx>
#include <Standard_Boolean.hxx>
class Standard_NoSuchObject;
class Storage_Schema;
class Storage_Root;
class TCollection_AsciiString;
class Standard_Persistent;
class Storage_RootData;
DEFINE_STANDARD_HANDLE(Storage_RootData, MMgt_TShared)
class Storage_RootData : public MMgt_TShared
{
public:
Standard_EXPORT Storage_RootData();
//! returns the number of roots.
Standard_EXPORT Standard_Integer NumberOfRoots() const;
//! add a root to <me>. If a root with same name is present, it
//! will be replaced by <aRoot>.
Standard_EXPORT void AddRoot (const Handle(Storage_Root)& aRoot);
Standard_EXPORT Handle(Storage_HSeqOfRoot) Roots() const;
//! find a root with name <aName>.
Standard_EXPORT Handle(Storage_Root) Find (const TCollection_AsciiString& aName) const;
//! returns Standard_True if <me> contains a root named <aName>
Standard_EXPORT Standard_Boolean IsRoot (const TCollection_AsciiString& aName) const;
//! remove the root named <aName>.
Standard_EXPORT void RemoveRoot (const TCollection_AsciiString& aName);
Standard_EXPORT Storage_Error ErrorStatus() const;
Standard_EXPORT TCollection_AsciiString ErrorStatusExtension() const;
Standard_EXPORT void ClearErrorStatus();
friend class Storage_Schema;
DEFINE_STANDARD_RTTI(Storage_RootData,MMgt_TShared)
protected:
private:
Standard_EXPORT void UpdateRoot (const TCollection_AsciiString& aName, const Handle(Standard_Persistent)& aPers);
Standard_EXPORT void SetErrorStatus (const Storage_Error anError);
Standard_EXPORT void SetErrorStatusExtension (const TCollection_AsciiString& anErrorExt);
Storage_MapOfPers myObjects;
Storage_Error myErrorStatus;
TCollection_AsciiString myErrorStatusExt;
};
#endif // _Storage_RootData_HeaderFile

View File

@@ -1,310 +0,0 @@
-- Created on: 1996-12-03
-- Created by: Christophe LEYNADIER
-- Copyright (c) 1996-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class Schema from Storage inherits TShared from MMgt
---Purpose:
-- 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.
uses SequenceOfAsciiString from TColStd,
HSequenceOfAsciiString from TColStd,
AsciiString from TCollection,
BaseDriver from Storage,
Data from Storage,
HeaderData from Storage,
MapOfCallBack from Storage,
CallBack from Storage,
CallBack from Storage,
RootData from Storage,
TypeData from Storage,
HArrayOfSchema from Storage,
SolveMode from Storage
raises StreamFormatError from Storage
is
Create returns Schema from Storage;
---Purpose: 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:
-- Handle(ShapeSchema) s = new
-- ShapeSchema;
-- -------- --
-- USER API -- --------------------------------------------------------------
-- -------- --
SetVersion(me : mutable; aVersion : AsciiString from TCollection);
---Purpose: returns version of the schema
Version(me) returns AsciiString from TCollection;
---Purpose: returns the version of the schema
SetName(me : mutable; aSchemaName : AsciiString from TCollection);
---Purpose: set the schema's name
Name(me) returns AsciiString from TCollection;
---Purpose: returns the schema's name
Write(me; s : in out BaseDriver from Storage;
aData : Data from Storage);
---Purpose: Writes the data aggregated in aData into the
-- container defined by the driver s. 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.
Read(me; s : in out BaseDriver from Storage)
returns Data from Storage;
---Purpose: Returns the data read from the container defined
-- by the driver s. The retrieval operation is
-- performed according to the data schema with
-- which this algorithm is working.
-- These data are aggregated in a Storage_Data
-- object which may be browsed in order to extract
-- the root objects from the container.
ReadHeaderSection(me; s : in out BaseDriver from Storage)
returns HeaderData from Storage;
---Purpose: read the header part of the stream
-- Arguments:
-- s: driver to read
ReadTypeSection(me; s : in out BaseDriver from Storage)
returns TypeData from Storage;
---Purpose: fill the TypeData with the names of the type used
-- in a stream
-- Arguments:
-- s: driver to read
ReadRootSection(me; s : in out BaseDriver from Storage)
returns RootData from Storage;
---Purpose: read root part of the file
-- Arguments:
-- s: driver to read
SchemaKnownTypes(me)
returns SequenceOfAsciiString from TColStd is virtual;
---C++: return const &
---Purpose: returns the known types of a schema
HasUnknownType(me; aDriver : in out BaseDriver from Storage;
theUnknownTypes : out SequenceOfAsciiString from TColStd)
returns Boolean from Standard;
---Purpose: indicates whether the are types in the driver
-- which are not known from the schema and for which
-- no callbacks have been set. The unknown types can
-- be read in <theUnknownTypes>.
GetAllSchemaKnownTypes(me)
returns HSequenceOfAsciiString from TColStd;
---Purpose: returns the all known types of a schema and their
-- nested schemes.
SetNestedSchemas(me : mutable; theSchemas : HArrayOfSchema from Storage);
ClearNestedSchemas(me : mutable);
NestedSchemas(me) returns HArrayOfSchema from Storage;
ICreationDate(myclass) returns AsciiString from TCollection;
---Purpose: return a current date string
CheckTypeMigration(myclass; theTypeName : AsciiString from TCollection;
theNewName : in out AsciiString from TCollection)
returns Boolean from Standard;
---Purpose: returns True if theType migration is identified
-- --------------------------- --
-- USER API : CALLBACK SUPPORT --
-- --------------------------- --
---Purpose: 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 dosent know how to handle this
-- type.
---Warning: : the callback can only be used with persistent
-- types (not with storable types). the constructor
-- function can return a null handle the read
-- function can be empty
AddReadUnknownTypeCallBack(me : mutable;
aTypeName : AsciiString from TCollection;
aCallBack : CallBack from Storage);
---Purpose: add two functions to the callback list
RemoveReadUnknownTypeCallBack(me : mutable;
aTypeName : AsciiString from TCollection);
---Purpose: remove a callback for a type
InstalledCallBackList(me)
returns HSequenceOfAsciiString from TColStd;
---Purpose: returns a list of type name with installed
-- callback.
ClearCallBackList(me : mutable);
---Purpose: clear all callback from schema instance.
UseDefaultCallBack(me : mutable);
---Purpose: install a callback for all unknown type. the
-- objects with unknown types will be skipped. (look
-- SkipObject method in BaseDriver)
DontUseDefaultCallBack(me : mutable);
---Purpose: tells schema to uninstall the default callback.
IsUsingDefaultCallBack(me) returns Boolean from Standard;
---Purpose: ask if the schema is using the default callback.
SetDefaultCallBack(me : mutable; f : CallBack from Storage);
---Purpose: overload the default function for build.(use to
-- set an error message or skip an object while
-- reading an unknown type).
ResetDefaultCallBack(me : mutable);
---Purpose: reset the default function defined by Storage
-- package.
DefaultCallBack(me) returns CallBack from Storage;
---Purpose: returns the read function used when the
-- UseDefaultCallBack() is set.
-- ---------------- --
-- INTERNAL METHODS --
-- ---------------- --
SetNested(me : mutable) returns Boolean from Standard is private;
IsNested(me) returns Boolean from Standard is protected;
UnsetNested(me : mutable) returns Boolean from Standard is private;
ResolveUnknownType(me; aTypeName : AsciiString from TCollection;
aPers : Persistent from Standard;
aMode : SolveMode from Storage)
returns CallBack from Storage is protected;
CallBackSelection(me; tName : AsciiString from TCollection)
returns CallBack from Storage is virtual;
---Level: Internal
AddTypeSelection(me; sp : Persistent from Standard)
returns CallBack from Storage is virtual;
---Level: Internal
HasTypeBinding(me; aTypeName : AsciiString from TCollection)
returns Boolean from Standard is protected;
---Level: Internal
---C++: inline
BindType(me; aTypeName : AsciiString from TCollection;
aCallBack : CallBack from Storage) is protected;
---Level: Internal
TypeBinding(me; aTypeName : AsciiString from TCollection)
returns CallBack from Storage is protected;
---Level: Internal
WritePersistentObjectHeader(me : mutable;
sp : Persistent;
s : in out BaseDriver from Storage);
---C++: inline
---Level: Internal
ReadPersistentObjectHeader(me : mutable; s : in out BaseDriver from Storage);
---C++: inline
---Level: Internal
WritePersistentReference(me : mutable; sp : Persistent;
s : in out BaseDriver from Storage);
---C++: inline
ReadPersistentReference(me : mutable; sp : in out Persistent;
s : in out BaseDriver from Storage);
---Level: Internal
AddPersistent(me; sp : Persistent; tName : CString) returns Boolean;
---Level: Internal
PersistentToAdd(me; sp : Persistent) returns Boolean;
---Level: Internal
Clear(me) is private;
---Level: Internal
IReadHeaderSection(me; s : in out BaseDriver from Storage;
iData : HeaderData from Storage) returns Boolean
raises StreamFormatError is private;
---Level: Internal
IReadTypeSection(me; s : in out BaseDriver from Storage;
tData : TypeData from Storage) returns Boolean
raises StreamFormatError is private;
---Level: Internal
IReadRootSection(me; s : in out BaseDriver from Storage;
rData : RootData from Storage) returns Boolean
raises StreamFormatError is private;
---Level: Internal
ISetCurrentData(myclass; dData : Data from Storage) is private;
---Level: Internal
ICurrentData(myclass) returns Data from Storage is private;
---Level: Internal
---C++: return &
fields
myCallBack : MapOfCallBack from Storage;
myCallBackState : Boolean from Standard;
myDefaultCallBack : CallBack from Storage;
myName : AsciiString from TCollection;
myVersion : AsciiString from TCollection;
myArrayOfSchema : HArrayOfSchema from Storage;
myNestedState : Boolean from Standard;
end;

View File

@@ -12,34 +12,40 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Storage_Schema.ixx>
#include <TColStd_HSequenceOfAsciiString.hxx>
#include <TColStd_MapOfAsciiString.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Persistent.hxx>
#include <Standard_Type.hxx>
#include <Storage.hxx>
#include <Storage_BaseDriver.hxx>
#include <Storage_BucketOfPersistent.hxx>
#include <Storage_InternalData.hxx>
#include <Storage_TypedCallBack.hxx>
#include <Storage_HPArray.hxx>
#include <Storage_HSeqOfRoot.hxx>
#include <Storage_Root.hxx>
#include <Storage_CallBack.hxx>
#include <Storage_Data.hxx>
#include <Storage_DataMapIteratorOfMapOfCallBack.hxx>
#include <Storage_DefaultCallBack.hxx>
#include <Storage_HArrayOfCallBack.hxx>
#include <Storage_StreamModeError.hxx>
#include <Storage_StreamFormatError.hxx>
#include <Storage_StreamWriteError.hxx>
#include <Storage_StreamReadError.hxx>
#include <Storage_StreamUnknownTypeError.hxx>
#include <Storage_StreamTypeMismatchError.hxx>
#include <Storage_HeaderData.hxx>
#include <Storage_HPArray.hxx>
#include <Storage_HSeqOfRoot.hxx>
#include <Storage_InternalData.hxx>
#include <Storage_Root.hxx>
#include <Storage_RootData.hxx>
#include <Storage_Schema.hxx>
#include <Storage_StreamExtCharParityError.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Storage_StreamFormatError.hxx>
#include <Storage_StreamModeError.hxx>
#include <Storage_StreamReadError.hxx>
#include <Storage_StreamTypeMismatchError.hxx>
#include <Storage_StreamUnknownTypeError.hxx>
#include <Storage_StreamWriteError.hxx>
#include <Storage_TypeData.hxx>
#include <Storage_TypedCallBack.hxx>
#include <TCollection_AsciiString.hxx>
#include <TColStd_HSequenceOfAsciiString.hxx>
#include <TColStd_MapOfAsciiString.hxx>
#include <locale.h>
#include <stdio.h>
#define DATATYPE_MIGRATION
#ifdef DATATYPE_MIGRATION

View File

@@ -0,0 +1,280 @@
// Created on: 1996-12-03
// Created by: Christophe LEYNADIER
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Storage_Schema_HeaderFile
#define _Storage_Schema_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Storage_MapOfCallBack.hxx>
#include <Standard_Boolean.hxx>
#include <TCollection_AsciiString.hxx>
#include <Storage_HArrayOfSchema.hxx>
#include <MMgt_TShared.hxx>
#include <TColStd_SequenceOfAsciiString.hxx>
#include <TColStd_HSequenceOfAsciiString.hxx>
#include <Storage_SolveMode.hxx>
#include <Standard_CString.hxx>
class Storage_CallBack;
class Storage_StreamFormatError;
class TCollection_AsciiString;
class Storage_BaseDriver;
class Storage_Data;
class Storage_HeaderData;
class Storage_TypeData;
class Storage_RootData;
class Standard_Persistent;
class Storage_Schema;
DEFINE_STANDARD_HANDLE(Storage_Schema, MMgt_TShared)
//! 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.
class Storage_Schema : public MMgt_TShared
{
public:
//! 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:
//! Handle(ShapeSchema) s = new
//! ShapeSchema;
//! -------- --
//! USER API -- --------------------------------------------------------------
//! -------- --
Standard_EXPORT Storage_Schema();
//! returns version of the schema
Standard_EXPORT void SetVersion (const TCollection_AsciiString& aVersion);
//! returns the version of the schema
Standard_EXPORT TCollection_AsciiString Version() const;
//! set the schema's name
Standard_EXPORT void SetName (const TCollection_AsciiString& aSchemaName);
//! returns the schema's name
Standard_EXPORT TCollection_AsciiString Name() const;
//! Writes the data aggregated in aData into the
//! container defined by the driver s. 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.
Standard_EXPORT void Write (Storage_BaseDriver& s, const Handle(Storage_Data)& aData) const;
//! Returns the data read from the container defined
//! by the driver s. The retrieval operation is
//! performed according to the data schema with
//! which this algorithm is working.
//! These data are aggregated in a Storage_Data
//! object which may be browsed in order to extract
//! the root objects from the container.
Standard_EXPORT Handle(Storage_Data) Read (Storage_BaseDriver& s) const;
//! read the header part of the stream
//! Arguments:
//! s: driver to read
Standard_EXPORT Handle(Storage_HeaderData) ReadHeaderSection (Storage_BaseDriver& s) const;
//! fill the TypeData with the names of the type used
//! in a stream
//! Arguments:
//! s: driver to read
Standard_EXPORT Handle(Storage_TypeData) ReadTypeSection (Storage_BaseDriver& s) const;
//! read root part of the file
//! Arguments:
//! s: driver to read
Standard_EXPORT Handle(Storage_RootData) ReadRootSection (Storage_BaseDriver& s) const;
//! returns the known types of a schema
Standard_EXPORT virtual const TColStd_SequenceOfAsciiString& SchemaKnownTypes() const;
//! indicates whether the are types in the driver
//! which are not known from the schema and for which
//! no callbacks have been set. The unknown types can
//! be read in <theUnknownTypes>.
Standard_EXPORT Standard_Boolean HasUnknownType (Storage_BaseDriver& aDriver, TColStd_SequenceOfAsciiString& theUnknownTypes) const;
//! returns the all known types of a schema and their
//! nested schemes.
Standard_EXPORT Handle(TColStd_HSequenceOfAsciiString) GetAllSchemaKnownTypes() const;
Standard_EXPORT void SetNestedSchemas (const Handle(Storage_HArrayOfSchema)& theSchemas);
Standard_EXPORT void ClearNestedSchemas();
Standard_EXPORT Handle(Storage_HArrayOfSchema) NestedSchemas() const;
//! return a current date string
Standard_EXPORT static TCollection_AsciiString ICreationDate();
//! 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 dosent know how to handle this
//! type.
Standard_EXPORT static Standard_Boolean CheckTypeMigration (const TCollection_AsciiString& theTypeName, TCollection_AsciiString& theNewName);
//! add two functions to the callback list
Standard_EXPORT void AddReadUnknownTypeCallBack (const TCollection_AsciiString& aTypeName, const Handle(Storage_CallBack)& aCallBack);
//! remove a callback for a type
Standard_EXPORT void RemoveReadUnknownTypeCallBack (const TCollection_AsciiString& aTypeName);
//! returns a list of type name with installed
//! callback.
Standard_EXPORT Handle(TColStd_HSequenceOfAsciiString) InstalledCallBackList() const;
//! clear all callback from schema instance.
Standard_EXPORT void ClearCallBackList();
//! install a callback for all unknown type. the
//! objects with unknown types will be skipped. (look
//! SkipObject method in BaseDriver)
Standard_EXPORT void UseDefaultCallBack();
//! tells schema to uninstall the default callback.
Standard_EXPORT void DontUseDefaultCallBack();
//! ask if the schema is using the default callback.
Standard_EXPORT Standard_Boolean IsUsingDefaultCallBack() const;
//! overload the default function for build.(use to
//! set an error message or skip an object while
//! reading an unknown type).
Standard_EXPORT void SetDefaultCallBack (const Handle(Storage_CallBack)& f);
//! reset the default function defined by Storage
//! package.
Standard_EXPORT void ResetDefaultCallBack();
//! returns the read function used when the
//! UseDefaultCallBack() is set.
Standard_EXPORT Handle(Storage_CallBack) DefaultCallBack() const;
Standard_EXPORT virtual Handle(Storage_CallBack) CallBackSelection (const TCollection_AsciiString& tName) const;
Standard_EXPORT virtual Handle(Storage_CallBack) AddTypeSelection (const Handle(Standard_Persistent)& sp) const;
void WritePersistentObjectHeader (const Handle(Standard_Persistent)& sp, Storage_BaseDriver& s);
void ReadPersistentObjectHeader (Storage_BaseDriver& s);
void WritePersistentReference (const Handle(Standard_Persistent)& sp, Storage_BaseDriver& s);
Standard_EXPORT void ReadPersistentReference (Handle(Standard_Persistent)& sp, Storage_BaseDriver& s);
Standard_EXPORT Standard_Boolean AddPersistent (const Handle(Standard_Persistent)& sp, const Standard_CString tName) const;
Standard_EXPORT Standard_Boolean PersistentToAdd (const Handle(Standard_Persistent)& sp) const;
DEFINE_STANDARD_RTTI(Storage_Schema,MMgt_TShared)
protected:
Standard_EXPORT Standard_Boolean IsNested() const;
Standard_EXPORT Handle(Storage_CallBack) ResolveUnknownType (const TCollection_AsciiString& aTypeName, const Handle(Standard_Persistent)& aPers, const Storage_SolveMode aMode) const;
Standard_Boolean HasTypeBinding (const TCollection_AsciiString& aTypeName) const;
Standard_EXPORT void BindType (const TCollection_AsciiString& aTypeName, const Handle(Storage_CallBack)& aCallBack) const;
Standard_EXPORT Handle(Storage_CallBack) TypeBinding (const TCollection_AsciiString& aTypeName) const;
private:
Standard_EXPORT Standard_Boolean SetNested();
Standard_EXPORT Standard_Boolean UnsetNested();
Standard_EXPORT void Clear() const;
Standard_EXPORT Standard_Boolean IReadHeaderSection (Storage_BaseDriver& s, const Handle(Storage_HeaderData)& iData) const;
Standard_EXPORT Standard_Boolean IReadTypeSection (Storage_BaseDriver& s, const Handle(Storage_TypeData)& tData) const;
Standard_EXPORT Standard_Boolean IReadRootSection (Storage_BaseDriver& s, const Handle(Storage_RootData)& rData) const;
Standard_EXPORT static void ISetCurrentData (const Handle(Storage_Data)& dData);
Standard_EXPORT static Handle(Storage_Data)& ICurrentData();
Storage_MapOfCallBack myCallBack;
Standard_Boolean myCallBackState;
Handle(Storage_CallBack) myDefaultCallBack;
TCollection_AsciiString myName;
TCollection_AsciiString myVersion;
Handle(Storage_HArrayOfSchema) myArrayOfSchema;
Standard_Boolean myNestedState;
};
#include <Storage_Schema.lxx>
#endif // _Storage_Schema_HeaderFile

View File

@@ -0,0 +1,28 @@
// Created on: 1996-04-30
// Created by: cle
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Storage_SolveMode_HeaderFile
#define _Storage_SolveMode_HeaderFile
enum Storage_SolveMode
{
Storage_AddSolve,
Storage_WriteSolve,
Storage_ReadSolve
};
#endif // _Storage_SolveMode_HeaderFile

View File

@@ -0,0 +1,37 @@
// Created on: 1996-04-30
// Created by: cle
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Storage_StreamExtCharParityError_HeaderFile
#define _Storage_StreamExtCharParityError_HeaderFile
#include <Standard_Type.hxx>
#include <Standard_DefineException.hxx>
#include <Standard_SStream.hxx>
#include <Storage_StreamReadError.hxx>
class Storage_StreamExtCharParityError;
DEFINE_STANDARD_HANDLE(Storage_StreamExtCharParityError, Storage_StreamReadError)
#if !defined No_Exception && !defined No_Storage_StreamExtCharParityError
#define Storage_StreamExtCharParityError_Raise_if(CONDITION, MESSAGE) \
if (CONDITION) Storage_StreamExtCharParityError::Raise(MESSAGE);
#else
#define Storage_StreamExtCharParityError_Raise_if(CONDITION, MESSAGE)
#endif
DEFINE_STANDARD_EXCEPTION(Storage_StreamExtCharParityError, Storage_StreamReadError)
#endif // _Storage_StreamExtCharParityError_HeaderFile

View File

@@ -0,0 +1,37 @@
// Created on: 1996-04-30
// Created by: cle
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Storage_StreamFormatError_HeaderFile
#define _Storage_StreamFormatError_HeaderFile
#include <Standard_Type.hxx>
#include <Standard_DefineException.hxx>
#include <Standard_SStream.hxx>
#include <Standard_Failure.hxx>
class Storage_StreamFormatError;
DEFINE_STANDARD_HANDLE(Storage_StreamFormatError, Standard_Failure)
#if !defined No_Exception && !defined No_Storage_StreamFormatError
#define Storage_StreamFormatError_Raise_if(CONDITION, MESSAGE) \
if (CONDITION) Storage_StreamFormatError::Raise(MESSAGE);
#else
#define Storage_StreamFormatError_Raise_if(CONDITION, MESSAGE)
#endif
DEFINE_STANDARD_EXCEPTION(Storage_StreamFormatError, Standard_Failure)
#endif // _Storage_StreamFormatError_HeaderFile

View File

@@ -0,0 +1,37 @@
// Created on: 1996-04-30
// Created by: cle
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Storage_StreamModeError_HeaderFile
#define _Storage_StreamModeError_HeaderFile
#include <Standard_Type.hxx>
#include <Standard_DefineException.hxx>
#include <Standard_SStream.hxx>
#include <Standard_Failure.hxx>
class Storage_StreamModeError;
DEFINE_STANDARD_HANDLE(Storage_StreamModeError, Standard_Failure)
#if !defined No_Exception && !defined No_Storage_StreamModeError
#define Storage_StreamModeError_Raise_if(CONDITION, MESSAGE) \
if (CONDITION) Storage_StreamModeError::Raise(MESSAGE);
#else
#define Storage_StreamModeError_Raise_if(CONDITION, MESSAGE)
#endif
DEFINE_STANDARD_EXCEPTION(Storage_StreamModeError, Standard_Failure)
#endif // _Storage_StreamModeError_HeaderFile

View File

@@ -0,0 +1,37 @@
// Created on: 1996-04-30
// Created by: cle
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Storage_StreamReadError_HeaderFile
#define _Storage_StreamReadError_HeaderFile
#include <Standard_Type.hxx>
#include <Standard_DefineException.hxx>
#include <Standard_SStream.hxx>
#include <Standard_Failure.hxx>
class Storage_StreamReadError;
DEFINE_STANDARD_HANDLE(Storage_StreamReadError, Standard_Failure)
#if !defined No_Exception && !defined No_Storage_StreamReadError
#define Storage_StreamReadError_Raise_if(CONDITION, MESSAGE) \
if (CONDITION) Storage_StreamReadError::Raise(MESSAGE);
#else
#define Storage_StreamReadError_Raise_if(CONDITION, MESSAGE)
#endif
DEFINE_STANDARD_EXCEPTION(Storage_StreamReadError, Standard_Failure)
#endif // _Storage_StreamReadError_HeaderFile

View File

@@ -0,0 +1,37 @@
// Created on: 1996-04-30
// Created by: cle
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Storage_StreamTypeMismatchError_HeaderFile
#define _Storage_StreamTypeMismatchError_HeaderFile
#include <Standard_Type.hxx>
#include <Standard_DefineException.hxx>
#include <Standard_SStream.hxx>
#include <Storage_StreamReadError.hxx>
class Storage_StreamTypeMismatchError;
DEFINE_STANDARD_HANDLE(Storage_StreamTypeMismatchError, Storage_StreamReadError)
#if !defined No_Exception && !defined No_Storage_StreamTypeMismatchError
#define Storage_StreamTypeMismatchError_Raise_if(CONDITION, MESSAGE) \
if (CONDITION) Storage_StreamTypeMismatchError::Raise(MESSAGE);
#else
#define Storage_StreamTypeMismatchError_Raise_if(CONDITION, MESSAGE)
#endif
DEFINE_STANDARD_EXCEPTION(Storage_StreamTypeMismatchError, Storage_StreamReadError)
#endif // _Storage_StreamTypeMismatchError_HeaderFile

View File

@@ -0,0 +1,37 @@
// Created on: 1996-04-30
// Created by: cle
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Storage_StreamUnknownTypeError_HeaderFile
#define _Storage_StreamUnknownTypeError_HeaderFile
#include <Standard_Type.hxx>
#include <Standard_DefineException.hxx>
#include <Standard_SStream.hxx>
#include <Storage_StreamReadError.hxx>
class Storage_StreamUnknownTypeError;
DEFINE_STANDARD_HANDLE(Storage_StreamUnknownTypeError, Storage_StreamReadError)
#if !defined No_Exception && !defined No_Storage_StreamUnknownTypeError
#define Storage_StreamUnknownTypeError_Raise_if(CONDITION, MESSAGE) \
if (CONDITION) Storage_StreamUnknownTypeError::Raise(MESSAGE);
#else
#define Storage_StreamUnknownTypeError_Raise_if(CONDITION, MESSAGE)
#endif
DEFINE_STANDARD_EXCEPTION(Storage_StreamUnknownTypeError, Storage_StreamReadError)
#endif // _Storage_StreamUnknownTypeError_HeaderFile

View File

@@ -0,0 +1,37 @@
// Created on: 1996-04-30
// Created by: cle
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Storage_StreamWriteError_HeaderFile
#define _Storage_StreamWriteError_HeaderFile
#include <Standard_Type.hxx>
#include <Standard_DefineException.hxx>
#include <Standard_SStream.hxx>
#include <Standard_Failure.hxx>
class Storage_StreamWriteError;
DEFINE_STANDARD_HANDLE(Storage_StreamWriteError, Standard_Failure)
#if !defined No_Exception && !defined No_Storage_StreamWriteError
#define Storage_StreamWriteError_Raise_if(CONDITION, MESSAGE) \
if (CONDITION) Storage_StreamWriteError::Raise(MESSAGE);
#else
#define Storage_StreamWriteError_Raise_if(CONDITION, MESSAGE)
#endif
DEFINE_STANDARD_EXCEPTION(Storage_StreamWriteError, Standard_Failure)
#endif // _Storage_StreamWriteError_HeaderFile

View File

@@ -1,67 +0,0 @@
-- Created on: 1997-02-06
-- Created by: Kernel
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class TypeData from Storage
inherits TShared from MMgt
uses HSequenceOfAsciiString from TColStd,
PType from Storage,
AsciiString from TCollection,
Error from Storage
raises NoSuchObject from Standard
is
Create returns TypeData from Storage;
NumberOfTypes(me) returns Integer from Standard;
IsType(me; aName : AsciiString from TCollection) returns Boolean from Standard;
Types(me) returns HSequenceOfAsciiString from TColStd;
ErrorStatus(me) returns Error from Storage;
ErrorStatusExtension(me) returns AsciiString from TCollection;
ClearErrorStatus(me : mutable);
Clear(me : mutable);
-- PRIVATE
AddType(me : mutable; aName : AsciiString from TCollection; aTypeNum : Integer from Standard) is private;
---Purpose: add a type to the list
Type(me; aTypeNum : Integer from Standard) returns AsciiString from TCollection
raises NoSuchObject is private;
---Purpose: returns the name of the type with number <aTypeNum>
Type(me; aTypeName : AsciiString from TCollection) returns Integer from Standard
raises NoSuchObject is private;
---Purpose: returns the name of the type with number <aTypeNum>
SetErrorStatus(me : mutable; anError : Error from Storage) is private;
SetErrorStatusExtension(me : mutable; anErrorExt : AsciiString from TCollection) is private;
fields
myPt : PType from Storage;
myErrorStatus : Error from Storage;
myErrorStatusExt : AsciiString from TCollection;
friends class Schema from Storage
end;

View File

@@ -12,7 +12,12 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Storage_TypeData.ixx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_Type.hxx>
#include <Storage_Schema.hxx>
#include <Storage_TypeData.hxx>
#include <TCollection_AsciiString.hxx>
Storage_TypeData::Storage_TypeData() : myErrorStatus(Storage_VSOk)
{

View File

@@ -0,0 +1,101 @@
// Created on: 1997-02-06
// Created by: Kernel
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Storage_TypeData_HeaderFile
#define _Storage_TypeData_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Storage_PType.hxx>
#include <Storage_Error.hxx>
#include <TCollection_AsciiString.hxx>
#include <MMgt_TShared.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <TColStd_HSequenceOfAsciiString.hxx>
class Standard_NoSuchObject;
class Storage_Schema;
class TCollection_AsciiString;
class Storage_TypeData;
DEFINE_STANDARD_HANDLE(Storage_TypeData, MMgt_TShared)
class Storage_TypeData : public MMgt_TShared
{
public:
Standard_EXPORT Storage_TypeData();
Standard_EXPORT Standard_Integer NumberOfTypes() const;
Standard_EXPORT Standard_Boolean IsType (const TCollection_AsciiString& aName) const;
Standard_EXPORT Handle(TColStd_HSequenceOfAsciiString) Types() const;
Standard_EXPORT Storage_Error ErrorStatus() const;
Standard_EXPORT TCollection_AsciiString ErrorStatusExtension() const;
Standard_EXPORT void ClearErrorStatus();
Standard_EXPORT void Clear();
friend class Storage_Schema;
DEFINE_STANDARD_RTTI(Storage_TypeData,MMgt_TShared)
protected:
private:
//! add a type to the list
Standard_EXPORT void AddType (const TCollection_AsciiString& aName, const Standard_Integer aTypeNum);
//! returns the name of the type with number <aTypeNum>
Standard_EXPORT TCollection_AsciiString Type (const Standard_Integer aTypeNum) const;
//! returns the name of the type with number <aTypeNum>
Standard_EXPORT Standard_Integer Type (const TCollection_AsciiString& aTypeName) const;
Standard_EXPORT void SetErrorStatus (const Storage_Error anError);
Standard_EXPORT void SetErrorStatusExtension (const TCollection_AsciiString& anErrorExt);
Storage_PType myPt;
Storage_Error myErrorStatus;
TCollection_AsciiString myErrorStatusExt;
};
#endif // _Storage_TypeData_HeaderFile

View File

@@ -1,45 +0,0 @@
-- Created on: 1997-02-28
-- Created by: Christophe LEYNADIER
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
private class TypedCallBack from Storage
inherits TShared from MMgt
uses CallBack from Storage,
AsciiString from TCollection
is
Create returns TypedCallBack from Storage;
Create(aTypeName : AsciiString from TCollection; aCallBack : CallBack from Storage)
returns TypedCallBack from Storage;
SetType(me : mutable; aType : AsciiString from TCollection);
Type(me) returns AsciiString from TCollection;
SetCallBack(me : mutable; aCallBack : CallBack from Storage);
CallBack(me) returns CallBack from Storage;
SetIndex(me : mutable; anIndex : Integer from Standard);
Index(me) returns Integer from Standard;
fields
myType : AsciiString from TCollection;
myCallBack : CallBack from Storage;
myIndex : Integer from Standard;
end;

View File

@@ -12,7 +12,11 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Storage_TypedCallBack.ixx>
#include <Standard_Type.hxx>
#include <Storage_CallBack.hxx>
#include <Storage_TypedCallBack.hxx>
#include <TCollection_AsciiString.hxx>
Storage_TypedCallBack::Storage_TypedCallBack() : myIndex(0)
{

View File

@@ -0,0 +1,82 @@
// Created on: 1997-02-28
// Created by: Christophe LEYNADIER
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Storage_TypedCallBack_HeaderFile
#define _Storage_TypedCallBack_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TCollection_AsciiString.hxx>
#include <Standard_Integer.hxx>
#include <MMgt_TShared.hxx>
class Storage_CallBack;
class TCollection_AsciiString;
class Storage_TypedCallBack;
DEFINE_STANDARD_HANDLE(Storage_TypedCallBack, MMgt_TShared)
class Storage_TypedCallBack : public MMgt_TShared
{
public:
Standard_EXPORT Storage_TypedCallBack();
Standard_EXPORT Storage_TypedCallBack(const TCollection_AsciiString& aTypeName, const Handle(Storage_CallBack)& aCallBack);
Standard_EXPORT void SetType (const TCollection_AsciiString& aType);
Standard_EXPORT TCollection_AsciiString Type() const;
Standard_EXPORT void SetCallBack (const Handle(Storage_CallBack)& aCallBack);
Standard_EXPORT Handle(Storage_CallBack) CallBack() const;
Standard_EXPORT void SetIndex (const Standard_Integer anIndex);
Standard_EXPORT Standard_Integer Index() const;
DEFINE_STANDARD_RTTI(Storage_TypedCallBack,MMgt_TShared)
protected:
private:
TCollection_AsciiString myType;
Handle(Storage_CallBack) myCallBack;
Standard_Integer myIndex;
};
#endif // _Storage_TypedCallBack_HeaderFile

View File

@@ -1,19 +0,0 @@
-- Created on: 1997-01-30
-- Created by: Christophe LEYNADIER
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
private class stCONSTclCOM from Storage
is
end;

View File

@@ -0,0 +1,57 @@
// Created on: 1997-01-30
// Created by: Christophe LEYNADIER
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Storage_stCONSTclCOM_HeaderFile
#define _Storage_stCONSTclCOM_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
class Storage_stCONSTclCOM
{
public:
DEFINE_STANDARD_ALLOC
protected:
private:
};
#endif // _Storage_stCONSTclCOM_HeaderFile