Sen API
Sen Libraries
Loading...
Searching...
No Matches
db/include/sen/db/event.h
Go to the documentation of this file.
1// === event.h =========================================================================================================
2// Sen Infrastructure
3// Released under the Apache License v2.0 (SPDX-License-Identifier Apache-2.0).
4// See the LICENSE.txt file for more information.
5// © Airbus SAS, Airbus Helicopters, and Airbus Defence and Space SAU/GmbH/SAS.
6// =====================================================================================================================
7
8#ifndef SEN_DB_EVENT_H
9#define SEN_DB_EVENT_H
10
11#include "sen/core/meta/event.h"
12#include "sen/core/obj/object.h"
13
14namespace sen::db
15{
16
17class Input;
18
21class Event
22{
23 SEN_COPY_MOVE(Event)
24
25public:
26 ~Event() = default;
27
28public:
30 [[nodiscard]] ObjectId getObjectId() const noexcept;
31
33 [[nodiscard]] const ::sen::Event* getEvent() const noexcept;
34
36 [[nodiscard]] const std::vector<Var>& getArgsAsVariants() const;
37
39 [[nodiscard]] Span<const uint8_t> getArgsAsBuffer() const noexcept;
40
41private:
42 friend class Input;
43 Event(ObjectId objectId, const ::sen::Event* event, std::vector<uint8_t> buffer);
44
45private:
46 ObjectId objectId_;
47 const ::sen::Event* event_;
48 mutable bool argsExtracted_ = false;
49 mutable std::vector<Var> args_;
50 std::vector<uint8_t> buffer_;
51};
52
53} // namespace sen::db
54
55#endif // SEN_DB_EVENT_H
Contiguous view of elements of type T. Inspired by http://www.open-std.org/jtc1/sc22/wg21/docs/papers...
Definition span.h:34
const ::sen::Event * getEvent() const noexcept
The meta information about the event.
Span< const uint8_t > getArgsAsBuffer() const noexcept
The list of arguments, as a (serialized) binary buffer.
friend class Input
Definition db/include/sen/db/event.h:42
ObjectId getObjectId() const noexcept
The ID of the object that emitted the event.
const std::vector< Var > & getArgsAsVariants() const
The list of arguments, as variants.
~Event()=default
Allows you to access an existing recording in the file system.
Definition input.h:63
Definition annotation.h:20
Definition assert.h:17
STL namespace.
Can hold any supported value type. Wraps std::variant to allow recursion and implements some helpers.
Definition var.h:119