CFx SDK Documentation  2020SP3
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
OdDAI::Repository Class Reference

#include <daiRepository.h>

Inheritance diagram for OdDAI::Repository:
OdDAI::SessionInstance OdRxObject

Public Member Functions

 ODRX_DECLARE_MEMBERS (Repository)
 
 Repository ()
 
void setAppServices (OdDAIHostAppServicesBase *svcs)
 
OdString name () const
 
void name (const OdString &name)
 
const OdArray< ModelPtr > & models () const
 
ModelPtr createModel (const OdAnsiString &name, const OdAnsiString &schemaName)
 
ModelPtr createModel (const OdAnsiString &name, const SchemaPtr schema)
 
const ModelPtr getModel (ModelPtr &modelPtr) const
 
ModelPtr getModelRW (ModelPtr &modelPtr)
 
const ModelPtr getModel (const OdAnsiString &modelName=REPOSITORY_DEFAULE_MODEL_NAME) const
 
ModelPtr getModelRW (const OdAnsiString &modelName=REPOSITORY_DEFAULE_MODEL_NAME)
 
void deleteModel (ModelPtr &model)
 
SdaiAccessMode getModelAccessMode (const OdAnsiString &modelName=REPOSITORY_DEFAULE_MODEL_NAME) const
 
OdResult initialize ()
 
OdArray< SchemaPtrschemas ()
 
OdHeaderSectionPtr getHeaderSection ()
 
OdResult readFile (const OdString &fileName)
 
OdResult readStream (OdStreamBufPtr pStream)
 
virtual OdResult writeFile (const OdString &filename, bool saveLogFile=false)
 
- Public Member Functions inherited from OdDAI::SessionInstance
 ODRX_DECLARE_MEMBERS (SessionInstance)
 
- Public Member Functions inherited from OdRxObject
 ODRX_HEAP_OPERATORS ()
 
 OdRxObject ()
 
virtual ~OdRxObject ()
 
virtual OdRxObjectqueryX (const OdRxClass *pClass) const
 
virtual OdRxObjectx (const OdRxClass *pClass) const
 
virtual OdRxClassisA () const
 
virtual void addRef ()=0
 
virtual void release ()=0
 
virtual long numRefs () const
 
bool isKindOf (const OdRxClass *pClass) const
 
virtual OdRxObjectPtr clone () const
 
virtual void copyFrom (const OdRxObject *pSource)
 
virtual OdRx::Ordering comparedTo (const OdRxObject *pOther) const
 
virtual bool isEqualTo (const OdRxObject *pOther) const
 

Static Public Member Functions

static OdHeaderSectionPtr readHeaderSection (const OdString &fileName)
 
static OdHeaderSectionPtr readHeaderSection (OdStreamBufPtr pStream)
 
- Static Public Member Functions inherited from OdRxObject
static OdRxObjectPtr cast (const OdRxObject *pointer)
 
static OdRxClassdesc ()
 

Protected Member Functions

bool setModelAccessMode (ModelPtr &modelToSet, SdaiAccessMode accessMode) const
 

Protected Attributes

OdString m_name
 
OdHeaderSectionPtr m_pHeaderSection
 
OdArray< ModelPtrm_models
 
OdArray< SchemaPtrm_schemas
 
OdDAIHostAppServicesBasem_svcs
 

Friends

class Session
 

Detailed Description

Definition at line 53 of file daiRepository.h.

Constructor & Destructor Documentation

◆ Repository()

OdDAI::Repository::Repository ( )

Member Function Documentation

◆ createModel() [1/2]

ModelPtr OdDAI::Repository::createModel ( const OdAnsiString &  name,
const OdAnsiString &  schemaName 
)

Create a new model with name and schema in the repository.

Parameters
name[in] name of created model
schema[in] schema name of created model
Returns
ModelPtr

◆ createModel() [2/2]

ModelPtr OdDAI::Repository::createModel ( const OdAnsiString &  name,
const SchemaPtr  schema 
)

Create a new model with name and schema in the repository.

Parameters
name[in] name of created model
schema[in] schema of created model
Returns
ModelPtr

◆ deleteModel()

void OdDAI::Repository::deleteModel ( ModelPtr model)

◆ getHeaderSection()

OdHeaderSectionPtr OdDAI::Repository::getHeaderSection ( )

Retrieves the file object's header section.

Returns
Returns a smart pointer to the <link OdDAI::OdHeaderSection, OdHeaderSection> object that represents the file object's header section.

◆ getModel() [1/2]

const ModelPtr OdDAI::Repository::getModel ( const OdAnsiString &  modelName = REPOSITORY_DEFAULE_MODEL_NAME) const

Get model in read only mode.

Parameters
modelPtr[in] model name which should be open in read only mode
Returns
ModelPtr in read only mode

◆ getModel() [2/2]

const ModelPtr OdDAI::Repository::getModel ( ModelPtr modelPtr) const

Get model in read only mode.

Parameters
modelPtr[in] model which should be open in read only mode
Returns
ModelPtr in read mode

◆ getModelAccessMode()

SdaiAccessMode OdDAI::Repository::getModelAccessMode ( const OdAnsiString &  modelName = REPOSITORY_DEFAULE_MODEL_NAME) const

Get model access mode by model name.

Parameters
modelName[in] model name
Returns
model access mode

◆ getModelRW() [1/2]

ModelPtr OdDAI::Repository::getModelRW ( const OdAnsiString &  modelName = REPOSITORY_DEFAULE_MODEL_NAME)

Get model in read only mode.

Parameters
modelName[in] model name which should be open in read/write mode
Returns
ModelPtr in read/write mode

◆ getModelRW() [2/2]

ModelPtr OdDAI::Repository::getModelRW ( ModelPtr modelPtr)

Get model in read only mode.

Parameters
modelPtr[in] model which should be open in read/write mode
Returns
ModelPtr in read/write mode

◆ initialize()

OdResult OdDAI::Repository::initialize ( )

◆ models()

const OdArray<ModelPtr>& OdDAI::Repository::models ( ) const
inline

Definition at line 89 of file daiRepository.h.

◆ name() [1/2]

OdString OdDAI::Repository::name ( ) const
inline

Retrieves the current name of repository.

Returns
Returns a string that contains the name.

Definition at line 76 of file daiRepository.h.

◆ name() [2/2]

void OdDAI::Repository::name ( const OdString name)
inline

Assigns a name to the repository.

Definition at line 84 of file daiRepository.h.

◆ ODRX_DECLARE_MEMBERS()

OdDAI::Repository::ODRX_DECLARE_MEMBERS ( Repository  )

◆ readFile()

OdResult OdDAI::Repository::readFile ( const OdString fileName)

◆ readHeaderSection() [1/2]

static OdHeaderSectionPtr OdDAI::Repository::readHeaderSection ( const OdString fileName)
static

Reads the header section data of a specified IFC file.

Parameters
fileName[in] A string that contains an IFC file's name.
Returns
Returns a smart pointer to an instance of the <link OdDAI::OdHeaderSection, OdHeaderSection> class that contains read data.
Remarks
This method is used to extract information about the IFC file without reading all of its content.

◆ readHeaderSection() [2/2]

static OdHeaderSectionPtr OdDAI::Repository::readHeaderSection ( OdStreamBufPtr  pStream)
static

Reads the header section data from a specified stream buffer associated with an IFC file.

Parameters
pStream[in] A raw pointer to a file stream buffer to read data from.
Returns
Returns a smart pointer to an instance of the <link OdDAI::OdHeaderSection, OdHeaderSection> class that contains read data.
Remarks
This method is used to extract information about the IFC file without reading all of its content.

◆ readStream()

OdResult OdDAI::Repository::readStream ( OdStreamBufPtr  pStream)

Reads data from a specified stream buffer.

Parameters
pStream[in] A smart pointer to the stream buffer object to read data from.
Returns
Returns eOk if the data was successfully read; otherwise, the method returns an appropriate error.

◆ schemas()

OdArray<SchemaPtr> OdDAI::Repository::schemas ( )
inline

Definition at line 153 of file daiRepository.h.

◆ setAppServices()

void OdDAI::Repository::setAppServices ( OdDAIHostAppServicesBase svcs)
inline

Sets a new application services object.

Parameters
svcs[in] A raw pointer to the <link OdDAIHostAppServicesBase, OdDAIHostAppServicesBase> object to be assigned with the repository.

Definition at line 67 of file daiRepository.h.

◆ setModelAccessMode()

bool OdDAI::Repository::setModelAccessMode ( ModelPtr modelToSet,
SdaiAccessMode  accessMode 
) const
protected

◆ writeFile()

virtual OdResult OdDAI::Repository::writeFile ( const OdString filename,
bool  saveLogFile = false 
)
virtual

Writes data from the file object to a physical file.

Parameters
filename[in] A string that contains the full path to the output file to write data.
saveLogFile[in] A flag that determines whether the log file should be also written (if equal to true) or not (if equal to false).
Returns
Returns eOk if the data was successfully written; otherwise, the method returns an appropriate error.

Friends And Related Function Documentation

◆ Session

friend class Session
friend

Definition at line 211 of file daiRepository.h.

Member Data Documentation

◆ m_models

OdArray<ModelPtr> OdDAI::Repository::m_models
protected

Definition at line 206 of file daiRepository.h.

◆ m_name

OdString OdDAI::Repository::m_name
protected

Definition at line 203 of file daiRepository.h.

◆ m_pHeaderSection

OdHeaderSectionPtr OdDAI::Repository::m_pHeaderSection
protected

Definition at line 204 of file daiRepository.h.

◆ m_schemas

OdArray<SchemaPtr> OdDAI::Repository::m_schemas
protected

Definition at line 207 of file daiRepository.h.

◆ m_svcs

OdDAIHostAppServicesBase* OdDAI::Repository::m_svcs
protected

Definition at line 209 of file daiRepository.h.


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