Open CASCADE Technology  6.9.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
CDM_Document Class Referenceabstract

An applicative document is an instance of a class inheriting CDM_Document. These documents have the following properties: More...

#include <CDM_Document.hxx>

Inheritance diagram for CDM_Document:
Inheritance graph
[legend]

Public Member Functions

virtual void Update (const Handle< CDM_Document > &aToDocument, const Standard_Integer aReferenceIdentifier, const Standard_Address aModifContext)
 The Update method will be called once for each reference, but it should not perform any computation, to avoid multiple computation of a same document. More...
 
virtual Standard_Boolean Update (TCollection_ExtendedString &ErrorString)
 This method Update will be called to signal the end of the modified references list. The document should be recomputed and UpdateFromDocuments should be called. Update should returns True in case of success, false otherwise. In case of Failure, additional information can be given in ErrorString. More...
 
virtual TCollection_ExtendedString StorageFormat () const =0
 The Storage Format is the key which is used to determine in the application resources the storage driver plugin, the file extension and other data used to store the document. More...
 
virtual void Extensions (TColStd_SequenceOfExtendedString &Extensions) const
 by default empties the extensions. More...
 
virtual Standard_Boolean GetAlternativeDocument (const TCollection_ExtendedString &aFormat, Handle< CDM_Document > &anAlternativeDocument)
 This method can be redefined to extract another document in a different format. For example, to extract a MDTV-Shape from an applicative document. More...
 
Standard_Integer CreateReference (const Handle< CDM_Document > &anOtherDocument)
 Creates a reference from this document to {anOtherDocument}. Returns a reference identifier. This reference identifier is unique in the document and will not be used for the next references, even after the storing of the document. If there is already a reference between the two documents, the reference is not created, but its reference identifier is returned. More...
 
void RemoveReference (const Standard_Integer aReferenceIdentifier)
 Removes the reference between the From Document and the To Document identified by a reference identifier. More...
 
void RemoveAllReferences ()
 Removes all references having this document for From Document. More...
 
Handle< CDM_DocumentDocument (const Standard_Integer aReferenceIdentifier) const
 Returns the To Document of the reference identified by aReferenceIdentifier. If the ToDocument is stored and has not yet been retrieved, this method will retrieve it. More...
 
Standard_Boolean IsInSession (const Standard_Integer aReferenceIdentifier) const
 returns True if the To Document of the reference identified by aReferenceIdentifier is in session, False if it corresponds to a not yet retrieved document. More...
 
Standard_Boolean IsStored (const Standard_Integer aReferenceIdentifier) const
 returns True if the To Document of the reference identified by aReferenceIdentifier has already been stored, False otherwise. More...
 
TCollection_ExtendedString Name (const Standard_Integer aReferenceIdentifier) const
 returns the name of the metadata of the To Document of the reference identified by aReferenceIdentifier. More...
 
void UpdateFromDocuments (const Standard_Address aModifContext) const
 call virtual method Update on all referencing documents. This method keeps the list of the – documents to process.It may be the starting of an update – cycle. If not, the reentrant calls made by Update method (without argument) will append the referencing documents to the list and call the Update method (with arguments). Only the first call to UpdateFromDocuments generate call to Update(). More...
 
Standard_Integer ToReferencesNumber () const
 returns the number of references having this document as From Document. More...
 
Standard_Integer FromReferencesNumber () const
 returns the number of references having this document as To Document. More...
 
Standard_Boolean ShallowReferences (const Handle< CDM_Document > &aDocument) const
 returns True is this document references aDocument; More...
 
Standard_Boolean DeepReferences (const Handle< CDM_Document > &aDocument) const
 returns True is this document references aDocument; More...
 
Standard_Integer CopyReference (const Handle< CDM_Document > &aFromDocument, const Standard_Integer aReferenceIdentifier)
 Copies a reference to this document. This method avoid retrieval of referenced document. The arguments are the original document and a valid reference identifier Returns the local identifier. More...
 
Standard_Boolean IsReadOnly () const
 indicates that this document cannot be modified. More...
 
Standard_Boolean IsReadOnly (const Standard_Integer aReferenceIdentifier) const
 indicates that the referenced document cannot be modified, More...
 
void SetIsReadOnly ()
 
void UnsetIsReadOnly ()
 
void Modify ()
 Indicates that this document has been modified. This method increments the modification counter. More...
 
Standard_Integer Modifications () const
 returns the current modification counter. More...
 
void UnModify ()
 
Standard_Boolean IsUpToDate (const Standard_Integer aReferenceIdentifier) const
 returns true if the modification counter found in the given reference is equal to the actual modification counter of the To Document. This method is able to deal with a reference to a not retrieved document. More...
 
void SetIsUpToDate (const Standard_Integer aReferenceIdentifier)
 Resets the modification counter in the given reference to the actual modification counter of its To Document. This method should be called after the application has updated this document. More...
 
void SetComment (const TCollection_ExtendedString &aComment)
 associates a comment with this document. More...
 
void AddComment (const TCollection_ExtendedString &aComment)
 appends a comment into comments of this document. More...
 
void SetComments (const TColStd_SequenceOfExtendedString &aComments)
 associates a comments with this document. More...
 
void Comments (TColStd_SequenceOfExtendedString &aComments) const
 returns the associated comments through <aComments>. Returns empty sequence if no comments are associated. More...
 
Standard_ExtString Comment () const
 returns the first of associated comments. By defaut the comment is an empty string. More...
 
Standard_ExtString Presentation ()
 Returns an alphanumeric string identifying this document in a unique manner in the current process. The presentation may change when the document is stored. Tries to get the 'FileFormat`.Presentation resource This item is used to give a default presentation to the document. More...
 
Standard_Boolean IsStored () const
 
Standard_Integer StorageVersion () const
 returns the value of the modification counter at the time of storage. By default returns 0. More...
 
void SetMetaData (const Handle< CDM_MetaData > &aMetaData)
 associates database information to a document which has been stored. The name of the document is now the name which has beenused to store the data. More...
 
void UnsetIsStored ()
 
Handle< CDM_MetaDataMetaData () const
 
TCollection_ExtendedString Folder () const
 
void SetRequestedFolder (const TCollection_ExtendedString &aFolder)
 defines the folder in which the object should be stored. More...
 
TCollection_ExtendedString RequestedFolder () const
 
Standard_Boolean HasRequestedFolder () const
 
void SetRequestedName (const TCollection_ExtendedString &aName)
 defines the name under which the object should be stored. More...
 
TCollection_ExtendedString RequestedName ()
 determines under which the document is going to be store. By default the name of the document wil be – used. If the document has no name its presentation will be used. More...
 
void SetRequestedPreviousVersion (const TCollection_ExtendedString &aPreviousVersion)
 
void UnsetRequestedPreviousVersion ()
 
Standard_Boolean HasRequestedPreviousVersion () const
 
TCollection_ExtendedString RequestedPreviousVersion () const
 
void SetRequestedComment (const TCollection_ExtendedString &aComment)
 defines the Comment with which the object should be stored. More...
 
TCollection_ExtendedString RequestedComment () const
 
void LoadResources ()
 read (or rereads) the following resource. More...
 
Standard_Boolean FindFileExtension ()
 
TCollection_ExtendedString FileExtension ()
 gets the Desktop.Domain.Application.FileFormat.FileExtension resource. More...
 
Standard_Boolean FindDataType ()
 
TCollection_ExtendedString DataType ()
 this datatype will be used if the DBMS deals with this concept gets the FileFormat.DataType resource. concept. More...
 
Standard_Boolean FindVersionDataType ()
 
TCollection_ExtendedString VersionDataType ()
 this datatype will be used if the DBMS deals with this concept gets the FileFormat.VersionDataType resource. More...
 
Standard_Boolean FindDescription ()
 
TCollection_ExtendedString Description ()
 gets the FileFormat.Description resource. More...
 
Standard_Boolean FindDomain ()
 
TCollection_ExtendedString Domain ()
 gets the FileFormat.Domain resource. More...
 
Standard_Boolean FindStoragePlugin ()
 
Standard_GUID StoragePlugin ()
 
Standard_Boolean IsModified () const
 returns true if the version is greater than the storage version More...
 
Standard_OStreamPrint (Standard_OStream &anOStream) const
 
Standard_OStreamoperator<< (Standard_OStream &anOStream)
 
Standard_Boolean IsOpened () const
 
void Open (const Handle< CDM_Application > &anApplication)
 
CDM_CanCloseStatus CanClose () const
 
void Close ()
 
const Handle< CDM_Application > & Application () const
 
virtual Standard_Boolean CanCloseReference (const Handle< CDM_Document > &aDocument, const Standard_Integer aReferenceIdentifier) const
 A referenced document may indicate through this virtual method that it does not allow the closing of aDocument which it references through the reference aReferenceIdentifier. By default returns Standard_True;;. More...
 
virtual void CloseReference (const Handle< CDM_Document > &aDocument, const Standard_Integer aReferenceIdentifier)
 A referenced document may update its internal data structure when {aDocument} which it references through the reference {aReferenceIdentifier} is being closed. By default this method does nothing. More...
 
Standard_Boolean IsOpened (const Standard_Integer aReferenceIdentifier) const
 returns true if the document corresponding to the given reference has been retrieved and opened. Otherwise returns false. This method does not retrieve the referenced document More...
 
void CreateReference (const Handle< CDM_MetaData > &aMetaData, const Standard_Integer aReferenceIdentifier, const Handle< CDM_Application > &anApplication, const Standard_Integer aToDocumentVersion, const Standard_Boolean UseStorageConfiguration)
 
Standard_Integer CreateReference (const Handle< CDM_MetaData > &aMetaData, const Handle< CDM_Application > &anApplication, const Standard_Integer aDocumentVersion, const Standard_Boolean UseStorageConfiguration)
 
Standard_Integer ReferenceCounter () const
 
virtual void Update ()
 the following method should be used instead: More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
virtual const
Handle_Standard_Type & 
DynamicType () const
 Returns a type information object about this object. More...
 
Standard_Boolean IsInstance (const Handle_Standard_Type &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const Handle_Standard_Type &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
virtual Handle_Standard_Transient This () const
 Returns a Handle which references this object. Must never be called to objects created in stack. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 

Static Public Member Functions

static Handle< CDM_DocumentFindFromPresentation (const TCollection_ExtendedString &aPresentation)
 returns the document having the given alphanumeric presentation. More...
 
static Standard_Boolean FindPresentation (const TCollection_ExtendedString &aPresentation)
 indicates whether a document having the given presentation does exist. More...
 

Protected Member Functions

 CDM_Document ()
 
virtual void Destroy ()
 
 ~CDM_Document ()
 

Protected Attributes

Standard_Boolean myResourcesAreLoaded
 

Detailed Description

An applicative document is an instance of a class inheriting CDM_Document. These documents have the following properties:

Constructor & Destructor Documentation

CDM_Document::CDM_Document ( )
protected
CDM_Document::~CDM_Document ( )
inlineprotected

Member Function Documentation

void CDM_Document::AddComment ( const TCollection_ExtendedString aComment)

appends a comment into comments of this document.

const Handle< CDM_Application >& CDM_Document::Application ( ) const
CDM_CanCloseStatus CDM_Document::CanClose ( ) const
virtual Standard_Boolean CDM_Document::CanCloseReference ( const Handle< CDM_Document > &  aDocument,
const Standard_Integer  aReferenceIdentifier 
) const
virtual

A referenced document may indicate through this virtual method that it does not allow the closing of aDocument which it references through the reference aReferenceIdentifier. By default returns Standard_True;;.

void CDM_Document::Close ( )
virtual void CDM_Document::CloseReference ( const Handle< CDM_Document > &  aDocument,
const Standard_Integer  aReferenceIdentifier 
)
virtual

A referenced document may update its internal data structure when {aDocument} which it references through the reference {aReferenceIdentifier} is being closed. By default this method does nothing.

Standard_ExtString CDM_Document::Comment ( ) const

returns the first of associated comments. By defaut the comment is an empty string.

void CDM_Document::Comments ( TColStd_SequenceOfExtendedString aComments) const

returns the associated comments through <aComments>. Returns empty sequence if no comments are associated.

Standard_Integer CDM_Document::CopyReference ( const Handle< CDM_Document > &  aFromDocument,
const Standard_Integer  aReferenceIdentifier 
)

Copies a reference to this document. This method avoid retrieval of referenced document. The arguments are the original document and a valid reference identifier Returns the local identifier.

Standard_Integer CDM_Document::CreateReference ( const Handle< CDM_Document > &  anOtherDocument)

Creates a reference from this document to {anOtherDocument}. Returns a reference identifier. This reference identifier is unique in the document and will not be used for the next references, even after the storing of the document. If there is already a reference between the two documents, the reference is not created, but its reference identifier is returned.

void CDM_Document::CreateReference ( const Handle< CDM_MetaData > &  aMetaData,
const Standard_Integer  aReferenceIdentifier,
const Handle< CDM_Application > &  anApplication,
const Standard_Integer  aToDocumentVersion,
const Standard_Boolean  UseStorageConfiguration 
)
Standard_Integer CDM_Document::CreateReference ( const Handle< CDM_MetaData > &  aMetaData,
const Handle< CDM_Application > &  anApplication,
const Standard_Integer  aDocumentVersion,
const Standard_Boolean  UseStorageConfiguration 
)
TCollection_ExtendedString CDM_Document::DataType ( )

this datatype will be used if the DBMS deals with this concept gets the FileFormat.DataType resource. concept.

Standard_Boolean CDM_Document::DeepReferences ( const Handle< CDM_Document > &  aDocument) const

returns True is this document references aDocument;

TCollection_ExtendedString CDM_Document::Description ( )

gets the FileFormat.Description resource.

virtual void CDM_Document::Destroy ( )
protectedvirtual
Handle< CDM_Document > CDM_Document::Document ( const Standard_Integer  aReferenceIdentifier) const

Returns the To Document of the reference identified by aReferenceIdentifier. If the ToDocument is stored and has not yet been retrieved, this method will retrieve it.

TCollection_ExtendedString CDM_Document::Domain ( )

gets the FileFormat.Domain resource.

virtual void CDM_Document::Extensions ( TColStd_SequenceOfExtendedString Extensions) const
virtual

by default empties the extensions.

TCollection_ExtendedString CDM_Document::FileExtension ( )

gets the Desktop.Domain.Application.FileFormat.FileExtension resource.

Standard_Boolean CDM_Document::FindDataType ( )
Standard_Boolean CDM_Document::FindDescription ( )
Standard_Boolean CDM_Document::FindDomain ( )
Standard_Boolean CDM_Document::FindFileExtension ( )
static Handle< CDM_Document > CDM_Document::FindFromPresentation ( const TCollection_ExtendedString aPresentation)
static

returns the document having the given alphanumeric presentation.

static Standard_Boolean CDM_Document::FindPresentation ( const TCollection_ExtendedString aPresentation)
static

indicates whether a document having the given presentation does exist.

Standard_Boolean CDM_Document::FindStoragePlugin ( )
Standard_Boolean CDM_Document::FindVersionDataType ( )
TCollection_ExtendedString CDM_Document::Folder ( ) const
Standard_Integer CDM_Document::FromReferencesNumber ( ) const

returns the number of references having this document as To Document.

virtual Standard_Boolean CDM_Document::GetAlternativeDocument ( const TCollection_ExtendedString aFormat,
Handle< CDM_Document > &  anAlternativeDocument 
)
virtual

This method can be redefined to extract another document in a different format. For example, to extract a MDTV-Shape from an applicative document.

Standard_Boolean CDM_Document::HasRequestedFolder ( ) const
Standard_Boolean CDM_Document::HasRequestedPreviousVersion ( ) const
Standard_Boolean CDM_Document::IsInSession ( const Standard_Integer  aReferenceIdentifier) const

returns True if the To Document of the reference identified by aReferenceIdentifier is in session, False if it corresponds to a not yet retrieved document.

Standard_Boolean CDM_Document::IsModified ( ) const

returns true if the version is greater than the storage version

Standard_Boolean CDM_Document::IsOpened ( ) const
Standard_Boolean CDM_Document::IsOpened ( const Standard_Integer  aReferenceIdentifier) const

returns true if the document corresponding to the given reference has been retrieved and opened. Otherwise returns false. This method does not retrieve the referenced document

Standard_Boolean CDM_Document::IsReadOnly ( ) const

indicates that this document cannot be modified.

Standard_Boolean CDM_Document::IsReadOnly ( const Standard_Integer  aReferenceIdentifier) const

indicates that the referenced document cannot be modified,

Standard_Boolean CDM_Document::IsStored ( const Standard_Integer  aReferenceIdentifier) const

returns True if the To Document of the reference identified by aReferenceIdentifier has already been stored, False otherwise.

Standard_Boolean CDM_Document::IsStored ( ) const
Standard_Boolean CDM_Document::IsUpToDate ( const Standard_Integer  aReferenceIdentifier) const

returns true if the modification counter found in the given reference is equal to the actual modification counter of the To Document. This method is able to deal with a reference to a not retrieved document.

void CDM_Document::LoadResources ( )

read (or rereads) the following resource.

Handle< CDM_MetaData > CDM_Document::MetaData ( ) const
Standard_Integer CDM_Document::Modifications ( ) const

returns the current modification counter.

void CDM_Document::Modify ( )

Indicates that this document has been modified. This method increments the modification counter.

TCollection_ExtendedString CDM_Document::Name ( const Standard_Integer  aReferenceIdentifier) const

returns the name of the metadata of the To Document of the reference identified by aReferenceIdentifier.

void CDM_Document::Open ( const Handle< CDM_Application > &  anApplication)
Standard_OStream& CDM_Document::operator<< ( Standard_OStream anOStream)
Standard_ExtString CDM_Document::Presentation ( )

Returns an alphanumeric string identifying this document in a unique manner in the current process. The presentation may change when the document is stored. Tries to get the 'FileFormat`.Presentation resource This item is used to give a default presentation to the document.

Standard_OStream& CDM_Document::Print ( Standard_OStream anOStream) const
Standard_Integer CDM_Document::ReferenceCounter ( ) const
void CDM_Document::RemoveAllReferences ( )

Removes all references having this document for From Document.

void CDM_Document::RemoveReference ( const Standard_Integer  aReferenceIdentifier)

Removes the reference between the From Document and the To Document identified by a reference identifier.

TCollection_ExtendedString CDM_Document::RequestedComment ( ) const
TCollection_ExtendedString CDM_Document::RequestedFolder ( ) const
TCollection_ExtendedString CDM_Document::RequestedName ( )

determines under which the document is going to be store. By default the name of the document wil be – used. If the document has no name its presentation will be used.

TCollection_ExtendedString CDM_Document::RequestedPreviousVersion ( ) const
void CDM_Document::SetComment ( const TCollection_ExtendedString aComment)

associates a comment with this document.

void CDM_Document::SetComments ( const TColStd_SequenceOfExtendedString aComments)

associates a comments with this document.

void CDM_Document::SetIsReadOnly ( )
void CDM_Document::SetIsUpToDate ( const Standard_Integer  aReferenceIdentifier)

Resets the modification counter in the given reference to the actual modification counter of its To Document. This method should be called after the application has updated this document.

void CDM_Document::SetMetaData ( const Handle< CDM_MetaData > &  aMetaData)

associates database information to a document which has been stored. The name of the document is now the name which has beenused to store the data.

void CDM_Document::SetRequestedComment ( const TCollection_ExtendedString aComment)

defines the Comment with which the object should be stored.

void CDM_Document::SetRequestedFolder ( const TCollection_ExtendedString aFolder)

defines the folder in which the object should be stored.

void CDM_Document::SetRequestedName ( const TCollection_ExtendedString aName)

defines the name under which the object should be stored.

void CDM_Document::SetRequestedPreviousVersion ( const TCollection_ExtendedString aPreviousVersion)
Standard_Boolean CDM_Document::ShallowReferences ( const Handle< CDM_Document > &  aDocument) const

returns True is this document references aDocument;

virtual TCollection_ExtendedString CDM_Document::StorageFormat ( ) const
pure virtual

The Storage Format is the key which is used to determine in the application resources the storage driver plugin, the file extension and other data used to store the document.

Implemented in TDocStd_Document.

Standard_GUID CDM_Document::StoragePlugin ( )
Standard_Integer CDM_Document::StorageVersion ( ) const

returns the value of the modification counter at the time of storage. By default returns 0.

Standard_Integer CDM_Document::ToReferencesNumber ( ) const

returns the number of references having this document as From Document.

void CDM_Document::UnModify ( )
void CDM_Document::UnsetIsReadOnly ( )
void CDM_Document::UnsetIsStored ( )
void CDM_Document::UnsetRequestedPreviousVersion ( )
virtual void CDM_Document::Update ( const Handle< CDM_Document > &  aToDocument,
const Standard_Integer  aReferenceIdentifier,
const Standard_Address  aModifContext 
)
virtual

The Update method will be called once for each reference, but it should not perform any computation, to avoid multiple computation of a same document.

Reimplemented in TDocStd_Document.

virtual Standard_Boolean CDM_Document::Update ( TCollection_ExtendedString ErrorString)
virtual

This method Update will be called to signal the end of the modified references list. The document should be recomputed and UpdateFromDocuments should be called. Update should returns True in case of success, false otherwise. In case of Failure, additional information can be given in ErrorString.

virtual void CDM_Document::Update ( )
virtual

the following method should be used instead:

Update(me:mutable; ErrorString: out ExtendedString from TCollection) returns Boolean from Standard

void CDM_Document::UpdateFromDocuments ( const Standard_Address  aModifContext) const

call virtual method Update on all referencing documents. This method keeps the list of the – documents to process.It may be the starting of an update – cycle. If not, the reentrant calls made by Update method (without argument) will append the referencing documents to the list and call the Update method (with arguments). Only the first call to UpdateFromDocuments generate call to Update().

TCollection_ExtendedString CDM_Document::VersionDataType ( )

this datatype will be used if the DBMS deals with this concept gets the FileFormat.VersionDataType resource.

Field Documentation

Standard_Boolean CDM_Document::myResourcesAreLoaded
protected

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