eXperiment robotics framework

ManagerPlugins Class Reference
[Manager of Plugins]

Class to manage Plugins. More...

#include <erf/erf_manager_plugins.hpp>>

List of all members.

Public Types

typedef Plugin *(* PluginInitFn )(void)
 typedef to simplify plugin initialization.

Public Member Functions

 ManagerPlugins ()
 constructor.
 ~ManagerPlugins ()
 destructor.
PluginaddPlugin (string pname, string id="")
 A add the plugin to a list containing all the plugins.
void addPlugin (Plugin *p, string id="")
void enqueueForInit (Plugin *p)
int getPluginCount () const
 count plugins.
void initPlugins ()
 Goes through a plugin list and runs their init funcion.
const std::list< Plugin * > getPlugins ()
 Get a list with all plugins.
bool delPlugin (Plugin *p)
 remove a plugin.
void enqueueForRemoval (Plugin *p)
 Schedule a plugin for removal.
void cleanPlugins ()
 Remove unused plugins.
void deletePlugins ()
 Remove all plugins.
PlugingetPluginById (string id)
 get plugin by id.
PlugingetPluginByLibrary (string id)
bool runPlugins ()
 go through each plugin and call run.

Public Attributes

list< string > plugin_search_paths
 path to search for plugins.
Plugins pluginsForInit
 list of plugin handles.
Plugins pluginsForRemoval
PluginHandles pluginHandles

Friends

std::ostream & operator<< (std::ostream &os, const ManagerPlugins &c)
 print to stdout.


Detailed Description

Class to manage Plugins.

Definition at line 38 of file erf_manager_plugins.hpp.


Member Typedef Documentation

typedef to simplify plugin initialization.

Returns:
returns a pointer to a plugin.


Constructor & Destructor Documentation

ManagerPlugins::ManagerPlugins (  ) 

constructor.

ManagerPlugins::~ManagerPlugins (  ) 

destructor.


Member Function Documentation

Plugin* ManagerPlugins::addPlugin ( string  pname,
string  id = "" 
)

A add the plugin to a list containing all the plugins.

  • pname a path + name of plugin, e.g. "/tmp/liblaser.la"
    Returns:
    a pointer to the new plugin.

void ManagerPlugins::addPlugin ( Plugin p,
string  id = "" 
)

void ManagerPlugins::enqueueForInit ( Plugin p  ) 

int ManagerPlugins::getPluginCount (  )  const

count plugins.

Returns:
number of plugins.

void ManagerPlugins::initPlugins (  ) 

Goes through a plugin list and runs their init funcion.

const std::list<Plugin *> ManagerPlugins::getPlugins (  ) 

Get a list with all plugins.

bool ManagerPlugins::delPlugin ( Plugin p  ) 

remove a plugin.

Todo:
rename to delPluginFirst
Returns:
true if deletion was sucessful.
  • p the plugin to delete.

void ManagerPlugins::enqueueForRemoval ( Plugin p  ) 

Schedule a plugin for removal.

Returns:
true if deletion was sucessful.
  • p the plugin to delete.

void ManagerPlugins::cleanPlugins (  ) 

Remove unused plugins.

void ManagerPlugins::deletePlugins (  ) 

Remove all plugins.

Plugin* ManagerPlugins::getPluginById ( string  id  ) 

get plugin by id.

Returns:
pointer to plugin.
  • the id of the plugin to search for.

Plugin* ManagerPlugins::getPluginByLibrary ( string  id  ) 

bool ManagerPlugins::runPlugins (  ) 

go through each plugin and call run.

Returns:
true if ok.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const ManagerPlugins c 
) [friend]

print to stdout.


Member Data Documentation

path to search for plugins.

Definition at line 47 of file erf_manager_plugins.hpp.

list of plugin handles.

Definition at line 49 of file erf_manager_plugins.hpp.

Definition at line 50 of file erf_manager_plugins.hpp.

Definition at line 51 of file erf_manager_plugins.hpp.


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

The miarn project - written by Joao Xavier