Sen API
Sen Libraries
Loading...
Searching...
No Matches
input.h
Go to the documentation of this file.
1// === input.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_INPUT_H
9#define SEN_DB_INPUT_H
10
11// sen
13#include "sen/core/meta/type.h"
15#include "sen/db/annotation.h"
16#include "sen/db/creation.h"
17#include "sen/db/cursor.h"
18#include "sen/db/deletion.h"
19#include "sen/db/event.h"
20#include "sen/db/keyframe.h"
22
23// stl
24#include "stl/sen/db/basic_types.stl.h"
25
26// std
27#include <filesystem>
28
29namespace sen::db
30{
31
34{
35 uint64_t offset;
37};
38
41{
43 ObjectId objectId;
44 std::string name;
45 std::string session;
46 std::string bus;
47 uint32_t indexId;
48};
49
51class End
52{
53};
54
57
60
62class Input final
63{
64 SEN_NOCOPY_NOMOVE(Input)
65
66public:
67 Input(std::filesystem::path path, CustomTypeRegistry& nativeTypes);
69
70public:
72 [[nodiscard]] const std::filesystem::path& getPath() const noexcept;
73
75 [[nodiscard]] const Summary& getSummary() const noexcept;
76
78 [[nodiscard]] const CustomTypeRegistry& getTypes() const noexcept;
79
81 [[nodiscard]] DataCursor begin();
82
85
87 [[nodiscard]] DataCursor at(const KeyframeIndex& index);
88
90 [[nodiscard]] DataCursor makeCursor(const ObjectIndexDef& indexDef);
91
93 void addAnnotation(TimeStamp time, const Type* type, std::vector<uint8_t>&& value);
94
95public:
98
101
104
105private:
106 class Impl;
107 std::unique_ptr<Impl> pimpl_;
108};
109
110} // namespace sen::db
111
112#endif // SEN_DB_INPUT_H
A registry of custom types.
Definition type_registry.h:36
Contiguous view of elements of type T. Inspired by http://www.open-std.org/jtc1/sc22/wg21/docs/papers...
Definition span.h:34
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
A cursor that can be used to iterate over the contents of a recording. The cursor holds a payload whi...
Definition cursor.h:27
const std::filesystem::path & getPath() const noexcept
The folder where this archive is stored.
DataCursor makeCursor(const ObjectIndexDef &indexDef)
Creates a cursor that only iterates over the data related to an object.
DataCursor begin()
Creates a cursor to the start of the runtime data.
Span< const ObjectIndexDef > getObjectIndexDefinitions()
The objects that have been indexed.
const Summary & getSummary() const noexcept
Summary data of this archive.
Span< const KeyframeIndex > getAllKeyframeIndexes()
The keyframes that were indexed (if any).
std::optional< KeyframeIndex > getKeyframeIndex(TimeStamp time)
The closest keyframe to a given time.
DataCursor at(const KeyframeIndex &index)
Creates a cursor located at a given keyframe.
Input(std::filesystem::path path, CustomTypeRegistry &nativeTypes)
void addAnnotation(TimeStamp time, const Type *type, std::vector< uint8_t > &&value)
Adds an annotation. Does not change the file summary.
AnnotationCursor annotationsBegin()
Creates a cursor to the start of the annotations.
const CustomTypeRegistry & getTypes() const noexcept
Types available in this archive.
std::string bus
Definition input.h:46
ConstTypeHandle< ClassType > type
Definition input.h:42
TimeStamp time
Definition input.h:36
uint64_t offset
Definition input.h:35
std::string session
Definition input.h:45
ObjectId objectId
Definition input.h:43
std::string name
Definition input.h:44
uint32_t indexId
Definition input.h:47
Represents the end of the recording. Used in cursors.
Definition input.h:52
Cursor< End, PropertyChange, Event, Keyframe, Creation, Deletion > DataCursor
A cursor that can iterate over data entries.
Definition input.h:56
Cursor< End, Annotation > AnnotationCursor
A cursor that can iterate over annotation entries.
Definition input.h:59
The location of a keyframe in an archive.
Definition input.h:34
Describes an object that has been indexed.
Definition input.h:41
@ time
Definition unit.h:34
TypeHandle< const T > ConstTypeHandle
Definition type.h:319
Definition annotation.h:20
STL namespace.