int main() {
{1, 10000},
"MammalType",
.setDescription({"en-US", "A mammal"})
);
nodeMammalType
{1, 10001},
"Age",
.setDescription({"en-US", "This mammals age in months"})
.setValueScalar(0U)
)
{1, 10002},
"DogType",
.setDescription({"en-US", "A dog, subtype of mammal"})
);
nodeDogType
{1, 10003},
"Name",
.setDescription({"en-US", "This dogs name"})
.setValueScalar("unnamed dog")
)
{1, 20000},
"Bello",
.setDescription({"en-US", "A dog named Bello"}),
nodeDogType.id()
);
nodeBello.
browseChild({{1,
"Age"}}).writeValueScalar(3U);
nodeBello.
browseChild({{1,
"Name"}}).writeValueScalar(
"Bello");
}
High-level node class to access node attribute, browse and populate address space.
Node & addModellingRule(ModellingRule rule)
Add modelling rule.
Node addObjectType(const NodeId &id, std::string_view browseName, const ObjectTypeAttributes &attributes={}, const NodeId &referenceType=ReferenceTypeId::HasSubtype)
Add object type.
Node addObject(const NodeId &id, std::string_view browseName, const ObjectAttributes &attributes={}, const NodeId &objectType=ObjectTypeId::BaseObjectType, const NodeId &referenceType=ReferenceTypeId::HasComponent)
Add object.
Node addVariable(const NodeId &id, std::string_view browseName, const VariableAttributes &attributes={}, const NodeId &variableType=VariableTypeId::BaseDataVariableType, const NodeId &referenceType=ReferenceTypeId::HasComponent)
Add variable.
Node browseChild(Span< const QualifiedName > path)
Browse child node specified by its relative path from this node (only local nodes).
UA_ObjectAttributes wrapper class.
auto & setDisplayName(const LocalizedText &displayName)
UA_ObjectTypeAttributes wrapper class.
auto & setDisplayName(const LocalizedText &displayName)
void run()
Run the server's main loop. This method will block until Server::stop is called.
UA_VariableAttributes wrapper class.
auto & setDisplayName(const LocalizedText &displayName)