| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
capi_pluginservice.cpp File Reference
`#include <vector>`
`#include "capi_pluginservice.h"`
`#include <Gaudi/PluginService.h>`
`#include <iostream>`
Include dependency graph for capi_pluginservice.cpp:

Go to the source code of this file.

## Functions
cgaudi_pluginsvc_t | cgaudi_pluginsvc_instance ()
int | cgaudi_pluginsvc_get_factory_size (cgaudi_pluginsvc_t self)
cgaudi_factory_t | cgaudi_pluginsvc_get_factory_at (cgaudi_pluginsvc_t self, int n)
const char * | cgaudi_factory_get_library (cgaudi_factory_t self)
const char * | cgaudi_factory_get_type (cgaudi_factory_t self)
const char * | cgaudi_factory_get_rtype (cgaudi_factory_t self)
const char * | cgaudi_factory_get_classname (cgaudi_factory_t self)
int | cgaudi_factory_get_property_size (cgaudi_factory_t self)
cgaudi_property_t | cgaudi_factory_get_property_at (cgaudi_factory_t self, int n)
const char * | cgaudi_property_get_key (cgaudi_property_t self)
const char * | cgaudi_property_get_value (cgaudi_property_t self)

## Function Documentation

const char* cgaudi_factory_get_classname | ( | cgaudi_factory_t | self | ) |

Definition at line 73 of file capi_pluginservice.cpp.

{
Registry &reg = Registry::instance();
std::string id = self.id;
const Registry::FactoryInfo& fi = reg.getInfo(id);
return fi.className.c_str();
}

const char* cgaudi_factory_get_library | ( | cgaudi_factory_t | self | ) |

Definition at line 46 of file capi_pluginservice.cpp.

{
Registry &reg = Registry::instance();
std::string id = self.id;
const Registry::FactoryInfo& fi = reg.getInfo(id);
return fi.library.c_str();
}

cgaudi_property_t cgaudi_factory_get_property_at | ( | cgaudi_factory_t | self,
|  | int | n
| ) |  |

Definition at line 92 of file capi_pluginservice.cpp.

{
cgaudi_property_t cprop;
cprop.registry = self.registry;
cprop.id = self.id;
cprop.key = NULL;
Registry &reg = Registry::instance();
std::string id = cprop.id;
const Registry::FactoryInfo& fi = reg.getInfo(id);
int i = 0;
for (Registry::Properties::const_iterator
itr = fi.properties.begin(),
iend = fi.properties.end();
itr != iend;
itr++, i++) {
if (i == n) {
cprop.key = itr->first.c_str();
return cprop;
}
}
return cprop;
}

int cgaudi_factory_get_property_size | ( | cgaudi_factory_t | self | ) |

Definition at line 82 of file capi_pluginservice.cpp.

{
Registry &reg = Registry::instance();
std::string id = self.id;
const Registry::FactoryInfo& fi = reg.getInfo(id);
return int(fi.properties.size());
}

const char* cgaudi_factory_get_rtype | ( | cgaudi_factory_t | self | ) |

Definition at line 64 of file capi_pluginservice.cpp.

{
Registry &reg = Registry::instance();
std::string id = self.id;
const Registry::FactoryInfo& fi = reg.getInfo(id);
return fi.rtype.c_str();
}

const char* cgaudi_factory_get_type | ( | cgaudi_factory_t | self | ) |

Definition at line 55 of file capi_pluginservice.cpp.

{
Registry &reg = Registry::instance();
std::string id = self.id;
const Registry::FactoryInfo& fi = reg.getInfo(id);
return fi.type.c_str();
}

cgaudi_factory_t cgaudi_pluginsvc_get_factory_at | ( | cgaudi_pluginsvc_t | self,
|  | int | n
| ) |  |

Definition at line 26 of file capi_pluginservice.cpp.

{
const Registry *reg = ((const Registry*)self.registry);
std::vector<Registry::KeyType> keys;
keys.reserve(reg->factories().size());
for (Registry::FactoryMap::const_iterator
itr = reg->factories().begin(),
iend= reg->factories().end();
itr != iend;
itr++) {
keys.push_back(itr->first);
}
const char *key = keys[n].c_str();
cgaudi_factory_t fac;
fac.registry = self;
fac.id = key;
return fac;
}

int cgaudi_pluginsvc_get_factory_size | ( | cgaudi_pluginsvc_t | self | ) |

Definition at line 18 of file capi_pluginservice.cpp.

{
const Registry::FactoryMap &fmap = ((const Registry*)self.registry)->factories();
return int(fmap.size());
}

cgaudi_pluginsvc_t cgaudi_pluginsvc_instance | ( | void |  | ) |

Definition at line 9 of file capi_pluginservice.cpp.

{
static Registry& cxxreg = Registry::instance();
cgaudi_pluginsvc_t reg;
reg.registry = (void*)(&cxxreg);
return reg;
}

const char* cgaudi_property_get_key | ( | cgaudi_property_t | self | ) |

Definition at line 116 of file capi_pluginservice.cpp.

{
return self.key;
}

const char* cgaudi_property_get_value | ( | cgaudi_property_t | self | ) |

Definition at line 122 of file capi_pluginservice.cpp.

{
Registry &reg = Registry::instance();
std::string id = self.id;
const Registry::FactoryInfo& fi = reg.getInfo(id);
Registry::KeyType key = self.key;
Registry::Properties::const_iterator prop = fi.properties.find(key);
if (prop == fi.properties.end()) {
return NULL;
}
return prop->second.c_str();
}