Gaudi Framework, version v23r6

Home   Generated: Wed Jan 30 2013
 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:
Inheritance graph
[legend]
Collaboration diagram for DLLClassManager:
Collaboration graph
[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< ISvcLocatorm_svclocator
 
SmartIF< IMessageSvcm_msgsvc
 
SmartIF< IInterfacem_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 InterfaceIDinterfaceID ()
 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;
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()) {
}
MsgStream log(m_msgsvc, "DllClassManager");
std::string mod = module=="" ? System::moduleNameFull() : module;
if( module == "NONE" ) return StatusCode::SUCCESS;
void* libHandle = 0;
try
{
status = System::loadDynamicLib( module, &libHandle);
}
catch ( const std::exception & excpt )
{
if ( m_msgsvc )
{
log << MSG::ERROR << "Exception whilst loading " << module << " : " << excpt.what() << endmsg;
}
}
if( status.isFailure() ) {
// DLL library not loaded
log << MSG::ERROR << "Could not load module " << module << endmsg;
log << MSG::ERROR << "System Error: " << System::getLastErrorString() << endmsg;
}
//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) );
}
}
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:

Generated at Wed Jan 30 2013 17:13:44 for Gaudi Framework, version v23r6 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004