| The Gaudi Framework v32r1 (f65d50dc)

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_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

## ◆ CGAUDI_API

#define CGAUDI_API CGAUDI_EXPORT

Definition at line 36 of file capi_pluginservice.h.

## ◆ CGAUDI_EXPORT

#define CGAUDI_EXPORT

Definition at line 32 of file capi_pluginservice.h.

## ◆ CGAUDI_IMPORT

#define CGAUDI_IMPORT

Definition at line 31 of file capi_pluginservice.h.

## ◆ CGAUDI_LOCAL

#define CGAUDI_LOCAL

Definition at line 33 of file capi_pluginservice.h.

## Function Documentation

## ◆ cgaudi_factory_get_classname()

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

Definition at line 42 of file capi_pluginservice.cpp.

42 {
43 Registry& reg = Registry::instance();
44 static std::string cache;
45 cache = reg.getInfo( self.id ).getprop( "ClassName" );
46 return cache.c_str();
47 }
std::string
STL class.
std::string::c_str
T c_str(T... args)

## ◆ cgaudi_factory_get_library()

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

Definition at line 30 of file capi_pluginservice.cpp.

30 {
31 Registry& reg = Registry::instance();
32 return reg.getInfo( self.id ).library.c_str();
33 }

## ◆ cgaudi_factory_get_property_at()

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

Definition at line 55 of file capi_pluginservice.cpp.

55 {
56 cgaudi_property_t cprop{self.registry, self.id, nullptr};
57 Registry& reg = Registry::instance();
58 const Registry::FactoryInfo& fi = reg.getInfo( cprop.id );
59 if ( n < static_cast<int>( fi.properties.size() ) ) cprop.key = next( begin( fi.properties ), n )->first.c_str();
60 return cprop;
61 }
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:210
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
Gaudi::Utils::begin
AttribStringParser::Iterator begin(const AttribStringParser &parser)
Definition: AttribStringParser.h:120

## ◆ cgaudi_factory_get_property_size()

CGAUDI_API int cgaudi_factory_get_property_size | ( | cgaudi_factory_t | self | ) |

Definition at line 49 of file capi_pluginservice.cpp.

49 {
50 Registry& reg = Registry::instance();
51 const Registry::FactoryInfo& fi = reg.getInfo( self.id );
52 return int( fi.properties.size() );
53 }

## ◆ cgaudi_factory_get_type()

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

Definition at line 35 of file capi_pluginservice.cpp.

35 {
36 Registry& reg = Registry::instance();
37 static std::string cache;
38 cache = demangle( reg.getInfo( self.id ).factory.type() );
39 return cache.c_str();
40 }
std::string
STL class.
Gaudi::PluginService::v1::Details::demangle
GAUDIPS_API std::string demangle(const std::type_info &id)
Return a canonical name for type_info object (implementation borrowed from GaudiKernel/System).
Definition: PluginServiceV1.cpp:134
std::string::c_str
T c_str(T... args)

## ◆ cgaudi_pluginsvc_get_factory_at()

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

Definition at line 23 of file capi_pluginservice.cpp.

23 {
24 const Registry* reg = static_cast<const Registry*>( self.registry );
25 const auto& factories = reg->factories();
26 if ( n >= static_cast<int>( factories.size() ) ) return {self, nullptr};
27 return {self, next( begin( factories ), n )->first.c_str()};
28 }
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:210
std::next
T next(T... args)
GaudiPluginService.cpluginsvc.registry
def registry()
Definition: cpluginsvc.py:71
GaudiPluginService.cpluginsvc.factories
def factories()
Definition: cpluginsvc.py:81
Gaudi::Utils::begin
AttribStringParser::Iterator begin(const AttribStringParser &parser)
Definition: AttribStringParser.h:120

## ◆ cgaudi_pluginsvc_get_factory_size()

CGAUDI_API int cgaudi_pluginsvc_get_factory_size | ( | cgaudi_pluginsvc_t | self | ) |

Definition at line 18 of file capi_pluginservice.cpp.

18 {
19 const Registry::FactoryMap& fmap = static_cast<const Registry*>( self.registry )->factories();
20 return int( fmap.size() );
21 }
GaudiPluginService.cpluginsvc.registry
def registry()
Definition: cpluginsvc.py:71

## ◆ cgaudi_pluginsvc_instance()

CGAUDI_API cgaudi_pluginsvc_t cgaudi_pluginsvc_instance | ( | void |  | ) |

Definition at line 13 of file capi_pluginservice.cpp.

13 {
14 static Registry& cxxreg = Registry::instance();
15 return {&cxxreg};
16 }

## ◆ cgaudi_property_get_key()

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

Definition at line 63 of file capi_pluginservice.cpp.

63 { return self.key; }

## ◆ cgaudi_property_get_value()

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

Definition at line 65 of file capi_pluginservice.cpp.

65 {
66 Registry& reg = Registry::instance();
67 const Registry::FactoryInfo& fi = reg.getInfo( self.id );
68 auto prop = fi.properties.find( self.key );
69 return prop != fi.properties.end() ? prop->second.c_str() : nullptr;
70 }