X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Ffield.hpp;h=2a1bcf35bf8002d5eec1a447fbe48b611d8eb345;hb=eda1aa02582ba8af1f30d40f131f4a32d2b372ab;hp=f353adafbcc7d04e04e056144d53bb3c269b1b73;hpb=0267b5278de7bf4ee1ec11f2270dec4b44e80f36;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/field.hpp b/src/bin/lttng-sessiond/field.hpp index f353adafb..2a1bcf35b 100644 --- a/src/bin/lttng-sessiond/field.hpp +++ b/src/bin/lttng-sessiond/field.hpp @@ -27,6 +27,26 @@ enum class byte_order { LITTLE_ENDIAN_, }; +class field_location { +public: + enum class root { + PACKET_HEADER, + PACKET_CONTEXT, + EVENT_RECORD_HEADER, + EVENT_RECORD_COMMON_CONTEXT, + EVENT_RECORD_SPECIFIC_CONTEXT, + EVENT_RECORD_PAYLOAD, + }; + + using elements = std::vector; + + field_location(root lookup_root, elements elements); + bool operator==(const field_location& other) const noexcept; + + const root root_; + const elements elements_; +}; + /* * Field, and the various field types, represents fields as exposed by the * LTTng tracers. These classes do not attempt to describe the complete spectrum of the CTF @@ -277,11 +297,11 @@ class dynamic_length_array_type : public array_type { public: dynamic_length_array_type(unsigned int alignment, type::cuptr element_type, - std::string length_field_name); + field_location length_field_location); virtual void accept(type_visitor& visitor) const override final; - const std::string length_field_name; + const field_location length_field_location; private: virtual bool _is_equal(const type& base_other) const noexcept override final; @@ -309,11 +329,11 @@ private: class dynamic_length_blob_type : public type { public: - dynamic_length_blob_type(unsigned int alignment, std::string length_field_name); + dynamic_length_blob_type(unsigned int alignment, field_location length_field_location); virtual void accept(type_visitor& visitor) const override final; - const std::string length_field_name; + const field_location length_field_location; private: virtual bool _is_equal(const type& base_other) const noexcept override final; @@ -355,10 +375,10 @@ class dynamic_length_string_type : public string_type { public: dynamic_length_string_type(unsigned int alignment, enum encoding in_encoding, - std::string length_field_name); + field_location length_field_location); virtual void accept(type_visitor& visitor) const override final; - const std::string length_field_name; + const field_location length_field_location; private: virtual bool _is_equal(const type& base_other) const noexcept override final; @@ -388,12 +408,15 @@ class variant_type : public type { public: using choices = std::vector; - variant_type(unsigned int alignment, std::string tag_name, choices in_choices); + variant_type(unsigned int alignment, + field_location selector_field_location, + choices in_choices); virtual void accept(type_visitor& visitor) const override final; - const std::string tag_name; + const field_location selector_field_location; const choices _choices; +; private: virtual bool _is_equal(const type& base_other) const noexcept override final;