Sen API
Sen Libraries
Loading...
Searching...
No Matches
output.h
Go to the documentation of this file.
1// === output.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_OUTPUT_H
9#define SEN_DB_OUTPUT_H
10
11// sen
14#include "sen/core/meta/type.h"
15
16// generated code
17#include "stl/sen/db/basic_types.stl.h"
18#include "stl/sen/kernel/basic_types.stl.h"
19
20// std
21#include <functional>
22
23namespace sen::db
24{
25
27using ErrorHandler = std::function<void()>;
28
31{
33 std::string session;
34 std::string bus;
35};
36
38using ObjectInfoList = std::vector<ObjectInfo>;
39
41class Output
42{
43 SEN_MOVE_ONLY(Output)
44
45public:
47 Output(OutSettings settings, std::function<void()> errorHandler);
49
50public:
52 [[nodiscard]] const OutSettings& getSettings() const noexcept;
53
55 [[nodiscard]] const TimeStamp& getCreationTime() const noexcept;
56
58 [[nodiscard]] OutStats fetchStats() const;
59
60public:
62 void keyframe(TimeStamp time, const ObjectInfoList& objects);
63
65 void creation(TimeStamp time, const ObjectInfo& object, bool indexed);
66
68 void deletion(TimeStamp time, ObjectId objectId);
69
71 void propertyChange(TimeStamp time, ObjectId objectId, MemberHash propertyId, ::sen::kernel::Buffer&& propertyValue);
72
74 void event(TimeStamp time, ObjectId objectId, MemberHash eventId, ::sen::kernel::Buffer&& args);
75
77 void annotation(TimeStamp time, const Type* type, ::sen::kernel::Buffer&& value);
78
79private:
80 class Impl;
81
82private:
83 std::unique_ptr<Impl> pimpl_;
84};
85
86} // namespace sen::db
87
88#endif // SEN_DB_OUTPUT_H
Here we define a set of template meta-programming helpers to let the compiler take some decisions bas...
A sen object.
Definition object.h:76
A point in time.
Definition timestamp.h:26
Represents a type that can be used to define variables and arguments for methods or functions....
Definition type.h:71
void propertyChange(TimeStamp time, ObjectId objectId, MemberHash propertyId, ::sen::kernel::Buffer &&propertyValue)
Asynchronously write a property change entry for the given object.
void deletion(TimeStamp time, ObjectId objectId)
Asynchronously write a deletion entry for the given object.
Output(OutSettings settings, std::function< void()> errorHandler)
Takes the settings and a function to call in case of error.
void creation(TimeStamp time, const ObjectInfo &object, bool indexed)
Asynchronously write a creation entry for the given object. Index it if needed.
const OutSettings & getSettings() const noexcept
The settings passed during construction.
void annotation(TimeStamp time, const Type *type, ::sen::kernel::Buffer &&value)
Asynchronously write an annotation entry.
void event(TimeStamp time, ObjectId objectId, MemberHash eventId, ::sen::kernel::Buffer &&args)
Asynchronously write an event entry for the given object.
void keyframe(TimeStamp time, const ObjectInfoList &objects)
Asynchronously write a keyframe containing the state of the given objects.
const TimeStamp & getCreationTime() const noexcept
The time of creation of the recording.
OutStats fetchStats() const
Fetch the current statistics. Thread-safe.
const Object * instance
Definition output.h:32
std::string bus
Definition output.h:34
std::string session
Definition output.h:33
std::function< void()> ErrorHandler
A function to be called in case of error.
Definition output.h:27
std::vector< ObjectInfo > ObjectInfoList
A list of information elements about tracked objects.
Definition output.h:38
Basic information about an object tracked for recording.
Definition output.h:31
@ time
Definition unit.h:34
Definition annotation.h:20
Strong type for the unique identifier for a transport timer.
Definition native_object_impl.h:39
Definition assert.h:17
STL namespace.
The hash of a member.
Definition type.h:39