Sen API
Sen Libraries
Toggle main menu visibility
Loading...
Searching...
No Matches
annotation.h
Go to the documentation of this file.
1
// === annotation.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_ANNOTATION_H
9
#define SEN_DB_ANNOTATION_H
10
11
// sen
12
#include "
sen/core/base/span.h
"
13
#include "
sen/core/meta/type.h
"
14
#include "
sen/core/meta/var.h
"
15
16
// std
17
#include <vector>
18
19
namespace
sen::db
20
{
21
22
class
Input
;
23
25
class
Annotation
26
{
27
SEN_COPY_MOVE(Annotation)
28
29
public
:
30
~Annotation
() =
default
;
31
32
public
:
34
[[nodiscard]]
const
ConstTypeHandle<>
&
getType
() const noexcept;
35
37
[[nodiscard]]
Span
<const uint8_t>
getValueAsBuffer
() const noexcept;
38
41
[[nodiscard]] const
Var
&
getValueAsVariant
() const;
42
43
private:
44
friend class
Input
;
45
Annotation(
ConstTypeHandle
<> type,
std
::vector<uint8_t> buffer);
46
47
private:
48
ConstTypeHandle
<> type_;
49
mutable
bool
variantExtracted_ = false;
50
mutable
Var
variant_;
51
std
::vector<uint8_t> buffer_;
52
};
53
54
}
// namespace sen::db
55
56
#endif
// SEN_DB_ANNOTATION_H
sen::Span
Contiguous view of elements of type T. Inspired by http://www.open-std.org/jtc1/sc22/wg21/docs/papers...
Definition
span.h:34
sen::db::Annotation::getValueAsVariant
const Var & getValueAsVariant() const
The annotation content, as a variant. Contents of the variant are obtained by interpreting the buffer...
sen::db::Annotation::Input
friend class Input
Definition
annotation.h:44
sen::db::Annotation::getValueAsBuffer
Span< const uint8_t > getValueAsBuffer() const noexcept
The annotation content, as a buffer.
sen::db::Annotation::getType
const ConstTypeHandle & getType() const noexcept
The data type of the annotation value.
sen::db::Annotation::~Annotation
~Annotation()=default
sen::db::Input
Allows you to access an existing recording in the file system.
Definition
input.h:63
sen::ConstTypeHandle
TypeHandle< const T > ConstTypeHandle
Definition
type.h:319
sen::db
Definition
type_specs.h:19
std
STL namespace.
span.h
sen::Var
Can hold any supported value type. Wraps std::variant to allow recursion and implements some helpers.
Definition
var.h:119
type.h
var.h
libs
db
include
sen
db
annotation.h
Generated by
1.17.0