24 #ifndef GOBY_MIDDLEWARE_LOG_HDF5_HDF5_PROTOBUF_VALUES_H
25 #define GOBY_MIDDLEWARE_LOG_HDF5_HDF5_PROTOBUF_VALUES_H
27 #include <google/protobuf/descriptor.h>
76 if (field_desc->cpp_type() == google::protobuf::FieldDescriptor::CPPTYPE_INT32)
78 *val = field_desc->default_value_int32();
80 else if (field_desc->cpp_type() == google::protobuf::FieldDescriptor::CPPTYPE_ENUM)
82 const google::protobuf::EnumValueDescriptor* enum_desc = field_desc->default_value_enum();
83 *val = enum_desc->number();
88 *val = std::numeric_limits<std::int32_t>::max();
92 if (m.
field_desc->cpp_type() == google::protobuf::FieldDescriptor::CPPTYPE_INT32)
96 else if (m.
field_desc->cpp_type() == google::protobuf::FieldDescriptor::CPPTYPE_ENUM)
98 const google::protobuf::EnumValueDescriptor* enum_desc =
100 *val = enum_desc->number();
105 if (m.
field_desc->cpp_type() == google::protobuf::FieldDescriptor::CPPTYPE_INT32)
109 else if (m.
field_desc->cpp_type() == google::protobuf::FieldDescriptor::CPPTYPE_ENUM)
111 const google::protobuf::EnumValueDescriptor* enum_desc =
113 *val = enum_desc->number();
120 *val = field_desc->default_value_uint32();
124 *val = std::numeric_limits<std::uint32_t>::max();
138 *val = field_desc->default_value_int64();
142 *val = std::numeric_limits<std::int64_t>::max();
156 *val = field_desc->default_value_uint64();
160 *val = std::numeric_limits<std::uint64_t>::max();
174 *val = field_desc->default_value_double();
178 *val = std::numeric_limits<double>::quiet_NaN();
192 *val = field_desc->default_value_float();
196 *val = std::numeric_limits<float>::quiet_NaN();
211 if (field_desc->cpp_type() == google::protobuf::FieldDescriptor::CPPTYPE_BOOL)
212 *val = field_desc->default_value_bool();
216 *val = std::numeric_limits<unsigned char>::max();
220 if (m.
field_desc->cpp_type() == google::protobuf::FieldDescriptor::CPPTYPE_BOOL)
225 if (m.
field_desc->cpp_type() == google::protobuf::FieldDescriptor::CPPTYPE_BOOL)
232 *val = field_desc->default_value_string();