Nemiver  0.3
Classes | Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
nemiver::common::DynamicModule Class Referenceabstract

The base class for loadable modules. More...

#include <nmv-dynamic-module.h>

Inheritance diagram for nemiver::common::DynamicModule:
nemiver::common::Object

Classes

struct  Config
 
struct  Info
 
class  Loader
 

Public Types

typedef SafePtr< Config, ObjectRef, ObjectUnrefConfigSafePtr
 
typedef SafePtr< Loader, ObjectRef, ObjectUnrefLoaderSafePtr
 

Public Member Functions

Loaderget_module_loader ()
 get the module loader class More...
 
const UStringget_real_library_path () const
 gets the path of the library this module has been instanciated from. More...
 
const UStringget_name () const
 gets the (short) name of this dynmod More...
 
virtual ~DynamicModule ()
 destructor More...
 
virtual void get_info (Info &a_info) const =0
 get module info More...
 
virtual void do_init ()=0
 module init routinr More...
 
virtual bool lookup_interface (const std::string &a_iface_name, DynModIfaceSafePtr &a_iface)=0
 lookup the interface of a service object More...
 
template<class T >
bool lookup_interface (const std::string &a_iface_name, SafePtr< T, ObjectRef, ObjectUnref > &a_iface)
 
- Public Member Functions inherited from nemiver::common::Object
 Object ()
 
 Object (Object const &)
 
Objectoperator= (Object const &)
 
virtual ~Object ()
 
void ref ()
 
void unref ()
 
void enable_refcount (bool a_enabled=true)
 
bool is_refcount_enabled () const
 
long get_refcount () const
 
void attach_object (const UString &a_key, const Object *a_object)
 
bool get_attached_object (const UString &a_key, const Object *&a_object)
 

Protected Member Functions

 DynamicModule ()
 

Friends

class Loader
 
class DynamicModuleManager
 
bool gpil_common_create_loadable_module_instance (void **a_new_inst)
 

Additional Inherited Members

- Protected Attributes inherited from nemiver::common::Object
SafePtr< ObjectPrivm_priv
 

Detailed Description

The base class for loadable modules.

A loadable module is a dynamic library that contains an instance of DynamicModule.

Member Typedef Documentation

◆ ConfigSafePtr

◆ LoaderSafePtr

Constructor & Destructor Documentation

◆ DynamicModule()

nemiver::common::DynamicModule::DynamicModule ( )
protected

◆ ~DynamicModule()

virtual nemiver::common::DynamicModule::~DynamicModule ( )
virtual

destructor

Member Function Documentation

◆ do_init()

virtual void nemiver::common::DynamicModule::do_init ( )
pure virtual

module init routinr

This abstract method must be implemented by type that extend DynamicModule

Referenced by nemiver::common::DynamicModuleManager::load_iface().

◆ get_info()

virtual void nemiver::common::DynamicModule::get_info ( Info a_info) const
pure virtual

get module info

◆ get_module_loader()

Loader* nemiver::common::DynamicModule::get_module_loader ( )

get the module loader class

Returns
the module loader

Referenced by nemiver::common::load_iface_using_context().

◆ get_name()

const UString& nemiver::common::DynamicModule::get_name ( ) const

gets the (short) name of this dynmod

Referenced by nemiver::common::load_iface_using_context().

◆ get_real_library_path()

const UString& nemiver::common::DynamicModule::get_real_library_path ( ) const

gets the path of the library this module has been instanciated from.

Returns
the path of the library the module has been instanciated from.

◆ lookup_interface() [1/2]

virtual bool nemiver::common::DynamicModule::lookup_interface ( const std::string &  a_iface_name,
DynModIfaceSafePtr a_iface 
)
pure virtual

lookup the interface of a service object

Creates a service object and returns a pointer to its interface This abstract method must be implemented by types that extend DynamicModule

Parameters
a_iface_namethe name of the service object interface to return.
a_ifaceout parameter. The returned service object interface, if and only if this function returns true. Otherwise, this parameter is not set by the function.
Returns
true if a service object interface with the name a_iface_name has been found, false otherwise.

Referenced by nemiver::common::DynamicModuleManager::load_iface().

◆ lookup_interface() [2/2]

template<class T >
bool nemiver::common::DynamicModule::lookup_interface ( const std::string &  a_iface_name,
SafePtr< T, ObjectRef, ObjectUnref > &  a_iface 
)
inline

Friends And Related Function Documentation

◆ DynamicModuleManager

friend class DynamicModuleManager
friend

◆ gpil_common_create_loadable_module_instance

bool gpil_common_create_loadable_module_instance ( void **  a_new_inst)
friend

◆ Loader

friend class Loader
friend

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