///////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
// All rights reserved.
//
// This software and its documentation and related materials are owned by
// the Alliance. The software may only be incorporated into application
// programs owned by members of the Alliance, subject to a signed
// Membership Agreement and Supplemental Software License Agreement with the
// Alliance. The structure and organization of this software are the valuable
// trade secrets of the Alliance and its suppliers. The software is also
// protected by copyright law and international treaty provisions. Application
// programs incorporating this software must include the following statement
// with their copyright notices:
//
// This application incorporates Open Design Alliance software pursuant to a license
// agreement with Open Design Alliance.
// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
// All rights reserved.
//
// By use of this software, its documentation or related materials, you
// acknowledge and accept the above terms.
///////////////////////////////////////////////////////////////////////////////
#ifndef _EXTERNAL_TABLE_DATA_MODULE_H_
#define _EXTERNAL_TABLE_DATA_MODULE_H_
#include "StepIExternalDBModule.h"
#include "ExternalTableDataExport.h"
class OdExternalTableDataImpl;
/** \details
The class for external databases management.
*/
class EXTERNALTABLEDATA_EXPORT OdExternalTableDataModule : public OdStepIExternalDBModule
{
public:
/** \details
Initializes the external database module.
*/
virtual void initApp() final;
/** \details
De-initializes the external database module.
*/
virtual void uninitApp() final;
/** \details
Sets the application services object for loading external files.
\param pServices [in] A raw pointer to the application services object.
*/
virtual void setHostAppServices(OdStepHostAppServices* pServices) override;
/** \details
Loads external database file if it don't loaded yet and retrieves it id.
\param name [in] The database file name.
\param name [in] The database file version.
\returns An unique id of database. Valid id should be a positive.
If retrieves value less or equal zero, it means a loading error.
*/
virtual int loadDatabase(const OdAnsiString& name, const OdAnsiString& version = OdAnsiString()) final;
/** \details
Retrieves the object from database.
\param objectName [in] The object name in database.
\param name [in] The database id.
\param isKindOf [in] The type of database object.
\returns An object from database. If can't find object, returns null pointer.
*/
virtual OdRxObjectPtr getDatabaseObject(const OdAnsiString& objectName, int databaseId, const OdAnsiString& isKindOf = OdAnsiString()) final;
/** \details
Unload database from module.
\param databaseId [in] The database id.
\returns True if unloading is successful, otherwise false.
*/
virtual bool unloadDatabase(int databaseId) final;
private:
OdExternalTableDataImpl* m_pImpl;
};
/** \details
A data type that represents a smart pointer to an object.
*/
typedef OdSmartPtr OdExternalTableDataPtr;
#endif // _EXTERNAL_TABLE_DATA_MODULE_H_