Go to the documentation of this file.
15 #include <nlohmann/json.hpp>
25 template <
typename Arg,
typename =
void>
27 template <
typename Arg>
28 struct has_reset_method<Arg,
std::void_t<decltype( reset( std::declval<Arg&>() ) )>> : std::true_type {};
29 template <
typename Arg>
33 template <
typename Arg,
typename =
void>
35 template <
typename Arg>
37 Arg,
std::void_t<decltype( mergeAndReset( std::declval<Arg&>(), std::declval<Arg&>() ) )>> : std::true_type {};
38 template <
typename Arg>
73 if constexpr ( details::has_reset_method_v<T> ) {
reset( *
reinterpret_cast<T*
>( ptr ) ); }
76 if constexpr ( details::has_mergeAndReset_method_v<T> ) {
77 mergeAndReset( *
reinterpret_cast<T*
>( e ), *
reinterpret_cast<T*
>( o ) );
102 throw std::runtime_error( std::string(
"Entity: mergeAndReset called on different types: " ) +
136 template <
typename T>
144 template <
typename T>
constexpr bool has_reset_method_v
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
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
bool operator==(Entity const &ent) const
operator== for comparison with an entity
AttribStringParser::Iterator begin(const AttribStringParser &parser)
virtual void registerEntity(Entity ent)=0
void for_each(ContainerOfSynced &c, Fun &&f)
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
void removeEntity(T &ent)
void * id() const
unique identifier, actually mapped to internal pointer
constexpr bool has_mergeAndReset_method_v
std::type_index m_typeIndex
void registerEntity(Entity ent)
void * m_ptr
pointer to the actual data inside this Entity
friend void mergeAndReset(Entity const &ent, Entity const &other)
function calling merge and reset on internal data with the internal data of another entity
Entity(std::string component, std::string name, std::string type, T &ent)
std::map< void *, Entity > m_entities
Central entity in a Gaudi application that manages monitoring objects (i.e.
friend void reset(Entity const &e)
function resetting internal data
Wrapper class for arbitrary monitoring objects.
void(* m_reset)(void *)
function reseting internal data.
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