Commit | Line | Data |
---|---|---|
0220be14 JG |
1 | /* |
2 | * Copyright (C) 2022 Jérémie Galarneau <jeremie.galarneau@efficios.com> | |
3 | * | |
4 | * SPDX-License-Identifier: GPL-2.0-only | |
5 | * | |
6 | */ | |
7 | ||
8 | #ifndef LTTNG_STREAM_CLASS_H | |
9 | #define LTTNG_STREAM_CLASS_H | |
10 | ||
11 | #include "field.hpp" | |
12 | ||
13 | #include <vector> | |
14 | ||
15 | namespace lttng { | |
16 | namespace sessiond { | |
17 | namespace trace { | |
18 | ||
19 | class trace_class_visitor; | |
20 | ||
21 | class stream_class { | |
22 | public: | |
23 | enum class header_type { COMPACT, LARGE }; | |
24 | ||
25 | /* | |
26 | * Derived classes must implement _accept_on_event_classes() | |
27 | * to continue the traversal to the stream class' event classes. | |
28 | */ | |
29 | void accept(trace_class_visitor& visitor) const; | |
30 | virtual ~stream_class() = default; | |
31 | ||
32 | virtual const lttng::sessiond::trace::type& get_context() const; | |
33 | ||
34 | const unsigned int id; | |
35 | const header_type header_type; | |
36 | ||
37 | protected: | |
38 | stream_class(unsigned int id, enum header_type header_type); | |
39 | virtual void _accept_on_event_classes(trace_class_visitor& trace_class_visitor) const = 0; | |
40 | ||
41 | lttng::sessiond::trace::type::cuptr _context; | |
42 | }; | |
43 | ||
44 | } /* namespace trace */ | |
45 | } /* namespace sessiond */ | |
46 | } /* namespace lttng */ | |
47 | ||
48 | #endif /* LTTNG_STREAM_CLASS_H */ |