///////////////////////////////////////////////////////////////////////////////
// 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 _STEP_I_EXTERNAL_DB_MODULE_H_
#define _STEP_I_EXTERNAL_DB_MODULE_H_
#include "OdaCommon.h"
#include "RxDynamicModule.h"
#include "StepBuildOptions.h"
#include "StepCompound.h"
#include "StepHostAppServices.h"
/** \details
The interface class for external database module.
*/
class STEPCORE_EXPORT OdStepIExternalDBModule : public OdRxModule
{
public:
/** \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) = 0;
/** \details
Loads external database file.
\param name [in] The database file name.
\param name [in] The database file version.
\returns An unique id of database.
*/
virtual int loadDatabase(const OdAnsiString& name, const OdAnsiString& version = OdAnsiString()) = 0;
/** \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.
*/
virtual OdRxObjectPtr getDatabaseObject(const OdAnsiString& objectName, int databaseId, const OdAnsiString& isKindOf = OdAnsiString()) = 0;
/** \details
Unload database from module.
\param databaseId [in] The database id.
\returns True if unloading is successful, otherwise false.
*/
virtual bool unloadDatabase(int databaseId) = 0;
};
/** \details
A data type that represents a smart pointer to an object.
*/
typedef OdSmartPtr OdStepIExternalDBModulePtr;
#endif //_STEP_I_EXTERNAL_DB_MODULE_H_