MOGAL
Public Member Functions | Protected Member Functions

mogal::ModuleBase Class Reference

Helper class for loading modules. More...

#include <modulebase.h>

Inheritance diagram for mogal::ModuleBase:
Inheritance graph
[legend]

List of all members.

Public Member Functions

bool open (const std::string &modulePath)
 Opens a module.
bool open (const std::string &baseDirectory, const std::string &moduleName)
 Opens a module.
bool close ()
 Close a previously opened module.
bool isOpen () const
 Returns true if a module has been successfully opened, false otherwise.

Protected Member Functions

virtual void onFoundFunctionName (const std::string &name, void *pFunction)=0
 This function is called for each function name which has been registered by a call to ModuleBase::registerFunctionName and which is present in the module.
void registerFunctionName (const std::string &name)
 Register a function name which should be present in a module when it is opened.

Detailed Description


Member Function Documentation

bool mogal::ModuleBase::close ( )
bool mogal::ModuleBase::isOpen ( ) const [inline]
virtual void mogal::ModuleBase::onFoundFunctionName ( const std::string &  name,
void *  pFunction 
) [protected, pure virtual]

This function is called for each function name which has been registered by a call to ModuleBase::registerFunctionName and which is present in the module.

Parameters:
nameName of the function.
pFunctionEntry point to the function.
bool mogal::ModuleBase::open ( const std::string &  baseDirectory,
const std::string &  moduleName 
)

Opens a module. This function constructs the complete path from the arguments and calls the function below.

Parameters:
baseDirectoryDirectory in which the module is located.
moduleNameFile name of the module
bool mogal::ModuleBase::open ( const std::string &  modulePath)

This function opens a module and verifies that all function names which have been registered by ModuleBase::registerFunctionName are present in the module. For each of these function names, the ModuleBase::onFoundFunctionName member function will be called.

Parameters:
modulePathComplete path to the module.
void mogal::ModuleBase::registerFunctionName ( const std::string &  name) [inline, protected]

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