| The Gaudi Framework v27r1

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

- File List
- File Members

Classes | Functions | Variables
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.

## Classes
struct | select1st_t

## 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)

## Variables
constexpr struct select1st_t | select1st

## Function Documentation

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

Definition at line 65 of file capi_pluginservice.cpp.

66 {
67 Registry &reg = Registry::instance();
68 return reg.getInfo(self.id).className.c_str();
69 }
Gaudi::PluginService::Details::Registry::getInfo
const FactoryInfo & getInfo(const std::string &id) const
Retrieve the FactoryInfo object for an id.
Definition: PluginService.cpp:296
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 44 of file capi_pluginservice.cpp.

45 {
46 Registry &reg = Registry::instance();
47 return reg.getInfo(self.id).library.c_str();
48 }
Gaudi::PluginService::Details::Registry::getInfo
const FactoryInfo & getInfo(const std::string &id) const
Retrieve the FactoryInfo object for an id.
Definition: PluginService.cpp:296
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 81 of file capi_pluginservice.cpp.

82 {
83 cgaudi_property_t cprop{ self.registry, self.id, nullptr };
84 Registry &reg = Registry::instance();
85 const Registry::FactoryInfo& fi = reg.getInfo(cprop.id);
86 if (n<(long)fi.properties.size()) {
87 auto itr = std::next(fi.properties.cbegin(),n);
88 cprop.key = itr->first.c_str();
89 }
90 return cprop;
91 }
Gaudi::PluginService::Details::Registry::getInfo
const FactoryInfo & getInfo(const std::string &id) const
Retrieve the FactoryInfo object for an id.
Definition: PluginService.cpp:296
Gaudi::PluginService::Details::Registry::FactoryInfo
Definition: PluginServiceDetails.h:106
Gaudi::PluginService::Details::Registry::FactoryInfo::properties
Properties properties
Definition: PluginServiceDetails.h:121
GaudiPluginService.cpluginsvc.n
list 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)
std::map::cbegin
T cbegin(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 72 of file capi_pluginservice.cpp.

73 {
74 Registry &reg = Registry::instance();
75 const Registry::FactoryInfo& fi = reg.getInfo(self.id);
76 return int(fi.properties.size());
77 }
Gaudi::PluginService::Details::Registry::getInfo
const FactoryInfo & getInfo(const std::string &id) const
Retrieve the FactoryInfo object for an id.
Definition: PluginService.cpp:296
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 58 of file capi_pluginservice.cpp.

59 {
60 Registry &reg = Registry::instance();
61 return reg.getInfo(self.id).rtype.c_str();
62 }
Gaudi::PluginService::Details::Registry::getInfo
const FactoryInfo & getInfo(const std::string &id) const
Retrieve the FactoryInfo object for an id.
Definition: PluginService.cpp:296
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 51 of file capi_pluginservice.cpp.

52 {
53 Registry &reg = Registry::instance();
54 return reg.getInfo(self.id).type.c_str();
55 }
Gaudi::PluginService::Details::Registry::getInfo
const FactoryInfo & getInfo(const std::string &id) const
Retrieve the FactoryInfo object for an id.
Definition: PluginService.cpp:296
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 33 of file capi_pluginservice.cpp.

34 {
35 const Registry *reg = ((const Registry*)self.registry);
36 std::vector<Registry::KeyType> keys;
37 keys.reserve(reg->factories().size());
38 std::transform(reg->factories().begin(),reg->factories().end(),
39 std::back_inserter(keys), select1st );
40 return { self, keys[n].c_str() };
41 }
select1st
constexpr struct select1st_t select1st
std::map::end
T end(T...args)
GaudiPluginService.cpluginsvc.n
list n
Definition: cpluginsvc.py:217
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
std::map::size
T size(T...args)
std::vector
STL class.
std::map::begin
T begin(T...args)
std::back_inserter
T back_inserter(T...args)
Gaudi::PluginService::Details::Registry
In-memory database of the loaded factories.
Definition: PluginServiceDetails.h:99
std::transform
T transform(T...args)
std::vector::reserve
T reserve(T...args)

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 94 of file capi_pluginservice.cpp.

95 {
96 return self.key;
97 }

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

Definition at line 100 of file capi_pluginservice.cpp.

101 {
102 Registry &reg = Registry::instance();
103 const Registry::FactoryInfo& fi = reg.getInfo(self.id);
104 auto prop = fi.properties.find(self.key);
105 return prop != fi.properties.end() ? prop->second.c_str() : nullptr;
106 }
Gaudi::PluginService::Details::Registry::getInfo
const FactoryInfo & getInfo(const std::string &id) const
Retrieve the FactoryInfo object for an id.
Definition: PluginService.cpp:296
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

## Variable Documentation

constexpr struct select1st_t select1st