| The Gaudi Framework v29r0 (ff2e7097)

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

- File List
- File Members

Functions
capi_pluginservice.cpp File Reference
`#include "capi_pluginservice.h"`
`#include <Gaudi/PluginService.h>`
`#include <algorithm>`
`#include <vector>`
`#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 47 of file capi_pluginservice.cpp.

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

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

Definition at line 29 of file capi_pluginservice.cpp.

30 {
31 Registry& reg = Registry::instance();
32 return reg.getInfo( self.id ).library.c_str();
33 }
Gaudi::PluginService::Details::Registry::getInfo
const FactoryInfo & getInfo(const std::string &id) const
Retrieve the FactoryInfo object for an id.
Definition: PluginService.cpp:307
Gaudi::PluginService::Details::Registry::FactoryInfo::library
std::string library
Definition: PluginServiceDetails.h:132
std::string::c_str
T c_str(T...args)
Gaudi::PluginService::Details::Registry
In-memory database of the loaded factories.
Definition: PluginServiceDetails.h:112

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

Definition at line 60 of file capi_pluginservice.cpp.

61 {
62 cgaudi_property_t cprop{self.registry, self.id, nullptr};
63 Registry& reg = Registry::instance();
64 const Registry::FactoryInfo& fi = reg.getInfo( cprop.id );
65 if ( n < (int)fi.properties.size() ) cprop.key = next( begin( fi.properties ), n )->first.c_str();
66 return cprop;
67 }
Gaudi::PluginService::Details::Registry::getInfo
const FactoryInfo & getInfo(const std::string &id) const
Retrieve the FactoryInfo object for an id.
Definition: PluginService.cpp:307
Gaudi::PluginService::Details::Registry::FactoryInfo
Definition: PluginServiceDetails.h:120
Gaudi::PluginService::Details::Registry::FactoryInfo::properties
Properties properties
Definition: PluginServiceDetails.h:137
begin
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:58
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:228
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:112

int cgaudi_factory_get_property_size | ( | cgaudi_factory_t | self | ) |

Definition at line 53 of file capi_pluginservice.cpp.

54 {
55 Registry& reg = Registry::instance();
56 const Registry::FactoryInfo& fi = reg.getInfo( self.id );
57 return int( fi.properties.size() );
58 }
Gaudi::PluginService::Details::Registry::getInfo
const FactoryInfo & getInfo(const std::string &id) const
Retrieve the FactoryInfo object for an id.
Definition: PluginService.cpp:307
Gaudi::PluginService::Details::Registry::FactoryInfo
Definition: PluginServiceDetails.h:120
Gaudi::PluginService::Details::Registry::FactoryInfo::properties
Properties properties
Definition: PluginServiceDetails.h:137
std::map::size
T size(T...args)
Gaudi::PluginService::Details::Registry
In-memory database of the loaded factories.
Definition: PluginServiceDetails.h:112

const char* cgaudi_factory_get_rtype | ( | 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 ).rtype.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:307
std::string::c_str
T c_str(T...args)
Gaudi::PluginService::Details::Registry::FactoryInfo::rtype
std::string rtype
Definition: PluginServiceDetails.h:135
Gaudi::PluginService::Details::Registry
In-memory database of the loaded factories.
Definition: PluginServiceDetails.h:112

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

Definition at line 35 of file capi_pluginservice.cpp.

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

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

Definition at line 21 of file capi_pluginservice.cpp.

22 {
23 const Registry* reg = ( (const Registry*)self.registry );
24 const auto& factories = reg->factories();
25 if ( n >= (int)factories.size() ) return {self, nullptr};
26 return {self, next( begin( factories ), n )->first.c_str()};
27 }
begin
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:58
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:228
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:180
GaudiPluginService.cpluginsvc.registry
def registry()
Definition: cpluginsvc.py:70
Gaudi::PluginService::Details::Registry
In-memory database of the loaded factories.
Definition: PluginServiceDetails.h:112
GaudiPluginService.cpluginsvc.factories
def factories()
Definition: cpluginsvc.py:80

int cgaudi_pluginsvc_get_factory_size | ( | cgaudi_pluginsvc_t | self | ) |

Definition at line 15 of file capi_pluginservice.cpp.

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

cgaudi_pluginsvc_t cgaudi_pluginsvc_instance | ( | void |  | ) |

Definition at line 9 of file capi_pluginservice.cpp.

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

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

Definition at line 69 of file capi_pluginservice.cpp.

69 { return self.key; }

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

Definition at line 71 of file capi_pluginservice.cpp.

72 {
73 Registry& reg = Registry::instance();
74 const Registry::FactoryInfo& fi = reg.getInfo( self.id );
75 auto prop = fi.properties.find( self.key );
76 return prop != fi.properties.end() ? prop->second.c_str() : nullptr;
77 }
Gaudi::PluginService::Details::Registry::getInfo
const FactoryInfo & getInfo(const std::string &id) const
Retrieve the FactoryInfo object for an id.
Definition: PluginService.cpp:307
std::map::end
T end(T...args)
Gaudi::PluginService::Details::Registry::FactoryInfo
Definition: PluginServiceDetails.h:120
Gaudi::PluginService::Details::Registry::FactoryInfo::properties
Properties properties
Definition: PluginServiceDetails.h:137
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:112