18 if (dv.getStatus().isBad()) {
24 return std::move(dv).getValue();
47template <AttributeId Attribute>
66template <
typename T,
typename Enable =
void>
91 return UnderlyingHandler::fromDataValue(std::move(dv)).transform([](
auto value) {
92 return static_cast<Type>(value);
97 return UnderlyingHandler::toDataValue(
static_cast<UnderlyingType>(value));
108 return UnderlyingHandler::fromDataValue(std::move(dv)).transform([](
auto value) {
114 return UnderlyingHandler::toDataValue(value.get());
175 using Type = std::vector<uint32_t>;
Represents a bad result stored in Result.
Bitmask using (scoped) enums.
std::underlying_type_t< T > Underlying
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.
void setStatus(StatusCode status) noexcept
Set status.
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_StatusCode wrapper class.
UA_Variant wrapper class.
void * data() noexcept
Get pointer to the underlying data.
auto tryInvoke(F &&func, Args &&... args) noexcept -> typename ResultType< std::invoke_result_t< F, Args... > >::Type
Invoke a function and capture its Result (value or status code).
DataValue createDataValueFromStatus(StatusCode code) noexcept
Result< T > tryGetScalar(Variant &&var) noexcept
Result< Variant > getVariant(DataValue &&dv) noexcept
Result< std::vector< T > > tryGetArray(Variant &&var) 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) noexcept
static Result< Type > fromDataValue(DataValue &&dv) noexcept
static DataValue toDataValue(Type value) noexcept
std::underlying_type_t< Type > UnderlyingType
static Result< Type > fromDataValue(DataValue &&dv) noexcept
static Result< Type > fromDataValue(DataValue &&dv) noexcept
static DataValue toDataValue(U &&value) noexcept
static DataValue toDataValue(const Variant &value) noexcept
static Result< Variant > fromDataValue(DataValue &&dv) noexcept
static Result< Type > fromDataValue(DataValue &&dv) noexcept
std::vector< uint32_t > Type
static DataValue toDataValue(Span< const uint32_t > dimensions) noexcept
static Result< Type > fromDataValue(DataValue &&dv) noexcept
Attribute handler to convert DataValue objects to/from the attribute specific types.