Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions
XCAFApp_Application Class Reference

Implements an Application for the DECAF documents. More...

#include <XCAFApp_Application.hxx>

Inheritance diagram for XCAFApp_Application:
Inheritance graph
[legend]

Public Member Functions

const charResourcesName () override
 
void InitDocument (const occ::handle< CDM_Document > &aDoc) const override
 Set XCAFDoc_DocumentTool attribute.
 
void DumpJson (Standard_OStream &theOStream, int theDepth=-1) const
 Dumps the content of me into the stream.
 
- Public Member Functions inherited from TDocStd_Application
 TDocStd_Application ()
 Constructs the new instance and registers it in CDM_Session.
 
bool IsDriverLoaded () const
 Check if meta data driver was successfully loaded by the application constructor.
 
occ::handle< Resource_ManagerResources () override
 Returns resource manager defining supported persistent formats.
 
void DefineFormat (const TCollection_AsciiString &theFormat, const TCollection_AsciiString &theDescription, const TCollection_AsciiString &theExtension, const occ::handle< PCDM_RetrievalDriver > &theReader, const occ::handle< PCDM_StorageDriver > &theWriter)
 Sets up resources and registers read and storage drivers for the specified format.
 
void ReadingFormats (NCollection_Sequence< TCollection_AsciiString > &theFormats)
 Returns the sequence of reading formats supported by the application.
 
void WritingFormats (NCollection_Sequence< TCollection_AsciiString > &theFormats)
 Returns the sequence of writing formats supported by the application.
 
int NbDocuments () const
 returns the number of documents handled by the current applicative session.
 
occ::handle< TDocStd_DocumentGetDocument (const int index) const
 Returns the document at the given 1-based index. The index is any integer between 1 and NbDocuments().
 
void GetDocument (const int index, occ::handle< TDocStd_Document > &aDoc) const
 
void NewDocument (const TCollection_ExtendedString &format, occ::handle< CDM_Document > &aDoc) override
 Constructs the empty new document aDoc. This document will have the format format. If InitDocument is redefined for a specific application, the new document is handled by the applicative session.
 
void NewDocument (const TCollection_ExtendedString &format, occ::handle< TDocStd_Document > &aDoc)
 A non-virtual method taking a TDocStd_Documment object as an input. Internally it calls a virtual method NewDocument() with CDM_Document object.
 
void Close (const occ::handle< TDocStd_Document > &aDoc)
 Close the given document. the document is not any more handled by the applicative session.
 
int IsInSession (const TCollection_ExtendedString &path) const
 Returns an index for the document found in the path path in this applicative session. If the returned value is 0, the document is not present in the applicative session. This method can be used for the interactive part of an application. For instance, on a call to Open, the document to be opened may already be in memory. IsInSession checks to see if this is the case. Open can be made to depend on the value of the index returned: if IsInSession returns 0, the document is opened; if it returns another value, a message is displayed asking the user if he wants to override the version of the document in memory. Example: int insession = A->IsInSession(aDoc); if (insession > 0) { std::cout << "document " << insession << " is already in session" << std::endl; return 0; }.
 
PCDM_ReaderStatus Open (const TCollection_ExtendedString &thePath, occ::handle< TDocStd_Document > &theDoc, const occ::handle< PCDM_ReaderFilter > &theFilter, const Message_ProgressRange &theRange=Message_ProgressRange())
 Retrieves the document from specified file. In order not to override a version of the document which is already in memory, this method can be made to depend on the value returned by IsInSession.
 
PCDM_ReaderStatus Open (const TCollection_ExtendedString &thePath, occ::handle< TDocStd_Document > &theDoc, const Message_ProgressRange &theRange=Message_ProgressRange())
 Retrieves the document from specified file. In order not to override a version of the document which is already in memory, this method can be made to depend on the value returned by IsInSession.
 
PCDM_ReaderStatus Open (Standard_IStream &theIStream, occ::handle< TDocStd_Document > &theDoc, const occ::handle< PCDM_ReaderFilter > &theFilter, const Message_ProgressRange &theRange=Message_ProgressRange())
 Retrieves document from standard stream.
 
PCDM_ReaderStatus Open (Standard_IStream &theIStream, occ::handle< TDocStd_Document > &theDoc, const Message_ProgressRange &theRange=Message_ProgressRange())
 Retrieves document from standard stream.
 
PCDM_StoreStatus SaveAs (const occ::handle< TDocStd_Document > &theDoc, const TCollection_ExtendedString &path, const Message_ProgressRange &theRange=Message_ProgressRange())
 Save the active document in the file <name> in the path <path>. overwrites the file if it already exists.
 
PCDM_StoreStatus SaveAs (const occ::handle< TDocStd_Document > &theDoc, Standard_OStream &theOStream, const Message_ProgressRange &theRange=Message_ProgressRange())
 Save theDoc to standard SEEKABLE stream theOStream. the stream should support SEEK functionality.
 
PCDM_StoreStatus Save (const occ::handle< TDocStd_Document > &theDoc, const Message_ProgressRange &theRange=Message_ProgressRange())
 Save aDoc active document. Exceptions: Standard_NotImplemented if the document was not retrieved in the applicative session by using Open.
 
PCDM_StoreStatus SaveAs (const occ::handle< TDocStd_Document > &theDoc, const TCollection_ExtendedString &path, TCollection_ExtendedString &theStatusMessage, const Message_ProgressRange &theRange=Message_ProgressRange())
 Save the active document in the file <name> in the path <path>. overwrite the file if it already exists.
 
PCDM_StoreStatus SaveAs (const occ::handle< TDocStd_Document > &theDoc, Standard_OStream &theOStream, TCollection_ExtendedString &theStatusMessage, const Message_ProgressRange &theRange=Message_ProgressRange())
 Save theDoc TO standard SEEKABLE stream theOStream. the stream should support SEEK functionality.
 
PCDM_StoreStatus Save (const occ::handle< TDocStd_Document > &theDoc, TCollection_ExtendedString &theStatusMessage, const Message_ProgressRange &theRange=Message_ProgressRange())
 Save the document overwriting the previous file.
 
virtual void OnOpenTransaction (const occ::handle< TDocStd_Document > &theDoc)
 Notification that is fired at each OpenTransaction event.
 
virtual void OnCommitTransaction (const occ::handle< TDocStd_Document > &theDoc)
 Notification that is fired at each CommitTransaction event.
 
virtual void OnAbortTransaction (const occ::handle< TDocStd_Document > &theDoc)
 Notification that is fired at each AbortTransaction event.
 
void DumpJson (Standard_OStream &theOStream, int theDepth=-1) const
 Dumps the content of me into the stream.
 
- Public Member Functions inherited from CDF_Application
void Open (const occ::handle< CDM_Document > &aDocument)
 puts the document in the current session directory and calls the virtual method Activate on it.
 
CDM_CanCloseStatus CanClose (const occ::handle< CDM_Document > &aDocument)
 
void Close (const occ::handle< CDM_Document > &aDocument)
 removes the document of the current session directory and closes the document;
 
occ::handle< CDM_DocumentRetrieve (const TCollection_ExtendedString &aFolder, const TCollection_ExtendedString &aName, const bool UseStorageConfiguration=true, const occ::handle< PCDM_ReaderFilter > &theFilter=occ::handle< PCDM_ReaderFilter >(), const Message_ProgressRange &theRange=Message_ProgressRange())
 This method retrieves a document from the database. If the Document references other documents which have been updated, the latest version of these documents will be used if {UseStorageConfiguration} is true. The content of {aFolder}, {aName} and {aVersion} depends on the Database Manager system. If the DBMS is only based on the OS, {aFolder} is a directory and {aName} is the name of a file. In this case the use of the syntax with {aVersion} has no sense. For example:
 
occ::handle< CDM_DocumentRetrieve (const TCollection_ExtendedString &aFolder, const TCollection_ExtendedString &aName, const TCollection_ExtendedString &aVersion, const bool UseStorageConfiguration=true, const occ::handle< PCDM_ReaderFilter > &theFilter=occ::handle< PCDM_ReaderFilter >(), const Message_ProgressRange &theRange=Message_ProgressRange())
 This method retrieves a document from the database. If the Document references other documents which have been updated, the latest version of these documents will be used if {UseStorageConfiguration} is true. If the DBMS is only based on the OS, this syntax should not be used.
 
PCDM_ReaderStatus CanRetrieve (const TCollection_ExtendedString &theFolder, const TCollection_ExtendedString &theName, const bool theAppendMode)
 
PCDM_ReaderStatus CanRetrieve (const TCollection_ExtendedString &theFolder, const TCollection_ExtendedString &theName, const TCollection_ExtendedString &theVersion, const bool theAppendMode)
 
PCDM_ReaderStatus GetRetrieveStatus () const
 Checks status after Retrieve.
 
void Read (Standard_IStream &theIStream, occ::handle< CDM_Document > &theDocument, const occ::handle< PCDM_ReaderFilter > &theFilter=occ::handle< PCDM_ReaderFilter >(), const Message_ProgressRange &theRange=Message_ProgressRange())
 Reads theDocument from standard SEEKABLE stream theIStream, the stream should support SEEK functionality.
 
virtual occ::handle< PCDM_ReaderReaderFromFormat (const TCollection_ExtendedString &aFormat)
 Returns instance of read driver for specified format.
 
virtual occ::handle< PCDM_StorageDriverWriterFromFormat (const TCollection_ExtendedString &aFormat)
 Returns instance of storage driver for specified format.
 
bool Format (const TCollection_ExtendedString &aFileName, TCollection_ExtendedString &theFormat)
 try to retrieve a Format directly in the file or in application resource by using extension. returns True if found
 
const char16_tDefaultFolder ()
 
bool SetDefaultFolder (const char16_t *const aFolder)
 
occ::handle< CDF_MetaDataDriverMetaDataDriver () const
 returns MetaDatdDriver of this application
 
- Public Member Functions inherited from CDM_Application
virtual occ::handle< Message_MessengerMessageDriver ()
 Returns default messenger;.
 
virtual void BeginOfUpdate (const occ::handle< CDM_Document > &aDocument)
 this method is called before the update of a document. By default, writes in MessageDriver().
 
virtual void EndOfUpdate (const occ::handle< CDM_Document > &aDocument, const bool theStatus, const TCollection_ExtendedString &ErrorString)
 this method is called after the update of a document. By default, writes in MessageDriver().
 
void Write (const char16_t *const aString)
 writes the string in the application MessagerDriver.
 
virtual TCollection_ExtendedString Name () const
 Returns the application name.
 
virtual TCollection_AsciiString Version () const
 Returns the application version.
 
virtual NCollection_DataMap< TCollection_ExtendedString, occ::handle< CDM_MetaData > > & MetaDataLookUpTable ()
 Returns MetaData LookUpTable.
 
void DumpJson (Standard_OStream &theOStream, int theDepth=-1) const
 Dumps the content of me into the stream.
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter.
 
virtual ~Standard_Transient ()=default
 Destructor must be virtual.
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
 
bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
 
bool IsInstance (const char *const theTypeName) const
 Returns a true value if this is an instance of TypeName.
 
bool IsKind (const opencascade::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.
 
bool IsKind (const char *const 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.
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero.
 
int GetRefCount () const noexcept
 Get the reference counter of this object.
 
void IncrementRefCounter () noexcept
 Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
 
int DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
 
virtual void Delete () const
 Memory deallocator for transient classes.
 

Static Public Member Functions

static occ::handle< XCAFApp_ApplicationGetApplication ()
 Initializes (for the first time) and returns the static object (XCAFApp_Application) This is the only valid method to get XCAFApp_Application object, and it should be called at least once before any actions with documents in order to init application.
 
- Static Public Member Functions inherited from CDF_Application
static occ::handle< CDF_ApplicationLoad (const Standard_GUID &aGUID)
 plugs an application.
 
- Static Public Member Functions inherited from Standard_Transient
static constexpr const charget_type_name ()
 Returns a type descriptor about this object.
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class.
 

Protected Member Functions

 XCAFApp_Application ()
 
- Protected Member Functions inherited from CDF_Application
 CDF_Application ()
 
- Protected Member Functions inherited from CDM_Application
 CDM_Application ()
 
void SetDocumentVersion (const occ::handle< CDM_Document > &aDocument, const occ::handle< CDM_MetaData > &aMetaData) const
 
void SetReferenceCounter (const occ::handle< CDM_Document > &aDocument, const int aReferenceCounter)
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 
- Data Fields inherited from CDF_Application
occ::handle< CDF_MetaDataDrivermyMetaDataDriver
 
occ::handle< CDF_DirectorymyDirectory
 
- Protected Attributes inherited from TDocStd_Application
occ::handle< Resource_ManagermyResources
 
bool myIsDriverLoaded
 
- Protected Attributes inherited from CDF_Application
PCDM_ReaderStatus myRetrievableStatus
 
NCollection_IndexedDataMap< TCollection_ExtendedString, occ::handle< PCDM_RetrievalDriver > > myReaders
 
NCollection_IndexedDataMap< TCollection_ExtendedString, occ::handle< PCDM_StorageDriver > > myWriters
 

Detailed Description

Implements an Application for the DECAF documents.

Constructor & Destructor Documentation

◆ XCAFApp_Application()

XCAFApp_Application::XCAFApp_Application ( )
protected

Member Function Documentation

◆ DumpJson()

void XCAFApp_Application::DumpJson ( Standard_OStream & theOStream,
int theDepth = -1 ) const

Dumps the content of me into the stream.

◆ GetApplication()

static occ::handle< XCAFApp_Application > XCAFApp_Application::GetApplication ( )
static

Initializes (for the first time) and returns the static object (XCAFApp_Application) This is the only valid method to get XCAFApp_Application object, and it should be called at least once before any actions with documents in order to init application.

◆ InitDocument()

void XCAFApp_Application::InitDocument ( const occ::handle< CDM_Document > & aDoc) const
overridevirtual

Set XCAFDoc_DocumentTool attribute.

Reimplemented from TDocStd_Application.

◆ ResourcesName()

const char * XCAFApp_Application::ResourcesName ( )
overridevirtual

methods from TDocStd_Application

Reimplemented from TDocStd_Application.


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