NCBI C++ ToolKit
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
CDataLoaderFactory Class Referenceabstract

Search Toolkit Book for CDataLoaderFactory

#include <objmgr/data_loader_factory.hpp>

+ Inheritance diagram for CDataLoaderFactory:
+ Collaboration diagram for CDataLoaderFactory:

Public Types

typedef IClassFactory< CDataLoaderTParent
typedef TParent::SDriverInfo TDriverInfo
typedef TParent::TDriverList TDriverList
- Public Types inherited from IClassFactory< CDataLoader >
typedef CDataLoader TInterface
typedef ncbi::SDriverInfo SDriverInfo
typedef ncbi::TDriverList TDriverList
typedef CDefaultDriverVersion< CDataLoaderTDefaultDriverVersion

Public Member Functions

 CDataLoaderFactory (const string &driver_name, int patch_level=-1)
virtual ~CDataLoaderFactory ()
const stringGetDriverName (void) const
void GetDriverVersions (TDriverList &info_list) const
CDataLoaderCreateInstance (const string &driver=kEmptyStr, CVersionInfo version=NCBI_INTERFACE_VERSION(CDataLoader), const TPluginManagerParamTree *params=0) const
 Create driver's instance. More...
- Public Member Functions inherited from IClassFactory< CDataLoader >
virtual void GetDriverVersions (TDriverList &driver_list) const=0
 Versions of the interface exported by the factory. More...
virtual ~IClassFactory (void)

Protected Member Functions

bool ValidParams (const TPluginManagerParamTree *params) const
virtual CDataLoaderCreateAndRegister (CObjectManager &om, const TPluginManagerParamTree *params) const =0
CObjectManager::EIsDefault GetIsDefault (const TPluginManagerParamTree *params) const
CObjectManager::TPriority GetPriority (const TPluginManagerParamTree *params) const
- Protected Member Functions inherited from IClassFactory< CDataLoader >
string GetParam (const string &driver_name, const TPluginManagerParamTree *params, const string &param_name, bool mandatory, const string &default_value) const
 Utility function to get an element of parameter tree Throws an exception when mandatory parameter is missing (or returns the default value) More...
const stringGetParam (const string &driver_name, const TPluginManagerParamTree *params, const string &param_name, bool mandatory) const
 This version always defaults to the empty string so that it can safely return a reference. More...

Private Member Functions

CObjectManagerx_GetObjectManager (const TPluginManagerParamTree *params) const

Private Attributes

CVersionInfo m_DriverVersionInfo
string m_DriverName

Additional Inherited Members

- Static Public Member Functions inherited from IClassFactory< CDataLoader >
static const CVersionInfoGetDefaultDrvVers (void)

Detailed Description

Definition at line 61 of file data_loader_factory.hpp.

Member Typedef Documentation

◆ TDriverInfo

Definition at line 66 of file data_loader_factory.hpp.

◆ TDriverList

Definition at line 67 of file data_loader_factory.hpp.

◆ TParent

Definition at line 65 of file data_loader_factory.hpp.

Constructor & Destructor Documentation

◆ CDataLoaderFactory()

CDataLoaderFactory::CDataLoaderFactory ( const string driver_name,
int  patch_level = -1 

Definition at line 41 of file data_loader_factory.cpp.

References _ASSERT.

◆ ~CDataLoaderFactory()

virtual CDataLoaderFactory::~CDataLoaderFactory ( )

Definition at line 70 of file data_loader_factory.hpp.

Member Function Documentation

◆ CreateAndRegister()

virtual CDataLoader* CDataLoaderFactory::CreateAndRegister ( CObjectManager om,
const TPluginManagerParamTree params 
) const
protectedpure virtual

◆ CreateInstance()

CDataLoader * CDataLoaderFactory::CreateInstance ( const string driver = kEmptyStr,
CVersionInfo  version = NCBI_INTERFACE_VERSION(CDataLoader),
const TPluginManagerParamTree params = 0 
) const

Create driver's instance.

Function creates driver by its name and version. The requirements is the drivers version should match the interface up to the patch level.

driverRequested driver's name (not the name of the supported interface)
versionRequested interface version (as understood by the caller). By default it will be passed the version which is current from the calling code's point of view.

Implements IClassFactory< CDataLoader >.

Definition at line 60 of file data_loader_factory.cpp.

References _ASSERT, CreateAndRegister(), CVersionInfo::eNonCompatible, m_DriverName, NCBI_INTERFACE_VERSION, om, version, and x_GetObjectManager().

◆ GetDriverName()

const string& CDataLoaderFactory::GetDriverName ( void  ) const

◆ GetDriverVersions()

void CDataLoaderFactory::GetDriverVersions ( TDriverList info_list) const

Definition at line 54 of file data_loader_factory.cpp.

References m_DriverName, and m_DriverVersionInfo.

◆ GetIsDefault()

CObjectManager::EIsDefault CDataLoaderFactory::GetIsDefault ( const TPluginManagerParamTree params) const

◆ GetPriority()

CObjectManager::TPriority CDataLoaderFactory::GetPriority ( const TPluginManagerParamTree params) const

◆ ValidParams()

bool CDataLoaderFactory::ValidParams ( const TPluginManagerParamTree params) const

◆ x_GetObjectManager()

CObjectManager * CDataLoaderFactory::x_GetObjectManager ( const TPluginManagerParamTree params) const

Member Data Documentation

◆ m_DriverName

string CDataLoaderFactory::m_DriverName

◆ m_DriverVersionInfo

CVersionInfo CDataLoaderFactory::m_DriverVersionInfo

Definition at line 97 of file data_loader_factory.hpp.

Referenced by GetDriverVersions().

The documentation for this class was generated from the following files:
Modified on Fri Feb 23 11:50:57 2024 by rev. 669887