| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
DLLClassManager Class Reference

`#include <DLLClassManager.h>`

Inheritance diagram for DLLClassManager:
[legend]
Collaboration diagram for DLLClassManager:
[legend]

## Public Member Functions
| DLLClassManager (IInterface *iface)
virtual | ~DLLClassManager ()
virtual StatusCode | loadModule (const std::string &module, bool fireIncident=true)
| Declare a sharable library to be used for creating instances of a given algorithm type.
virtual StatusCode | queryInterface (const InterfaceID &iid, void **pinterface)
| implementation of IInterface::queryInterface

## Private Attributes
SmartIF< ISvcLocator > | m_svclocator
SmartIF< IMessageSvc > | m_msgsvc
SmartIF< IInterface > | m_pOuter

## Additional Inherited Members
Public Types inherited from implements1< IClassManager >
typedef implements1 | base_class
| Typedef to this class.
typedef extend_interfaces1 < IClassManager > | extend_interfaces_base
| Typedef to the base of this class.
typedef extend_interfaces_base::ext_iids | interfaces
| MPL set of all the implemented interfaces.
Static Public Member Functions inherited from IInterface
static const InterfaceID & | interfaceID ()
| Return an instance of InterfaceID identifying the interface.

## Detailed Description

Definition at line 28 of file DLLClassManager.h.

## Constructor & Destructor Documentation

DLLClassManager::DLLClassManager | ( | IInterface * | iface | ) |

Definition at line 21 of file DLLClassManager.cpp.

{
m_pOuter = iface;
m_svclocator = m_pOuter;
assert(m_svclocator.isValid());
addRef(); // Initial count set to 1
}

DLLClassManager::~DLLClassManager | ( |  | ) |
| virtual

Definition at line 31 of file DLLClassManager.cpp.

{
}

## Member Function Documentation

StatusCode DLLClassManager::loadModule | ( | const std::string & | module,
|  | bool | fireIncident = `true`
| ) |  |
| virtual

Declare a sharable library to be used for creating instances of a given algorithm type.

Implements IClassManager.

Definition at line 35 of file DLLClassManager.cpp.

{
// Access the message service if not yet done already
if (!m_msgsvc.isValid()) {
m_msgsvc = m_svclocator;
}
MsgStream log(m_msgsvc, "DllClassManager");
std::string mod = module=="" ? System::moduleNameFull() : module;
if( module == "NONE" ) return StatusCode::SUCCESS;
void* libHandle = 0;
StatusCode status = StatusCode::FAILURE;
try
{
status = System::loadDynamicLib( module, &libHandle);
}
catch ( const std::exception & excpt )
{
if ( m_msgsvc )
{
log << MSG::ERROR << "Exception whilst loading " << module << " : " << excpt.what() << endmsg;
}
status = StatusCode::FAILURE;
}
if( status.isFailure() ) {
// DLL library not loaded
log << MSG::ERROR << "Could not load module " << module << endmsg;
log << MSG::ERROR << "System Error: " << System::getLastErrorString() << endmsg;
return StatusCode::FAILURE;
}
//FIXME this is a hack to avoid a very early call to moduleLoad from
//FIXME AppMgr::i_startup
if (fireIncident && module != "") {
//now fire ModuleLoadedIncident
const bool CREATEIF(true);
SmartIF<IIncidentSvc> pIncidentSvc(m_svclocator->service("IncidentSvc", CREATEIF));
if( !pIncidentSvc.isValid() ) {
log << MSG::FATAL << "Can not locate IncidentSvc" << endmsg;
throw GaudiException("Error retrieving IncidentSvc",
"DLLClassManager::DLLClassManager", StatusCode::FAILURE);
}
pIncidentSvc->fireIncident(ModuleLoadedIncident("DLLClassManager",
module) );
}
return StatusCode::SUCCESS;
}

StatusCode DLLClassManager::queryInterface | ( | const InterfaceID & | iid,
|  | void ** | pinterface
| ) |  |
| virtual

implementation of IInterface::queryInterface

Implements IInterface.

Definition at line 86 of file DLLClassManager.cpp.

{
// try local interfaces
StatusCode sc = base_class::queryInterface(iid, pinterface);
if (sc.isSuccess()) return sc;
// fall back on the owner
return m_pOuter->queryInterface(iid, pinterface);
}

## Member Data Documentation

SmartIF<IMessageSvc> DLLClassManager::m_msgsvc
| private

Definition at line 47 of file DLLClassManager.h.

SmartIF<IInterface> DLLClassManager::m_pOuter
| private

Definition at line 48 of file DLLClassManager.h.

SmartIF<ISvcLocator> DLLClassManager::m_svclocator
| private

Definition at line 42 of file DLLClassManager.h.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/GaudiCoreSvc/src/ApplicationMgr/DLLClassManager.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/GaudiCoreSvc/src/ApplicationMgr/DLLClassManager.cpp