| The Gaudi Framework v30r0 (c919700c)

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

- File List
- File Members

Classes | Macros | Functions
capi_pluginservice.h File Reference
`#include <stdint.h>`
Include dependency graph for capi_pluginservice.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes
struct | cgaudi_pluginsvc_t
struct | cgaudi_factory_t
struct | cgaudi_property_t

## Macros
#define | CGAUDI_IMPORT
#define | CGAUDI_EXPORT
#define | CGAUDI_LOCAL
#define | CGAUDI_API CGAUDI_EXPORT

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

## Macro Definition Documentation

#define CGAUDI_API CGAUDI_EXPORT

Definition at line 36 of file capi_pluginservice.h.

#define CGAUDI_EXPORT

Definition at line 32 of file capi_pluginservice.h.

#define CGAUDI_IMPORT

Definition at line 31 of file capi_pluginservice.h.

#define CGAUDI_LOCAL

Definition at line 33 of file capi_pluginservice.h.

## Function Documentation

CGAUDI_API 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:302
std::string::c_str
T c_str(T...args)
Gaudi::PluginService::Details::Registry
In-memory database of the loaded factories.
Definition: PluginServiceDetails.h:110
Gaudi::PluginService::Details::Registry::FactoryInfo::className
std::string className
Definition: PluginServiceDetails.h:134

CGAUDI_API 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:302
Gaudi::PluginService::Details::Registry::FactoryInfo::library
std::string library
Definition: PluginServiceDetails.h:130
std::string::c_str
T c_str(T...args)
Gaudi::PluginService::Details::Registry
In-memory database of the loaded factories.
Definition: PluginServiceDetails.h:110

CGAUDI_API 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:302
Gaudi::PluginService::Details::Registry::FactoryInfo
Definition: PluginServiceDetails.h:118
Gaudi::PluginService::Details::Registry::FactoryInfo::properties
Properties properties
Definition: PluginServiceDetails.h:135
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:110

CGAUDI_API 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:302
Gaudi::PluginService::Details::Registry::FactoryInfo
Definition: PluginServiceDetails.h:118
Gaudi::PluginService::Details::Registry::FactoryInfo::properties
Properties properties
Definition: PluginServiceDetails.h:135
std::map::size
T size(T...args)
Gaudi::PluginService::Details::Registry
In-memory database of the loaded factories.
Definition: PluginServiceDetails.h:110

CGAUDI_API 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:302
std::string::c_str
T c_str(T...args)
Gaudi::PluginService::Details::Registry::FactoryInfo::rtype
std::string rtype
Definition: PluginServiceDetails.h:133
Gaudi::PluginService::Details::Registry
In-memory database of the loaded factories.
Definition: PluginServiceDetails.h:110

CGAUDI_API 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:302
std::string::c_str
T c_str(T...args)
Gaudi::PluginService::Details::Registry
In-memory database of the loaded factories.
Definition: PluginServiceDetails.h:110
Gaudi::PluginService::Details::Registry::FactoryInfo::type
std::string type
Definition: PluginServiceDetails.h:132

CGAUDI_API 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:178
GaudiPluginService.cpluginsvc.registry
def registry()
Definition: cpluginsvc.py:70
Gaudi::PluginService::Details::Registry
In-memory database of the loaded factories.
Definition: PluginServiceDetails.h:110
GaudiPluginService.cpluginsvc.factories
def factories()
Definition: cpluginsvc.py:80

CGAUDI_API 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:110

CGAUDI_API 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:110

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

Definition at line 69 of file capi_pluginservice.cpp.

69 { return self.key; }

CGAUDI_API 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:302
std::map::end
T end(T...args)
Gaudi::PluginService::Details::Registry::FactoryInfo
Definition: PluginServiceDetails.h:118
Gaudi::PluginService::Details::Registry::FactoryInfo::properties
Properties properties
Definition: PluginServiceDetails.h:135
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:110