#include <algorithm>
int main() {
{1, 1000},
"Greet",
const auto greeting = std::string("Hello ").append(name);
output[0].setScalarCopy(greeting);
},
);
{1, 1001},
"IncInt32ArrayValues",
auto array = input[0].getArrayCopy<int32_t>();
const auto delta = input[1].getScalarCopy<int32_t>();
std::for_each(array.begin(), array.end(), [&](auto& v) { v += delta; });
output[0].setArrayCopy(array);
},
{
"int32 array",
{"en-US", "int32[5] array"},
{5}
),
"int32 delta",
{"en-US", "int32 delta"},
),
},
{
"each entry is incremented by the delta",
{"en-US", "int32[5] array"},
{5}
),
}
);
}
UA_Argument wrapper class.
High-level node class to access node attribute, browse and populate address space.
Node addMethod(const NodeId &id, std::string_view browseName, services::MethodCallback callback, Span< const Argument > inputArguments, Span< const Argument > outputArguments, const MethodAttributes &attributes={}, const NodeId &referenceType=ReferenceTypeId::HasComponent)
Add method.
void run()
Run the server's main loop. This method will block until Server::stop is called.
View to a contiguous sequence of objects, similar to std::span in C++20.