Loading [MathJax]/extensions/tex2jax.js
Go to the documentation of this file.
17 #include <nlohmann/json.hpp>
37 inline constexpr
bool has_from_json_v = Gaudi::cpp17::is_detected_v<has_from_json_, T>;
43 if constexpr ( has_merge_and_reset_v<T> ) {
44 return [](
void* ptr,
void* other ) {
48 return [](
void*,
void* ) {};
56 if constexpr ( has_merge_from_json_v<T> ) {
58 }
else if constexpr ( has_merge_and_reset_v<T> && has_from_json_v<T> ) {
60 reinterpret_cast<T*
>( ptr )->
mergeAndReset( T::fromJSON( other ) );
70 using logic_error::logic_error;
102 template <
typename T>
110 ,
m_reset{ [](
void* ptr ) {
reset( *
reinterpret_cast<T*
>( ptr ) ); } }
112 [](
void* e,
void* o ) {
mergeAndReset( *
reinterpret_cast<T*
>( e ), *
reinterpret_cast<T*
>( o ) ); } } {}
169 template <
typename T>
177 template <
typename T>
Interface reporting services must implement.
void(* m_mergeAndReset)(void *, void *)
function calling merge and reset on internal data with the internal data of another entity
std::string name
name of the entity
bool operator==(Entity const &ent)
operator== for comparison with an entity
std::vector< Sink * > m_sinks
friend void to_json(nlohmann::json &j, Gaudi::Monitoring::Hub::Entity const &e)
conversion to json via nlohmann library
virtual void removeEntity(Entity const &ent)=0
constexpr bool has_from_json_v
decltype(T::fromJSON(nlohmann::json{})) has_from_json_
decltype(std::declval< T >().mergeAndReset(std::declval< T && >())) has_merge_and_reset_
virtual void registerEntity(Entity ent)=0
void reset(T &)
default (empty) implementation of reset method for types stored into an entity
double * begin(CLHEP::HepVector &v)
void removeSink(Sink *sink)
nlohmann::json(* m_getJSON)(void const *)
function converting the internal data to json.
void registerEntity(std::string c, std::string n, std::string t, T &ent)
std::type_index typeIndex() const
function to get internal type
MergeAndResetFromJSON_t makeMergeAndResetFromJSONFor()
void removeEntity(T &ent)
constexpr bool has_merge_and_reset_v
void * id() const
unique identifier, actually mapped to internal pointer
std::type_index m_typeIndex
void registerEntity(Entity ent)
friend void mergeAndReset(Entity &ent, Entity &other)
function calling merge and reset on internal data with the internal data of another entity
decltype(std::declval< T >().mergeAndReset(nlohmann::json{})) has_merge_from_json_
void * m_ptr
pointer to the actual data inside this Entity
void(*)(void *, const nlohmann::json &) MergeAndResetFromJSON_t
constexpr bool has_merge_from_json_v
Entity(std::string component, std::string name, std::string type, T &ent)
MergeAndReset_t makeMergeAndResetFor()
std::map< void *, Entity > m_entities
Central entity in a Gaudi application that manages monitoring objects (i.e.
friend void reset(Entity &e)
function resetting internal data
Wrapper class for arbitrary monitoring objects.
void mergeAndReset(T &, T &)
default (empty) implementation of mergeAndReset method for types stored into an entity
void(* m_reset)(void *)
function reseting internal data.
void(*)(void *, void *) MergeAndReset_t
std::string type
type of the entity, see comment above concerning its format and usage
std::string component
name of the component owning the Entity