28 for (
const auto & [tag, value] : co ) {
37 std::string top_block) {
41 const auto * descriptor_p = m.GetDescriptor();
42 const auto & des = *descriptor_p;
44 const auto * reflection_p = m.GetReflection();
45 const auto & ref = *reflection_p;
49 auto count = des.field_count();
50 for (
int i = 0; i < count; ++i ) {
51 const auto * field_p = des.field(i);
52 if ( field_p -> is_repeated() )
continue;
54 auto name = top_block.empty() ? field_p -> name() : top_block +
'.' + field_p -> name();
56 auto type = field_p -> cpp_type();
60 case FieldDescriptor::CppType::CPPTYPE_INT32:
63 case FieldDescriptor::CppType::CPPTYPE_INT64:
66 case FieldDescriptor::CppType::CPPTYPE_UINT32:
69 case FieldDescriptor::CppType::CPPTYPE_UINT64:
72 case FieldDescriptor::CppType::CPPTYPE_DOUBLE:
75 case FieldDescriptor::CppType::CPPTYPE_FLOAT:
78 case FieldDescriptor::CppType::CPPTYPE_BOOL:
81 case FieldDescriptor::CppType::CPPTYPE_STRING:
84 case FieldDescriptor::CppType::CPPTYPE_MESSAGE:
87 ret.insert(data.begin(), data.end());
108 std::string top_block) {
110 const auto * descriptor_p = m.GetDescriptor();
111 const auto & des = *descriptor_p;
113 const auto * reflection_p = m.GetReflection();
114 const auto & ref = *reflection_p;
118 auto count = des.field_count();
119 for (
int i = 0; i < count; ++i ) {
120 const auto * field_p = des.field(i);
121 if ( field_p -> is_repeated() )
continue;
123 auto name = top_block.empty() ? field_p -> name() : top_block +
'.' + field_p -> name();
125 auto type = field_p -> cpp_type();
127 if ( type == FieldDescriptor::CppType::CPPTYPE_MESSAGE ) {
128 auto message = ref.MutableMessage(&m, field_p);
132 auto value = e.
data().find(name)->second;
135 case FieldDescriptor::CppType::CPPTYPE_INT32:
136 ref.SetInt32(&m, field_p, value.int4_value());
138 case FieldDescriptor::CppType::CPPTYPE_INT64:
139 ref.SetInt64(&m, field_p, value.int8_value());
141 case FieldDescriptor::CppType::CPPTYPE_UINT32:
142 ref.SetUInt32(&m, field_p, value.uint4_value());
144 case FieldDescriptor::CppType::CPPTYPE_UINT64:
145 ref.SetUInt64(&m, field_p, value.uint8_value());
147 case FieldDescriptor::CppType::CPPTYPE_DOUBLE:
148 ref.SetDouble(&m, field_p, value.double_value());
150 case FieldDescriptor::CppType::CPPTYPE_FLOAT:
151 ref.SetFloat(&m, field_p, value.float_value());
153 case FieldDescriptor::CppType::CPPTYPE_BOOL:
154 ref.SetBool(&m, field_p, value.boolean_value());
156 case FieldDescriptor::CppType::CPPTYPE_STRING:
157 ref.SetString(&m, field_p, value.string_value());
171 if ( !
id.application().empty() ) {
173 ret +=
id.application();
176 for(
int i = 0; i <
id.substructure().
size(); ++i ) {
178 ret +=
id.substructure()[i];
186 const std::string & element) {
188 if ( element.empty() )
return id;
191 id.set_session(element);
195 if (
id.application().empty() ) {
196 id.set_application(element);
206 const std::string & element ) {
220 google::protobuf::Message & m,
221 const google::protobuf::FieldDescriptor* f_p, int32_t value) {
223 r.SetInt32(&m, f_p, value);
228 google::protobuf::Message & m,
229 const google::protobuf::FieldDescriptor* f_p, int64_t value) {
231 r.SetInt64(&m, f_p, value);
236 google::protobuf::Message & m,
237 const google::protobuf::FieldDescriptor* f_p, uint32_t value) {
239 r.SetUInt32(&m, f_p, value);
244 google::protobuf::Message & m,
245 const google::protobuf::FieldDescriptor* f_p, uint64_t value) {
247 r.SetUInt64(&m, f_p, value);
252 google::protobuf::Message & m,
253 const google::protobuf::FieldDescriptor* f_p,
double value) {
255 r.SetDouble(&m, f_p, value);
260 google::protobuf::Message & m,
261 const google::protobuf::FieldDescriptor* f_p,
float value) {
263 r.SetFloat(&m, f_p, value);
268 google::protobuf::Message & m,
269 const google::protobuf::FieldDescriptor* f_p,
bool value) {
271 r.SetBool(&m, f_p, value);
275void dunedaq::opmonlib::set_value<std::string>(
const google::protobuf::Reflection & r,
276 google::protobuf::Message & m,
277 const google::protobuf::FieldDescriptor* f_p, std::string value) {
279 r.SetString(&m, f_p, value);
::google::protobuf::Map< std::string, ::dunedaq::opmon::OpMonValue > * mutable_data()
const ::google::protobuf::Map< std::string, ::dunedaq::opmon::OpMonValue > & data() const
void set_measurement(Arg_ &&arg, Args_... args)
::google::protobuf::Map< std::string, std::string > * mutable_custom_origin()
void set_session(Arg_ &&arg, Args_... args)
void set_application(Arg_ &&arg, Args_... args)
std::string * add_substructure()
void set_int4_value(::int32_t value)
void set_uint4_value(::uint32_t value)
void set_boolean_value(bool value)
void set_string_value(Arg_ &&arg, Args_... args)
void set_uint8_value(::uint64_t value)
void set_int8_value(::int64_t value)
void set_float_value(float value)
void set_double_value(double value)
const dunedaq::opmon::OpMonId & operator+=(dunedaq::opmon::OpMonId &, const std::string &element)
dunedaq::opmon::OpMonId operator+(const dunedaq::opmon::OpMonId &, const std::string &element)
void set_value(google::protobuf::Message &m, const std::string &name, T value)
std::remove_const< std::remove_reference< cr_map_type >::type >::type map_type
M from_entry(const dunedaq::opmon::OpMonEntry &)
dunedaq::opmon::OpMonEntry to_entry(const google::protobuf::Message &m, const CustomOrigin &co)
opmon::OpMonId make_origin(const std::string &session, const std::string &app)
map_type to_map(const google::protobuf::Message &m, std::string top_block="")
std::string to_string(const dunedaq::opmon::OpMonId &)
std::map< std::string, std::string > CustomOrigin
FELIX Initialization std::string initerror FELIX queue timed std::string queuename Unexpected chunk size