17 if (dv.getStatus().isBad()) {
23 return std::move(dv).getValue();
30template <AttributeId Attribute>
49template <
typename T,
typename Enable =
void>
55 assert(var.isType<T>());
56 assert(var.isScalar());
57 return std::move(var).getScalar<T>();
74 return UnderlyingHandler::fromDataValue(std::move(dv)).transform([](
auto value) {
75 return static_cast<Type>(value);
80 return UnderlyingHandler::toDataValue(
static_cast<UnderlyingType>(value));
91 return UnderlyingHandler::fromDataValue(std::move(dv)).transform([](
auto value) {
97 return UnderlyingHandler::toDataValue(value.
get());
158 using Type = std::vector<uint32_t>;
162 assert(var.isType<uint32_t>());
163 assert(var.isArray());
164 return std::move(var).getArrayCopy<uint32_t>();
Represents a bad result stored in Result.
Bitmask using (scoped) enums.
std::underlying_type_t< T > Underlying
constexpr Underlying get() const noexcept
Get the bitmask as the underlying type (integer).
UA_DataType wrapper class.
UA_DataValue wrapper class.
bool hasValue() const noexcept
static DataValue fromScalar(Args &&... args)
Create DataValue from scalar value.
static DataValue fromArray(Args &&... args)
Create DataValue from array.
The template class Result encapsulates a StatusCode and optionally a value.
View to a contiguous sequence of objects, similar to std::span in C++20.
UA_Variant wrapper class.
void * data() noexcept
Get pointer to the underlying data.
Result< Variant > getVariant(DataValue &&dv) noexcept
EventNotifier
Event notifier.
AttributeId
Attribute identifiers.
@ UserExecutable
Indicates if the method is currently executable taking user access rights into account.
@ Historizing
Indicates whether the server is actively collecting data for the history of the variable.
@ Executable
Indicates if the method is currently executable.
@ DisplayName
The localized name of the node.
@ BrowseName
A non-localised human-readable name used to browse the address space.
@ Value
The most recent value of the variable that the server has.
@ MinimumSamplingInterval
Specifies (in milliseconds) how fast the server can reasonably sample the value for changes.
@ IsAbstract
If a reference is abstract, no reference of this type shall exist, only of its subtypes.
@ InverseName
The inverse name describes the reference type as seen from the target node.
@ Description
Explains the meaning of the node in a localized text.
@ UserWriteMask
Exposes the possibilities of a client to write the attributes of the node.
@ ArrayDimensions
Specifies the maximum supported length of each dimension of the Value attribute.
@ ContainsNoLoops
Indicates that by following the references in the context of the view there are no loops.
@ UserAccessLevel
Indicates how the value of a variable can be accessed (read/write) and if it contains current and/or ...
@ DataTypeDefinition
Provides the meta data and encoding information for custom data types.
@ Symmetric
If a reference is symmetric, it can seen from both the source and target node.
#define UA_STATUSCODE_BADUNEXPECTEDERROR
typename Bitmask< T >::Underlying UnderlyingType
static DataValue toDataValue(Type value)
static Result< Type > fromDataValue(DataValue &&dv) noexcept
std::underlying_type_t< Type > UnderlyingType
static Result< Type > fromDataValue(DataValue &&dv) noexcept
static DataValue toDataValue(Type value)
static Result< Type > fromDataValue(DataValue &&dv) noexcept
static DataValue toDataValue(U &&value)
static DataValue toDataValue(const Variant &value) noexcept
static Result< Variant > fromDataValue(DataValue &&dv) noexcept
static DataValue toDataValue(Span< const uint32_t > dimensions)
static Result< Type > fromDataValue(DataValue &&dv) noexcept
std::vector< uint32_t > Type
static Result< Type > fromDataValue(DataValue &&dv) noexcept
Attribute handler to convert DataValue objects to/from the attribute specific types.