X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Ftrace-class.hpp;h=ed72f3f579e9cdaabc34a91ddcade7ec5ac60c2d;hb=da9dd5212ebacf388ebe26aa80fd0ddcf7ffe049;hp=52dcb76a94355315004638334d8672fa2f75ea57;hpb=45110cdd99bd9ecc13a12d29afde3fffa48b4641;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/trace-class.hpp b/src/bin/lttng-sessiond/trace-class.hpp index 52dcb76a9..ed72f3f57 100644 --- a/src/bin/lttng-sessiond/trace-class.hpp +++ b/src/bin/lttng-sessiond/trace-class.hpp @@ -20,6 +20,7 @@ class clock_class; class stream_class; class event_class; class trace_class_visitor; +class trace_class_environment_visitor; struct abi { unsigned int bits_per_long; @@ -39,54 +40,50 @@ public: { } - const char * const name; + const char* const name; const ValueType& value; }; class trace_class { public: + + virtual ~trace_class() = default; + /* * Derived classes must implement the _accept_on_*() * to continue the traversal to the trace class' children. */ virtual void accept(trace_class_visitor& trace_class_visitor) const; + virtual void accept(trace_class_environment_visitor& environment_visitor) const = 0; virtual const lttng::sessiond::trace::type *get_packet_header() const noexcept = 0; - virtual ~trace_class() = default; - const struct abi abi; const lttng_uuid uuid; protected: trace_class(const struct abi& abi, const lttng_uuid& trace_uuid); virtual void _accept_on_clock_classes(trace_class_visitor& trace_class_visitor) const = 0; - virtual void _visit_environment(trace_class_visitor& trace_class_visitor) const = 0; virtual void _accept_on_stream_classes(trace_class_visitor& trace_class_visitor) const = 0; }; +class trace_class_environment_visitor { +public: + virtual ~trace_class_environment_visitor() = default; + + virtual void visit(const environment_field& field) = 0; + virtual void visit(const environment_field& field) = 0; + virtual void visit(const environment_field& field); +}; + class trace_class_visitor { public: using cuptr = std::unique_ptr; virtual ~trace_class_visitor() = default; - /* trace class visitor interface. */ virtual void visit(const lttng::sessiond::trace::trace_class& trace_class) = 0; - - /* clock class visitor interface. */ virtual void visit(const lttng::sessiond::trace::clock_class& clock_class) = 0; - - /* environment visitor interface. */ - virtual void environment_begin() = 0; - virtual void visit(const environment_field& field) = 0; - virtual void visit(const environment_field& field) = 0; - void visit(const environment_field& field); - virtual void environment_end() = 0; - - /* stream class visitor interface. */ virtual void visit(const lttng::sessiond::trace::stream_class& stream_class) = 0; - - /* event class visitor interface. */ virtual void visit(const lttng::sessiond::trace::event_class& event_class) = 0; };