| The Gaudi Framework v28r2p1 (f1a77ff4)

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

- File List
- File Members

Functions
capi_pluginservice.cpp File Reference
`#include <vector>`
`#include <algorithm>`
`#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 55 of file capi_pluginservice.cpp.

56 {
57 Registry &reg = Registry::instance();
58 return reg.getInfo(self.id).className.c_str();
59 }
Gaudi::PluginService::Details::Registry::getInfo
const FactoryInfo & getInfo(const std::string &id) const
Retrieve the FactoryInfo object for an id.
Definition: PluginService.cpp:303
std::string::c_str
T c_str(T...args)
Gaudi::PluginService::Details::Registry
In-memory database of the loaded factories.
Definition: PluginServiceDetails.h:99
Gaudi::PluginService::Details::Registry::FactoryInfo::className
std::string className
Definition: PluginServiceDetails.h:120

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

Definition at line 34 of file capi_pluginservice.cpp.

35 {
36 Registry &reg = Registry::instance();
37 return reg.getInfo(self.id).library.c_str();
38 }
Gaudi::PluginService::Details::Registry::getInfo
const FactoryInfo & getInfo(const std::string &id) const
Retrieve the FactoryInfo object for an id.
Definition: PluginService.cpp:303
Gaudi::PluginService::Details::Registry::FactoryInfo::library
std::string library
Definition: PluginServiceDetails.h:116
std::string::c_str
T c_str(T...args)
Gaudi::PluginService::Details::Registry
In-memory database of the loaded factories.
Definition: PluginServiceDetails.h:99

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

Definition at line 71 of file capi_pluginservice.cpp.

72 {
73 cgaudi_property_t cprop{ self.registry, self.id, nullptr };
74 Registry &reg = Registry::instance();
75 const Registry::FactoryInfo& fi = reg.getInfo( cprop.id );
76 if ( n < (int)fi.properties.size() )
77 cprop.key = next( begin( fi.properties ), n )->first.c_str();
78 return cprop;
79 }
Gaudi::PluginService::Details::Registry::getInfo
const FactoryInfo & getInfo(const std::string &id) const
Retrieve the FactoryInfo object for an id.
Definition: PluginService.cpp:303
Gaudi::PluginService::Details::Registry::FactoryInfo
Definition: PluginServiceDetails.h:106
Gaudi::PluginService::Details::Registry::FactoryInfo::properties
Properties properties
Definition: PluginServiceDetails.h:121
begin
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:48
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:217
std::next
T next(T...args)
cgaudi_property_t::registry
cgaudi_pluginsvc_t registry
Definition: capi_pluginservice.h:48
cgaudi_property_t
Definition: capi_pluginservice.h:47
std::map::size
T size(T...args)
Gaudi::PluginService::Details::Registry
In-memory database of the loaded factories.
Definition: PluginServiceDetails.h:99

int cgaudi_factory_get_property_size | ( | cgaudi_factory_t | self | ) |

Definition at line 62 of file capi_pluginservice.cpp.

63 {
64 Registry &reg = Registry::instance();
65 const Registry::FactoryInfo& fi = reg.getInfo(self.id);
66 return int(fi.properties.size());
67 }
Gaudi::PluginService::Details::Registry::getInfo
const FactoryInfo & getInfo(const std::string &id) const
Retrieve the FactoryInfo object for an id.
Definition: PluginService.cpp:303
Gaudi::PluginService::Details::Registry::FactoryInfo
Definition: PluginServiceDetails.h:106
Gaudi::PluginService::Details::Registry::FactoryInfo::properties
Properties properties
Definition: PluginServiceDetails.h:121
std::map::size
T size(T...args)
Gaudi::PluginService::Details::Registry
In-memory database of the loaded factories.
Definition: PluginServiceDetails.h:99

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

Definition at line 48 of file capi_pluginservice.cpp.

49 {
50 Registry &reg = Registry::instance();
51 return reg.getInfo(self.id).rtype.c_str();
52 }
Gaudi::PluginService::Details::Registry::getInfo
const FactoryInfo & getInfo(const std::string &id) const
Retrieve the FactoryInfo object for an id.
Definition: PluginService.cpp:303
std::string::c_str
T c_str(T...args)
Gaudi::PluginService::Details::Registry::FactoryInfo::rtype
std::string rtype
Definition: PluginServiceDetails.h:119
Gaudi::PluginService::Details::Registry
In-memory database of the loaded factories.
Definition: PluginServiceDetails.h:99

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

Definition at line 41 of file capi_pluginservice.cpp.

42 {
43 Registry &reg = Registry::instance();
44 return reg.getInfo(self.id).type.c_str();
45 }
Gaudi::PluginService::Details::Registry::getInfo
const FactoryInfo & getInfo(const std::string &id) const
Retrieve the FactoryInfo object for an id.
Definition: PluginService.cpp:303
std::string::c_str
T c_str(T...args)
Gaudi::PluginService::Details::Registry
In-memory database of the loaded factories.
Definition: PluginServiceDetails.h:99
Gaudi::PluginService::Details::Registry::FactoryInfo::type
std::string type
Definition: PluginServiceDetails.h:118

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

Definition at line 24 of file capi_pluginservice.cpp.

25 {
26 const Registry *reg = ((const Registry*)self.registry);
27 const auto& factories = reg->factories();
28 if ( n >= (int)factories.size() )
29 return {self, nullptr};
30 return {self, next( begin( factories ), n)->first.c_str()};
31 }
begin
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:48
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:217
std::next
T next(T...args)
Gaudi::PluginService::Details::Registry::factories
const FactoryMap & factories() const
Return the known factories (loading the list if not yet done).
Definition: PluginServiceDetails.h:163
GaudiPluginService.cpluginsvc.registry
def registry()
Definition: cpluginsvc.py:63
Gaudi::PluginService::Details::Registry
In-memory database of the loaded factories.
Definition: PluginServiceDetails.h:99
GaudiPluginService.cpluginsvc.factories
def factories()
Definition: cpluginsvc.py:72

int cgaudi_pluginsvc_get_factory_size | ( | cgaudi_pluginsvc_t | self | ) |

Definition at line 17 of file capi_pluginservice.cpp.

18 {
19 const Registry::FactoryMap &fmap = ((const Registry*)self.registry)->factories();
20 return int(fmap.size());
21 }
std::map< KeyType, FactoryInfo >
GaudiPluginService.cpluginsvc.registry
def registry()
Definition: cpluginsvc.py:63
std::map::size
T size(T...args)
Gaudi::PluginService::Details::Registry
In-memory database of the loaded factories.
Definition: PluginServiceDetails.h:99

cgaudi_pluginsvc_t cgaudi_pluginsvc_instance | ( | void |  | ) |

Definition at line 10 of file capi_pluginservice.cpp.

11 {
12 static Registry& cxxreg = Registry::instance();
13 return { (void*)(&cxxreg) };
14 }
Gaudi::PluginService::Details::Registry
In-memory database of the loaded factories.
Definition: PluginServiceDetails.h:99

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

Definition at line 82 of file capi_pluginservice.cpp.

83 {
84 return self.key;
85 }

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

Definition at line 88 of file capi_pluginservice.cpp.

89 {
90 Registry &reg = Registry::instance();
91 const Registry::FactoryInfo& fi = reg.getInfo(self.id);
92 auto prop = fi.properties.find(self.key);
93 return prop != fi.properties.end() ? prop->second.c_str() : nullptr;
94 }
Gaudi::PluginService::Details::Registry::getInfo
const FactoryInfo & getInfo(const std::string &id) const
Retrieve the FactoryInfo object for an id.
Definition: PluginService.cpp:303
std::map::end
T end(T...args)
Gaudi::PluginService::Details::Registry::FactoryInfo
Definition: PluginServiceDetails.h:106
Gaudi::PluginService::Details::Registry::FactoryInfo::properties
Properties properties
Definition: PluginServiceDetails.h:121
std::map::find
T find(T...args)
std::string::c_str
T c_str(T...args)
Gaudi::PluginService::Details::Registry
In-memory database of the loaded factories.
Definition: PluginServiceDetails.h:99