The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research
pluginlib_t Class Reference

Specialisation of dynamiclib_t for mha plugin libraries. More...

Inheritance diagram for pluginlib_t:
Inheritance graph

Public Member Functions

 pluginlib_t (const std::string &name_)
 C'tor of the wrapper class. More...
 
virtual void * resolve (const std::string &name_) override
 Resolves the plugin callback specified by name_, e.g. More...
 
virtual ~pluginlib_t ()
 D'tor. More...
 
- Public Member Functions inherited from dynamiclib_t
 dynamiclib_t (const std::string &name_)
 C'tor of the wrapper class. More...
 
virtual void * resolve_checked (const std::string &name_)
 Resolves the function specified by name_ and returns a pointer to it or throws an exception if the function was not found. More...
 
virtual ~dynamiclib_t ()
 D'tor. More...
 
virtual const std::string & getmodulename () const
 Returns unqualified filename of the wrapped library sans file suffix. More...
 
virtual const std::string & getname () const
 

Additional Inherited Members

- Protected Member Functions inherited from dynamiclib_t
 dynamiclib_t ()
 Default constructor. More...
 
void load_lib (const std::string &name_)
 Loads the library specified in name_ and saves a handle in h. More...
 
- Protected Attributes inherited from dynamiclib_t
std::string fullname
 Fully qualified file name of the library. More...
 
std::string modulename
 Unqualified file name of the library. More...
 
mha_libhandle_t h
 Handle to the shared library. More...
 

Detailed Description

Specialisation of dynamiclib_t for mha plugin libraries.

Constructor & Destructor Documentation

◆ pluginlib_t()

pluginlib_t::pluginlib_t ( const std::string &  name_)
explicit

C'tor of the wrapper class.

Takes a the the file name of a shared libary w/o the suffix as argument, searches for the library in the system-dependent standard paths for libraries and in MHA_LIBRARY_DIR. Calls load_lib for the actual work.

Parameters
name_File name of the shared library, without suffix

◆ ~pluginlib_t()

pluginlib_t::~pluginlib_t ( )
virtual

D'tor.

Member Function Documentation

◆ resolve()

void * pluginlib_t::resolve ( const std::string &  name_)
overridevirtual

Resolves the plugin callback specified by name_, e.g.

'process', 'prepare', etc... and returns a pointer to it or a nullptr if the function was not found. Automatically adds the required prefixes and suffixes for dynamically/statically compiled mha plugins

Parameters
name_Name of the function to be resolved
Returns
Pointer to the function

Reimplemented from dynamiclib_t.


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