33 typedef map<string,plugin*> plugins_map_t;
36 plugins_map_t& plugins_map() {
37 static plugins_map_t pmap;
42 plugins_map()[p->
id()] = p;
45 plugin* plugin::find(
const std::string& name){
46 plugin* p = plugins_map()[name];
51 void* plugin::instance(
const std::string& name,
const config& cfg){
52 return plugin::find(name)->
create(cfg);
55 vector<plugin*> plugin::all() {
57 for(plugins_map_t::iterator i = plugins_map().begin(); i != plugins_map().end(); i++) {
58 v.push_back(i->second);
64 plugin::help_t plugin::help;
67 vector<plugin*> ps = plugin::all();
68 out <<
"Found " << ps.size() <<
" plugins " << endl;
69 for(
int i = 0; i < ps.size(); i++){
70 out << ps[i]->id() <<
"\t" << ps[i]->description() << endl;