Sen API
Sen Libraries
Loading...
Searching...
No Matches
property_change.h
Go to the documentation of this file.
1// === property_change.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_PROPERTY_CHANGE_H
9#define SEN_DB_PROPERTY_CHANGE_H
10
14#include "sen/core/obj/object.h"
15
16namespace sen::db
17{
18
19class Input;
20
23class PropertyChange
24{
25 SEN_COPY_MOVE(PropertyChange)
26
27public:
28 ~PropertyChange() = default;
29
30public:
32 [[nodiscard]] ObjectId getObjectId() const noexcept;
33
35 [[nodiscard]] const Property* getProperty() const noexcept;
36
38 [[nodiscard]] Span<const uint8_t> getValueAsBuffer() const noexcept;
39
41 [[nodiscard]] const Var& getValueAsVariant() const;
42
43private:
44 friend class Input;
45 PropertyChange(ObjectId objectId, const Property* property, std::vector<uint8_t> buffer);
46
47private:
48 ObjectId objectId_;
49 const Property* property_;
50 mutable bool variantExtracted_ = false;
51 mutable Var variant_;
52 std::vector<uint8_t> buffer_;
53};
54
55} // namespace sen::db
56
57#endif // SEN_DB_PROPERTY_CHANGE_H
Here we define a set of template meta-programming helpers to let the compiler take some decisions bas...
Represents a property.
Definition property.h:79
Contiguous view of elements of type T. Inspired by http://www.open-std.org/jtc1/sc22/wg21/docs/papers...
Definition span.h:34
Allows you to access an existing recording in the file system.
Definition input.h:63
ObjectId getObjectId() const noexcept
The ID of the object that holds the property.
friend class Input
Definition property_change.h:44
const Property * getProperty() const noexcept
The meta information of the property.
Span< const uint8_t > getValueAsBuffer() const noexcept
The property value as a serialized buffer.
const Var & getValueAsVariant() const
The property value as a variant.
Definition annotation.h:20
STL namespace.
Can hold any supported value type. Wraps std::variant to allow recursion and implements some helpers.
Definition var.h:119