11#ifndef O2_FRAMEWORK_SERVICEREGISTRYHELPERS_H_
12#define O2_FRAMEWORK_SERVICEREGISTRYHELPERS_H_
38 template <
class I,
class C, enum ServiceKind K = ServiceKind::Serial>
44 static_assert(std::is_const_v<I> ==
false,
45 "Service interface must not be const if service object is not const");
46 static_assert(std::is_base_of<I, C>::value ==
true,
47 "Registered service is not derived from declared interface");
48 constexpr auto typeHash = TypeIdHelpers::uniqueId<I>();
49 return ServiceHandle{typeHash,
reinterpret_cast<void*
>(service), K,
typeid(C).
name()};
53 template <
class I,
class C, enum ServiceKind K = ServiceKind::Serial>
59 static_assert(std::is_const_v<I> ==
true,
60 "Service interface must be const if service object is const");
61 static_assert(std::is_base_of<I, C>::value ==
true,
62 "Registered service is not derived from declared interface");
63 constexpr auto typeHash = TypeIdHelpers::uniqueId<I>();
64 return ServiceHandle{typeHash,
reinterpret_cast<void*
>(
const_cast<C*
>(service)), K,
typeid(C).
name()};
GLuint const GLchar * name
Defining PrimaryVertex explicitly as messageable.
std::string name
Mnemonic name to use for the service.
Helpers for ServiceRegistry manipulations.
static auto handleForService(C *service) -> ServiceHandle
static auto handleForService(C const *service) -> ServiceHandle
Same as above, but for const instances.