#include <common/exception.hpp>
#include <common/format.hpp>
+#include <set>
+
namespace lst = lttng::sessiond::trace;
namespace {
type(in_alignment),
byte_order{in_byte_order},
size{in_size},
- signedness{in_signedness},
- base{in_base}
+ signedness_{in_signedness},
+ base_{in_base}
{
}
return this->byte_order == other.byte_order &&
this->size == other.size &&
- this->signedness == other.signedness &&
- this->base == other.base;
+ this->signedness_ == other.signedness_ &&
+ this->base_ == other.base_;
}
void lst::integer_type::accept(type_visitor& visitor) const
mantissa_digits(in_mantissa_digits)
{
/* Allowed (exponent, mantissa) pairs. */
- static const std::vector<std::pair<unsigned int, unsigned int>> allowed_pairs{
+ static const std::set<std::pair<unsigned int, unsigned int>> allowed_pairs{
{5, 11}, /* binary16 */
{8, 24}, /* binary32 */
{11, 53}, /* binary64 */
{15, 113}, /* binary128 */
};
- const auto input_pair = decltype(allowed_pairs)::value_type(exponent_digits, mantissa_digits);
- for (const auto& pair : allowed_pairs) {
- if (input_pair == pair) {
- /* mantissa and exponent digits is a valid pair. */
- return;
- }
+ if (allowed_pairs.find({exponent_digits, mantissa_digits}) != allowed_pairs.end()) {
+ /* mantissa and exponent digits is a valid pair. */
+ return;
}
LTTNG_THROW_INVALID_ARGUMENT_ERROR(
{
}
+namespace lttng {
+namespace sessiond {
+namespace trace {
template <>
void lst::signed_enumeration_type::accept(type_visitor& visitor) const
{
{
visitor.visit(*this);
}
+} /* namespace trace */
+} /* namespace sessiond */
+} /* namespace lttng */
lst::array_type::array_type(unsigned int in_alignment, type::cuptr in_element_type) :
type(in_alignment), element_type{std::move(in_element_type)}
}
lst::string_type::string_type(unsigned int in_alignment, enum encoding in_encoding) :
- type(in_alignment), encoding{in_encoding}
+ type(in_alignment), encoding_{in_encoding}
{
}
{
const auto& other = static_cast<decltype(*this)&>(base_other);
- return this->encoding == other.encoding;
+ return this->encoding_ == other.encoding_;
}
lst::static_length_string_type::static_length_string_type(
void lst::variant_type::accept(type_visitor& visitor) const
{
visitor.visit(*this);
-}
\ No newline at end of file
+}