libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
crn::ModuleManager< Category > Class Template Reference

A dynamic module manager. More...

#include <CRNModule.h>

Public Member Functions

int LoadDirectory (const Path &dirname, const String &ext=U"")
 Loads modules contained in a directory. More...
 
std::vector< std::shared_ptr
< Category > > 
GetModules () const
 Retrieves the modules that implement a given interface. More...
 
bool RegisterModule (std::shared_ptr< Category > mod)
 Registers a new module. DO NOT USE THIS METHOD DIRECTLY. Call CRN_BEGIN/END_MODULE. More...
 
 ModuleManager ()
 Default constructor. More...
 
 ~ModuleManager ()
 Destructor frees handles. More...
 

Detailed Description

template<class Category>
class crn::ModuleManager< Category >

A dynamic module manager.

A dynamic module manager.

The Category class declaration must call the macro CRN_DECLARE_MODULE(Category).

Author
Yann LEYDIER
Date
May 2010

Definition at line 78 of file CRNModule.h.

Constructor & Destructor Documentation

template<class Category >
crn::ModuleManager< Category >::ModuleManager ( )
inline

Default constructor.

Definition at line 156 of file CRNModule.h.

template<class Category >
crn::ModuleManager< Category >::~ModuleManager ( )
inline

Destructor frees handles.

Definition at line 158 of file CRNModule.h.

Member Function Documentation

template<class Category >
std::vector<std::shared_ptr<Category> > crn::ModuleManager< Category >::GetModules ( ) const
inline

Retrieves the modules that implement a given interface.

Definition at line 135 of file CRNModule.h.

template<class Category >
int crn::ModuleManager< Category >::LoadDirectory ( const Path dirname,
const String ext = U"" 
)
inline

Loads modules contained in a directory.

Loads modules contained in a directory.

Parameters
[in]dirnamethe path to the module files
[in]extthe extension of the files to load (leave blank to load all files)
Returns
the number of modules loaded

Definition at line 89 of file CRNModule.h.

template<class Category >
bool crn::ModuleManager< Category >::RegisterModule ( std::shared_ptr< Category >  mod)
inline

Registers a new module. DO NOT USE THIS METHOD DIRECTLY. Call CRN_BEGIN/END_MODULE.

Definition at line 141 of file CRNModule.h.


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