Address space
The node/reference graph model, instantiation engine, conditions, and NodeSet helpers.
ua::ConditionBranch
struct
A prior condition state that was retained because it still needs operator attention.
A branch is created when the trunk transitions while an unacknowledged or unconfirmed state is outstanding, so the earlier state is not lost. The snapshot is a polymorphic BaseEvent captured via build_event() at branch-creation time; acknowledgement and confirmation are tracked by mutating the snapshot's fields in place.
Public attributes
NodeId branchId
Non-null Guid NodeId identifying this branch.
ByteString eventId
EventId of the branch's last emitted event; assigned by the shell after emission.
std::unique_ptr< BaseEvent > snapshot
Owned snapshot of the full event state at branch-creation time.
ua::AcknowledgeableConditionLogic
class
Pure state machine for the OPC UA AcknowledgeableConditionType (Part 9).
Extends ConditionLogic with AckedState and an optional ConfirmedState, and tracks any outstanding branches. The retain computation accounts for acknowledgement and confirmation in addition to enable state. Like its base, this holds state only: no I/O, no address space, no strands. A strand-serialized shell drives async work and feeds results back via the setters.
Functions
~AcknowledgeableConditionLogic() override=default
AcknowledgeableConditionLogic()=default
Default constructor: the deleted copy/move members above suppress the implicit default ctor; this concrete logic type is default-constructed directly and by subclasses.
ConditionStateTransition acknowledge(const ByteString &eventId, const LocalizedText &comment)
Acknowledges the condition (or branch) identified by an EventId.
eventId(const ByteString &) - EventId of the trunk or branch event being acknowledged.comment(const LocalizedText &) - Operator comment to attach to the acknowledgement.
Returns: The resulting transition. Its status is BadEventIdUnknown if eventId matches no outstanding event, or BadConditionBranchAlreadyAcked if it is already acknowledged.
ConditionStateTransition add_comment(const ByteString &eventId, const LocalizedText &comment) override
Adds a comment to the condition or one of its branches.
eventId(const ByteString &) - EventId of the trunk or branch event to comment on.comment(const LocalizedText &) - Comment to attach.
Returns: The resulting transition; its status is BadEventIdUnknown if eventId matches no outstanding event.
ConditionStateTransition confirm(const ByteString &eventId, const LocalizedText &comment)
Confirms the condition (or branch) identified by an EventId.
eventId(const ByteString &) - EventId of the trunk or branch event being confirmed.comment(const LocalizedText &) - Operator comment to attach to the confirmation.
Returns: The resulting transition. Its status is BadEventIdUnknown if eventId matches no outstanding event, or BadConditionBranchAlreadyConfirmed if it is already confirmed or if confirmation is not supported.
bool supports_confirm() const
Returns whether ConfirmedState is supported.
Returns: true if ConfirmedState is supported.
void set_supports_confirm(bool value)
Enables or disables ConfirmedState support.
value(bool) - true to enable ConfirmedState support; false to disable it.
void set_supports_branches(bool value)
Enables or disables branch support (optional per Part 9 4.2).
value(bool) - true to enable branch support; false to disable it.
void set_max_branches(size_t maxBranches)
Sets the maximum number of live ConditionBranches retained at once (memory bound).
maxBranches(size_t) - Maximum number of live ConditionBranches to retain at once; clamped to a minimum of 1.
const std::vector< ConditionBranch > & branches() const
Returns read-only access to the live branches.
Returns: The live branches; the reference stays valid only until the next mutation of this logic object.
void set_branch_event_id(const NodeId &branchId, ByteString eventId)
Records the EventId assigned by the EventBus after emitting a branch event.
branchId(const NodeId &) - Identifier of the branch to update.eventId(ByteString) - EventId assigned to the branch's most recent event.
void remove_branch(const NodeId &branchId)
Removes a resolved branch.
branchId(const NodeId &) - Identifier of the branch to remove.
Builds a clone of a branch's snapshot event with its branch_id and Retain flag set.
branchId(const NodeId &) - Identifier of the branch to clone.retain(bool) - Value to set on the cloned event's Retain field.
Returns: An owned clone of the branch's snapshot, or nullptr if no branch matches branchId.
void set_last_event_id(ByteString eventId) override
Records the EventId assigned after emitting the trunk event.
eventId(ByteString) - EventId assigned to the most recently emitted trunk event.
void set_initial_acked(bool acked)
Sets the initial acknowledged state without triggering transitions or events.
acked(bool) - Initial AckedState.Id value.
void set_initial_confirmed(bool confirmed)
Sets the initial confirmed state without triggering transitions or events.
confirmed(bool) - Initial ConfirmedState.Id value.
std::unique_ptr< BaseEvent > build_event() const override
Builds an AcknowledgeableConditionType event struct from the current state.
Returns: An owned event carrying the current condition state.
ua::AlarmConditionLogic
class
Pure state machine for the OPC UA AlarmConditionType (Part 9).
Extends AcknowledgeableConditionLogic with ActiveState plus the optional alarm sub-states: shelving, suppression, out-of-service, silence, latching, and on/off delay behaviour. Like its base classes this is a pure logic object: it performs no I/O, owns no address space, and is not strand-serialized. Each mutator returns a ConditionStateTransition that a strand-serialized shell inspects to drive event emission and timer commands; none of these methods throw.
Functions
~AlarmConditionLogic() override=default
AlarmConditionLogic()=default
Default constructor: the deleted copy/move members above suppress the implicit default ctor; this concrete logic type is default-constructed directly and by subclasses.
ConditionStateTransition activate(uint16_t severity)
Activates the alarm.
severity(uint16_t) - New alarm severity, 1..1000 per Part 8.
Returns: The resulting state transition for the shell to apply.
ConditionStateTransition deactivate()
Deactivates the alarm.
Returns: The resulting state transition for the shell to apply.
ConditionStateTransition suppress()
Sets SuppressedState to suppressed.
Returns: The resulting state transition. No-op unless suppression is supported.
ConditionStateTransition suppress(const LocalizedText &comment)
Suppresses the alarm and records a comment against it (Suppress2, OPC 10000-9 5.8.9).
comment(const LocalizedText &) - Comment to apply; a NULL comment leaves any existing one unchanged.
Returns: The resulting state transition, identical to suppress().
ConditionStateTransition unsuppress()
Clears SuppressedState back to unsuppressed.
Returns: The resulting state transition. No-op unless suppression is supported.
ConditionStateTransition unsuppress(const LocalizedText &comment)
Unsuppresses the alarm and records a comment against it (Unsuppress2, OPC 10000-9 5.8.11).
comment(const LocalizedText &) - Comment to apply; a NULL comment leaves any existing one unchanged.
Returns: The resulting state transition, identical to unsuppress().
ConditionStateTransition remove_from_service()
Sets OutOfServiceState to out-of-service.
Returns: The resulting state transition. No-op unless out-of-service is supported.
ConditionStateTransition remove_from_service(const LocalizedText &comment)
Takes the alarm out of service and records a comment against it (RemoveFromService2, OPC 10000-9 5.8.13).
comment(const LocalizedText &) - Comment to apply; a NULL comment leaves any existing one unchanged.
Returns: The resulting state transition, identical to remove_from_service().
ConditionStateTransition place_in_service()
Clears OutOfServiceState back to in-service.
Returns: The resulting state transition. No-op unless out-of-service is supported.
ConditionStateTransition place_in_service(const LocalizedText &comment)
Returns the alarm to service and records a comment against it (PlaceInService2, OPC 10000-9 5.8.15).
comment(const LocalizedText &) - Comment to apply; a NULL comment leaves any existing one unchanged.
Returns: The resulting state transition, identical to place_in_service().
ConditionStateTransition silence()
Sets SilenceState to silenced.
Returns: The resulting state transition. No-op unless silence is supported.
ConditionStateTransition timed_shelve(double durationMs)
Shelves the alarm for a fixed duration (TimedShelved).
durationMs(double) - Shelve duration in milliseconds; clamped to the configured MaxTimeShelved when set.
Returns: The resulting state transition, including a start-shelve-timer command for the shell.
ConditionStateTransition timed_shelve(double durationMs, const LocalizedText &comment)
Shelves the alarm for a fixed duration and records a comment against it (TimedShelve2, OPC 10000-9 5.8.17.5).
durationMs(double) - Shelve duration in milliseconds.comment(const LocalizedText &) - Comment to apply; a NULL comment leaves any existing one unchanged.
Returns: The resulting state transition, identical to timed_shelve(double).
ConditionStateTransition one_shot_shelve()
Shelves the alarm until it next deactivates and reactivates (OneShotShelved).
Returns: The resulting state transition.
ConditionStateTransition one_shot_shelve(const LocalizedText &comment)
One-shot shelves the alarm and records a comment against it (OneShotShelve2, OPC 10000-9 5.8.17.7).
comment(const LocalizedText &) - Comment to apply; a NULL comment leaves any existing one unchanged.
Returns: The resulting state transition, identical to one_shot_shelve().
ConditionStateTransition unshelve()
Returns the alarm to the Unshelved state.
Returns: The resulting state transition, including a cancel-shelve-timer command for the shell.
ConditionStateTransition unshelve(const LocalizedText &comment)
Unshelves the alarm and records a comment against it (Unshelve2, OPC 10000-9 5.8.17.3).
comment(const LocalizedText &) - Comment to apply; a NULL comment leaves any existing one unchanged.
Returns: The resulting state transition, identical to unshelve().
ConditionStateTransition on_shelve_timer_expired()
Handles expiry of the shelve timer started by timed_shelve.
Returns: The resulting state transition.
ConditionStateTransition on_delay_expired()
Handles expiry of the on-delay timer, committing a delayed activation.
Returns: The resulting state transition.
ConditionStateTransition off_delay_expired()
Handles expiry of the off-delay timer, committing a delayed deactivation.
Returns: The resulting state transition.
ConditionStateTransition on_re_alarm_timer_expired()
Handles expiry of the configured ReAlarmTime while the Alarm remains active.
Returns: The resulting state transition, or a no-op when disabled, inactive, or unconfigured.
ConditionStateTransition evaluate_input(const Variant &value, DateTime timestamp)
Evaluates a new input sample and updates alarm state accordingly.
value(const Variant &) - The newly sampled input value.timestamp(DateTime) - Source timestamp of the sample.
Returns: The resulting state transition for the shell to apply.
ConditionStateTransition reset()
Resets a latched alarm whose input has already cleared.
Returns: The resulting state transition. No-op unless latching is supported.
ConditionStateTransition reset(const LocalizedText &comment)
Resets a latched alarm and records a comment against it (Reset2, OPC 10000-9 5.8.6).
comment(const LocalizedText &) - Comment to apply; a NULL comment leaves any existing one unchanged.
Returns: The resulting state transition, identical to reset().
void set_initial_active(bool active, uint16_t severity)
Sets the initial active state without triggering transitions or events.
active(bool) - Initial ActiveState value.severity(uint16_t) - Initial severity, 1..1000.
void set_initial_acked(bool acked)
Seeds AckedState and, when SilenceState was not independently recovered, uses it as the required recovery fallback for SilenceState.
acked(bool) - Initial AckedState value: true for a condition recovered as acknowledged. When the alarm carries the optional SilenceState and no initial silence was set, this value also seeds SilenceState (silenced when acknowledged), which is the recovery fallback rather than an equivalence between the two states.
void set_initial_suppressed(bool suppressed)
Sets the initial suppressed state without triggering transitions or events.
suppressed(bool) - Initial SuppressedState value.
void set_initial_out_of_service(bool outOfService)
Sets the initial out-of-service state without triggering transitions or events.
outOfService(bool) - Initial OutOfServiceState value.
void set_initial_silenced(bool silenced)
Sets the initial silence state without triggering transitions or events.
silenced(bool) - Initial SilenceState value.
void set_initial_latched(bool latched)
Sets the initial latched state without triggering transitions or events.
latched(bool) - Initial LatchedState value.
void set_initial_shelved(ShelveState state)
Sets the initial shelve state without triggering transitions or events.
state(ShelveState) - Initial ShelveState.
void set_input_node(NodeId nodeId)
Sets the NodeId of the input source whose samples drive this alarm.
nodeId(NodeId) - NodeId of the input source whose samples drive this alarm.
void set_max_time_shelved(double ms)
Sets the maximum permitted shelve duration in milliseconds (MaxTimeShelved).
ms(double) - Upper bound applied to timed_shelve durations; 0 disables the cap.
void set_on_delay(double ms)
Sets the on-delay in milliseconds applied before a pending activation takes effect.
ms(double) - Delay duration in milliseconds; 0 disables the delay.
void set_off_delay(double ms)
Sets the off-delay in milliseconds applied before a pending deactivation takes effect.
ms(double) - Delay duration in milliseconds; 0 disables the delay.
void set_re_alarm_time(double ms)
Sets the re-alarm interval in milliseconds (ReAlarmTime).
ms(double) - Repeat interval in milliseconds; a non-positive value disables re-alarming.
void set_supports_suppressed(bool value)
Enables or disables the optional SuppressedState sub-state.
value(bool) - true to enable the SuppressedState sub-state; false to disable it.
void set_supports_out_of_service(bool value)
Enables or disables the optional OutOfServiceState sub-state.
value(bool) - true to enable the OutOfServiceState sub-state; false to disable it.
void set_supports_silence(bool value)
Enables or disables the optional SilenceState sub-state.
value(bool) - true to enable the SilenceState sub-state; false to disable it.
void set_supports_latched(bool value)
Enables or disables the optional LatchedState sub-state.
value(bool) - true to enable the LatchedState sub-state; false to disable it.
bool supports_suppressed() const
Returns whether the SuppressedState sub-state is supported.
Returns: true if the SuppressedState sub-state is supported.
bool supports_out_of_service() const
Returns whether the OutOfServiceState sub-state is supported.
Returns: true if the OutOfServiceState sub-state is supported.
bool supports_silence() const
Returns whether the SilenceState sub-state is supported.
Returns: true if the SilenceState sub-state is supported.
bool supports_latched() const
Returns whether the LatchedState sub-state is supported.
Returns: true if the LatchedState sub-state is supported.
std::unique_ptr< BaseEvent > build_event() const override
Builds an alarm event snapshot from the current state.
Returns: A newly allocated event whose ownership transfers to the caller.
ShelveState shelve_state() const
Returns the current ShelveState.
Returns: The current ShelveState.
ua::CertificateExpirationAlarmLogic
class
State machine for the OPC UA CertificateExpirationAlarmType (Part 9, 5.8.24.7).
Monitors a certificate's expiration. The alarm activates once the current time plus the configured expiration limit reaches or passes the certificate's expiration date, signalling that the certificate is due for renewal before it expires. Extends OffNormalAlarmLogic.
This is a synchronous in-memory state machine: callers drive it from the owning condition's serialization context and inspect the returned ConditionStateTransition to decide what events and timer commands to run. It performs no I/O and never blocks.
Functions
~CertificateExpirationAlarmLogic() override=default
CertificateExpirationAlarmLogic()=default
Default constructor: the deleted copy/move members above suppress the implicit default ctor; this concrete logic type is default-constructed directly and by subclasses.
void set_expiration_date(DateTime expirationDate)
Sets the certificate's expiration date used by evaluate_expiration.
expirationDate(DateTime) - Absolute time at which the monitored certificate expires.
void set_expiration_limit(double ms)
Sets how far before expiry the alarm activates.
ms(double) - Lead time before the expiration date, in milliseconds. Defaults to two weeks (1209600000 ms) until overridden.
void set_certificate_type(NodeId certType)
Sets the NodeId of the certificate type this alarm reports.
certType(NodeId) - NodeId identifying the certificate's type (e.g. application instance certificate). Surfaced on the emitted event.
void set_certificate(ByteString cert)
Sets the DER-encoded certificate this alarm reports.
cert(ByteString) - The monitored certificate as a DER byte string. Surfaced on the emitted event.
ConditionStateTransition evaluate_expiration(DateTime now)
Evaluates whether the certificate is within its expiration limit.
now(DateTime) - The current time to evaluate against.
Returns: The resulting ConditionStateTransition. The shell inspects it to decide whether to emit an event and which timer commands to run.
std::unique_ptr< BaseEvent > build_event() const override
Builds the event for the current alarm state.
Returns: A newly constructed event describing the current state. Ownership transfers to the caller.
ua::TimerCommand
struct
A timer operation that the Condition shell must execute after a state transition.
Produced by the pure ConditionStateTransition logic and replayed by the owning Condition instance, which schedules or cancels the corresponding alarm timer (on/off delay, shelving, or re-alarm) on its strand.
Member types
Kind (enum)
The timer and operation a command refers to.
None- No-op; the command carries no timer action.StartOnDelay- (Re)start the active-state on-delay timer.CancelOnDelay- Cancel any pending on-delay timer.StartOffDelay- (Re)start the inactive-state off-delay timer.CancelOffDelay- Cancel any pending off-delay timer.StartShelveTimer- (Re)start the one-shot/timed-shelving unshelve timer.CancelShelveTimer- Cancel any pending shelving timer.StartReAlarmTimer- (Re)start the re-alarm repeat timer.CancelReAlarmTimer- Cancel any pending re-alarm timer.
Public attributes
Kind kind
Which timer to act on, and whether to start or cancel it.
double durationMs
Delay before the timer fires, in milliseconds; ignored for cancel kinds.
ua::BranchEventData
struct
A branch event that the Condition shell must emit after a state transition.
Each entry corresponds to one ConditionBranch whose state changed and must be reported to subscribers via an event.
Public attributes
NodeId branchId
Identifier of the ConditionBranch the event reports on.
bool retain
true to emit a normal branch event; false to emit the final event (Retain=False) that deletes the branch.
ua::ConditionStateTransition
struct
The outcome of a ConditionLogic state mutation.
Returned by the pure Condition logic and inspected by the owning Condition instance (the "shell"), which decides whether to emit the condition event, replay the timer commands, emit any branch events, and what status to report back to the caller. This is a plain value with no ownership or threading semantics of its own.
Public attributes
bool changed
true if the mutation altered any condition state.
bool emitEvent
true if the shell must emit the main condition event.
StatusCode status
Status to report back to the caller of the mutation.
std::vector< TimerCommand > timerCommands
Timer operations to execute, in order.
std::vector< BranchEventData > branchEvents
Branch events to emit, in order.
ua::ConditionLogic
class
Pure state machine for the OPC UA ConditionType (Part 9).
Holds all condition state and exposes deterministic, side-effect-free transitions. Performs no I/O, holds no address-space references, and is not strand-serialized - every method runs synchronously on the caller's thread and never blocks. Intended for the Logic/Shell split pattern: a strand-serialized shell component owns this object, drives the async operations it describes (event emission, timer commands), and feeds the results back in.
State mutations return a ConditionStateTransition that tells the shell whether an event must be emitted, which timer commands to run, and the status to report to the caller; the logic object itself never emits events.
Subclasses (AcknowledgeableConditionLogic, AlarmConditionLogic, etc.) override the protected extension points - compute_retain(), on_enabled(), on_disabled() - to add their type-specific behavior.
Not thread-safe. The owning shell must serialize all access (its strand provides this).
Functions
~ConditionLogic()=default
ConditionLogic()=default
Default constructor: the deleted copy/move members above suppress the implicit default ctor; this concrete logic type is default-constructed directly and by subclasses.
ConditionStateTransition enable()
Enables the condition.
Returns: The resulting transition. Carries status BadConditionAlreadyEnabled (and no change) when the condition was already enabled.
ConditionStateTransition disable()
Disables the condition.
Returns: The resulting transition. Carries status BadConditionAlreadyDisabled (and no change) when the condition was already disabled.
ConditionStateTransition add_comment(const ByteString &eventId, const LocalizedText &comment)
Adds a comment to the condition or one of its branches.
eventId(const ByteString &) - EventId of the event the comment refers to, used to select the target branch.comment(const LocalizedText &) - Comment text to record.
Returns: The resulting transition.
ConditionStateTransition set_quality(StatusCode quality)
Updates the condition quality.
quality(StatusCode) - New quality status code.
Returns: The resulting transition; requests an event emission when the condition is retained.
ConditionStateTransition set_severity(uint16_t severity)
Updates the condition severity.
severity(uint16_t) - New severity, in OPC UA severity units (1-1000).
Returns: The resulting transition; requests an event emission when the condition is retained.
void set_initial_enabled(bool enabled)
Sets the initial enabled state without triggering any transition or event.
enabled(bool) - Initial enabled flag.
Sets the source node and source name reported in emitted events.
sourceNode(NodeId) - NodeId of the source the condition relates to.sourceName(String) - Human-readable source name.
void set_condition_name(String name)
Sets the condition name reported in emitted events.
name(String) - Condition name reported in emitted events.
void set_condition_class(NodeId classId, LocalizedText className)
Sets the condition class identifier and its display name.
classId(NodeId) - NodeId of the condition class (e.g. a well-known ConditionClassType).className(LocalizedText) - Localized display name of the condition class.
void set_client_user_id(String userId)
Sets the ClientUserId recorded on the next comment/acknowledge interaction.
userId(String) - ClientUserId to record on the next comment/acknowledge interaction.
void set_supports_filtered_retain(bool value)
Sets whether the condition supports the FilteredRetain behavior.
value(bool) - true to enable FilteredRetain behavior support; false to disable it.
void set_last_event_id(ByteString eventId)
Sets the last event ID.
eventId(ByteString) - EventId of the most recently emitted event.
const ByteString & last_event_id() const
Returns the last emitted event ID, used to correlate ConditionRefresh.
Returns: Reference to the stored EventId; valid until the next set_last_event_id() call.
std::unique_ptr< BaseEvent > build_event() const
Builds an event struct populated from the current condition state.
Returns: An owning pointer to a freshly built event; never null.
ua::DialogConditionLogic
class
Pure state machine for the OPC UA DialogConditionType (Part 9).
Extends ConditionLogic with dialog-specific state: the prompt, the response-option set, and the DialogState two-state variable. Dialogs are not alarms - they derive directly from ConditionLogic. A dialog is activated with a prompt and is then awaiting a response; responses are validated against the configured number of options.
Like its base, this is a synchronous, side-effect-free logic object: it holds no I/O, address space, or strands. Each mutation returns a ConditionStateTransition that the owning strand-serialized shell inspects to decide whether to emit an event and what status to report to the caller.
Functions
~DialogConditionLogic() override=default
DialogConditionLogic()=default
Default constructor: the deleted copy/move members above suppress the implicit default ctor; this concrete logic type is default-constructed directly and by subclasses.
ConditionStateTransition activate_dialog(LocalizedText prompt)
Activates the dialog with the given prompt, entering the active DialogState.
prompt(LocalizedText) - Text shown to the client for this dialog. Taken by value.
Returns: The resulting state transition for the shell to apply.
ConditionStateTransition respond(int32_t selectedResponse)
Responds to the active dialog with the selected option.
selectedResponse(int32_t) - Zero-based option index in the range 0 .. numOptions - 1 (see set_response_options()).
Returns: The resulting state transition. Its status is BadDialogNotActive when the dialog is not currently active, or BadDialogResponseInvalid when selectedResponse is out of range.
ConditionStateTransition respond(int32_t selectedResponse, LocalizedText comment)
Responds to the active dialog and updates the condition comment.
selectedResponse(int32_t) - Zero-based option index, validated as in respond(int32_t).comment(LocalizedText) - Comment to record alongside the response. Taken by value.
Returns: The resulting state transition, with the same status semantics as respond(int32_t).
void set_response_options(int32_t numOptions)
Sets the number of valid response options accepted by respond().
numOptions(int32_t) - Count of selectable options; valid response indices are 0 .. numOptions - 1.
void set_default_response(int32_t index)
Sets the default response option index.
index(int32_t) - Zero-based option index, or -1 for none.
void set_ok_response(int32_t index)
Sets the option index that represents the OK response.
index(int32_t) - Zero-based option index, or -1 for none.
void set_cancel_response(int32_t index)
Sets the option index that represents the Cancel response.
index(int32_t) - Zero-based option index, or -1 for none.
std::unique_ptr< BaseEvent > build_event() const override
Builds a dialog-condition event populated from the current state.
Returns: A newly allocated event carrying the dialog fields plus the inherited condition fields. Ownership transfers to the caller.
ua::DiscrepancyAlarmLogic
class
State machine for the OPC UA DiscrepancyAlarmType (Part 9, 5.8.25).
Monitors whether an input value reaches a configured target value within an expected time. When the input differs from the target (outside tolerance) for longer than the expected time, the alarm activates; when the input reaches the target, the alarm deactivates. Like every ConditionLogic this is a pure state machine: it performs no I/O, owns no strand, and is driven by a shell component that feeds it inputs and acts on the returned transitions.
Functions
~DiscrepancyAlarmLogic() override=default
DiscrepancyAlarmLogic()=default
Default constructor: the deleted copy/move members above suppress the implicit default ctor; this concrete logic type is default-constructed directly and by subclasses.
void set_target_value_node(NodeId nodeId)
Sets the NodeId of the variable that holds the target value.
nodeId(NodeId) - NodeId of the target-value variable.
void set_expected_time(double ms)
Sets the time the input may discrepate from the target before the alarm activates.
ms(double) - Expected time to reach the target, in milliseconds.
void set_tolerance(double tolerance)
Sets the tolerance band used for target comparison.
tolerance(double) - Maximum absolute difference, in input units, still treated as at-target.
void set_target_value(Variant value)
Sets the current target value the input is compared against.
value(Variant) - Target value; its type should match the input supplied to evaluate_input.
ConditionStateTransition evaluate_input(const Variant &value, DateTime timestamp) override
Evaluates a new input sample against the target and updates alarm state.
value(const Variant &) - The input sample to evaluate.timestamp(DateTime) - Source timestamp of the sample, used to measure how long the input has been discrepant.
Returns: The state transition produced by the evaluation.
std::unique_ptr< BaseEvent > build_event() const override
Builds a DiscrepancyAlarmType event populated from the current state.
Returns: An owning event struct carrying this alarm's fields; never null.
ua::DiscreteAlarmLogic
class
Pure state machine for the OPC UA DiscreteAlarmType (Part 9).
A discrete alarm is driven by changes to a discrete input rather than by limit comparison against an analog process value. It inherits the full AlarmConditionLogic behavior (activation, shelving, suppression, out-of-service, silence, latching, on/off delays) unchanged and only specializes the emitted event type. Like its bases it performs no I/O and touches no address space or strand; a strand-serialized shell drives it.
Functions
~DiscreteAlarmLogic() override=default
DiscreteAlarmLogic()=default
Default constructor: the deleted copy/move members above suppress the implicit default ctor; this concrete logic type is default-constructed directly and by subclasses.
std::unique_ptr< BaseEvent > build_event() const override
Builds a DiscreteAlarm event struct from the current alarm state.
Returns: An owning handle to the freshly built event; never null.
ua::ConfiguredLimit
class
One limit exposed by a LimitAlarmType.
A configured limit may carry its numeric threshold or may be unavailable because the underlying system cannot supply the actual value. The latter remains an exposed Property but is excluded from alarm evaluation and has no Event-field value.
Static functions
ConfiguredLimit unavailable() noexcept
Constructs a configured limit whose actual value is unavailable.
Returns: A present but unavailable limit.
Functions
ConfiguredLimit(double value) noexcept
Constructs an available configured limit.
value(double) - Numeric threshold in the input's engineering units.
ConfiguredLimit & operator=(double value) noexcept
Replaces this limit with an available numeric threshold.
value(double) - Numeric threshold in the input's engineering units.
Returns: This configured limit.
bool is_available() const noexcept
Returns whether the underlying system supplied the numeric threshold.
Returns: true when a threshold was supplied; false when the limit is configured - the model declares it - but its actual value is not known to this server.
const std::optional< double > & value() const noexcept
Returns the supplied threshold, or empty when its actual value is unavailable.
Returns: The threshold in the input's engineering units, or an empty optional when the limit is configured but unavailable - the same distinction is_available reports.
ua::LimitConfig
struct
Configuration for limit thresholds, per-limit deadbands, and per-limit severities.
Each limit has three states: an absent outer optional is not exposed, an available ConfiguredLimit is exposed and evaluated, and an unavailable ConfiguredLimit is exposed with CurrentRead cleared but is not evaluated. Available values use the same engineering units as the alarm's input. Severities are OPC UA severity values in the range 1..1000.
Public attributes
std::optional< ConfiguredLimit > highHighLimit
HighHigh limit; unset omits the Property.
std::optional< ConfiguredLimit > highLimit
High limit; unset omits the Property.
std::optional< ConfiguredLimit > lowLimit
Low limit; unset omits the Property.
std::optional< ConfiguredLimit > lowLowLimit
LowLow limit; unset omits the Property.
double highHighDeadband
Per-limit deadbands.
double highDeadband
Deadband for the High limit, in input units.
double lowDeadband
Deadband for the Low limit, in input units.
double lowLowDeadband
Deadband for the LowLow limit, in input units.
uint16_t severityHighHigh
Per-limit severity values.
uint16_t severityHigh
Severity reported while the High limit is active.
uint16_t severityLow
Severity reported while the Low limit is active.
uint16_t severityLowLow
Severity reported while the LowLow limit is active.
ua::LimitAlarmLogic
class
State machine for the OPC UA LimitAlarmType (Part 9).
Extends AlarmConditionLogic with limit evaluation, deadband support, and exclusive/non-exclusive limit modes.
In exclusive mode, only the most severe violated limit is active at a time. In non-exclusive mode, each limit is evaluated independently and multiple can be active simultaneously.
Functions
~LimitAlarmLogic() override=default
LimitAlarmLogic()=default
Default constructor: the deleted copy/move members above suppress the implicit default ctor; this concrete logic type is default-constructed directly and by subclasses.
void set_limits(LimitConfig config)
Sets the limit thresholds, deadbands, and severities.
config(LimitConfig) - New limit configuration; ownership is taken by value.
void set_exclusive(bool exclusive)
Selects exclusive (true) or non-exclusive (false) limit mode.
exclusive(bool) - true for exclusive mode, false for non-exclusive mode.
void enable_rate_of_change_per_second()
Enables evaluation of limits against the input's rate of change per second.
ActiveLimit active_limit() const
Returns the currently active limit.
Returns: The active limit, or ActiveLimit::None when no limit is violated.
bool high_high_active() const
Returns whether the HighHigh limit is currently active (non-exclusive mode).
Returns: true when the HighHigh limit is currently violated.
bool high_active() const
Returns whether the High limit is currently active (non-exclusive mode).
Returns: true when the High limit is currently violated.
bool low_active() const
Returns whether the Low limit is currently active (non-exclusive mode).
Returns: true when the Low limit is currently violated.
bool low_low_active() const
Returns whether the LowLow limit is currently active (non-exclusive mode).
Returns: true when the LowLow limit is currently violated.
const LimitConfig & limits() const
Returns the current limit configuration.
Returns: A reference valid until the next set_limits call.
bool exclusive() const
Returns whether exclusive mode is enabled.
Returns: true when exclusive limit mode is enabled, false for non-exclusive mode.
ConditionStateTransition evaluate_input(const Variant &value, DateTime timestamp) override
Evaluates a new input value against the configured limits and updates state.
value(const Variant &) - New process value to evaluate; must be numeric to take effect.timestamp(DateTime) - Source timestamp associated with the value.
Returns: The resulting state transition (which states changed, and whether an event should be emitted).
std::unique_ptr< BaseEvent > build_event() const override
Builds the event instance reflecting the current limit-alarm state.
Returns: A newly allocated event populated with the current condition state; ownership transfers to the caller.
ua::OffNormalAlarmLogic
class
State machine for the OPC UA OffNormalAlarmType (Part 9).
Extends DiscreteAlarmLogic with a comparison against a configured "normal" state. On each input evaluation the alarm activates when the input value differs from the normal state and deactivates when it equals the normal state. The comparison is by value equality of the Variant.
Functions
~OffNormalAlarmLogic() override=default
OffNormalAlarmLogic()=default
Default constructor: the deleted copy/move members above suppress the implicit default ctor; this concrete logic type is default-constructed directly and by subclasses.
void set_normal_state(Variant normalValue)
Sets the value that represents the "normal" (non-alarming) state.
normalValue(Variant) - Value taken to represent the normal state.
void set_normal_state_node(NodeId nodeId)
Sets the NodeId of the NormalState property exposed by the alarm node.
nodeId(NodeId) - NodeId of the NormalState property in the address space.
ConditionStateTransition evaluate_input(const Variant &value, DateTime timestamp) override
Evaluates a new input value against the normal state and returns the resulting condition state transition.
value(const Variant &) - New input value to evaluate.timestamp(DateTime) - Source timestamp associated with the input change.
Returns: The transition describing any resulting condition state change.
std::unique_ptr< BaseEvent > build_event() const override
Builds an OffNormalAlarm event reflecting the current alarm state.
Returns: A newly allocated event whose ownership is transferred to the caller; never null.
ua::FileHelper
class
Convenience class that backs a FileType address-space node with real filesystem I/O.
All six FileType methods (Open, Close, Read, Write, GetPosition, SetPosition) are wired automatically to operate on the given filesystem path. Concurrent clients receive independent file handles with independent stream positions. The four mandatory properties (Size, Writable, UserWritable, OpenCount) are populated automatically; Size and OpenCount are dynamic, queried from live state by their read handlers.
A helper created via create_async/create_sync owns the FileType subtree it instantiates and removes it on destruction (RAII); call release to detach that ownership. A helper produced by attach_async/attach_sync wraps a pre-existing node and never owns it.
Member types
std::function< void(FileHelperResult)> CreateCompleteCallback
Callback type reporting the outcome of create_async.
std::function< void(FileHelperResult)> AttachCompleteCallback
Callback type reporting the outcome of attach_async.
Static functions
void create_async(AddressSpace addressSpace, const NodeId &parent, const QualifiedName &browseName, std::filesystem::path filePath, const InstantiationOptions &options, bool writable, CreateCompleteCallback complete) noexcept
Creates a new FileType instance under parent and wires all method/property handlers.
addressSpace(AddressSpace) - Address space in which the node is created.parent(const NodeId &) - Node under which the new FileType instance is created.browseName(const QualifiedName &) - Browse name of the new node.filePath(std::filesystem::path) - Filesystem path the FileType methods operate on.options(const InstantiationOptions &) - Instantiation options for the new subtree.writable(bool) - Whether the file may be opened for writing (drives the Writable / UserWritable properties and rejects write opens when false).complete(CreateCompleteCallback) - Receives the outcome: on success the Result holds the owning FileHelper; on failure it carries an ErrorDetail. This overload never throws.
FileHelperResult try_create_sync(AddressSpace addressSpace, const NodeId &parent, const QualifiedName &browseName, std::filesystem::path filePath, const InstantiationOptions &options, bool writable=true) noexcept
Creates a new FileType instance under parent, blocking until complete.
addressSpace(AddressSpace) - Address space in which the node is created.parent(const NodeId &) - Node under which the new FileType instance is created.browseName(const QualifiedName &) - Browse name of the new node.filePath(std::filesystem::path) - Filesystem path the FileType methods operate on.options(const InstantiationOptions &) - Instantiation options for the new subtree.writable(bool) - Whether the file may be opened for writing (drives the Writable / UserWritable properties and rejects write opens when false).
Returns: The owning FileHelper, or an ErrorDetail on failure. Never throws.
FileHelper create_sync(AddressSpace addressSpace, const NodeId &parent, const QualifiedName &browseName, std::filesystem::path filePath, const InstantiationOptions &options, bool writable=true)
Creates a new FileType instance under parent, blocking until complete.
addressSpace(AddressSpace) - Address space in which the node is created.parent(const NodeId &) - Node under which the new FileType instance is created.browseName(const QualifiedName &) - Browse name of the new node.filePath(std::filesystem::path) - Filesystem path the FileType methods operate on.options(const InstantiationOptions &) - Instantiation options for the new subtree.writable(bool) - Whether the file may be opened for writing (drives the Writable / UserWritable properties and rejects write opens when false).
Returns: The owning FileHelper.
void attach_async(AddressSpace addressSpace, const NodeId &existingInstance, std::filesystem::path filePath, bool writable, AttachCompleteCallback complete) noexcept
Wraps an existing FileType node and wires all method/property handlers.
addressSpace(AddressSpace) - Address space containing the node.existingInstance(const NodeId &) - Node id of the existing FileType instance to back.filePath(std::filesystem::path) - Filesystem path the FileType methods operate on.writable(bool) - Whether the file may be opened for writing (drives the Writable / UserWritable properties and rejects write opens when false).complete(AttachCompleteCallback) - Receives the outcome: on success the Result holds the non-owning FileHelper; on failure it carries an ErrorDetail. This overload never throws.
FileHelperResult try_attach_sync(AddressSpace addressSpace, const NodeId &existingInstance, std::filesystem::path filePath, bool writable=true) noexcept
Wraps an existing FileType node, blocking until complete.
addressSpace(AddressSpace) - Address space containing the node.existingInstance(const NodeId &) - Node id of the existing FileType instance to back.filePath(std::filesystem::path) - Filesystem path the FileType methods operate on.writable(bool) - Whether the file may be opened for writing (drives the Writable / UserWritable properties and rejects write opens when false).
Returns: The non-owning FileHelper, or an ErrorDetail on failure. Never throws.
FileHelper attach_sync(AddressSpace addressSpace, const NodeId &existingInstance, std::filesystem::path filePath, bool writable=true)
Wraps an existing FileType node, blocking until complete.
addressSpace(AddressSpace) - Address space containing the node.existingInstance(const NodeId &) - Node id of the existing FileType instance to back.filePath(std::filesystem::path) - Filesystem path the FileType methods operate on.writable(bool) - Whether the file may be opened for writing (drives the Writable / UserWritable properties and rejects write opens when false).
Returns: The non-owning FileHelper.
Functions
FileHelper()=default
Constructs an empty helper that backs no node.
const NodeId & node_id() const
Returns the node id of the backed FileType instance.
Returns: The node id of the backed FileType instance.
const File & file() const
Returns the File handle wrapping the backed FileType instance.
Returns: The File handle wrapping the backed FileType instance.
Open the backing file and return the FileType handle a Client would get from Open.
mode(uint8_t) - OPC 10000-20 section 4.2.1 open-mode byte, as the Open Method takes it.sessionId(const NodeId &) - Session the handle is issued to, checked on every later call against it. Null for an internal caller, which forms its own handle space no Client can reach.
Returns: The new file handle, or an error if the backing file could not be opened.
void release()
Detaches RAII ownership of the created subtree so it persists beyond this handle's lifetime.
std::shared_ptr< State > shared_state() const
The shared state backing this file's installed handlers.
Returns: The shared state; outlives this accessor, because the installed handlers hold it.
FileHelper(File file, std::shared_ptr< State > state)
Implementation-only constructor used by the install flow once handlers are wired and the File handle is ready.
file(File) - The File handle wrapping the wired FileType node.state(std::shared_ptr< State >) - Shared state backing the installed method and property handlers.
ua::FileDirectoryHelper
class
Convenience class that backs a FileDirectoryType address-space node with a real filesystem directory.
The four FileDirectoryType methods are wired automatically against the backing directory path:
CreateFile creates a file on disk and a child FileType node backed by FileHelper. CreateDirectory creates a directory on disk and a child FileDirectoryType node backed recursively by FileDirectoryHelper. DeleteFileSystemObject deletes the file/directory on disk and removes the child node(s). MoveOrCopy currently returns BadNotSupported (cross-directory coordination is a planned follow-up).
Create-only: only objects created through the methods appear in the address space; pre-existing on-disk content is not reflected (a continuously-accurate view of an external directory belongs in a custom Namespace, not this helper). CreateFile with RequestFileOpen=true returns the new node with FileHandle 0 - clients open it via the File's Open method (auto-open-on-create is a follow-up).
The created subtree is owned by this handle through RAII: on destruction the instantiated node(s) are removed from the address space unless release has been called.
Static functions
FileDirectoryHelperResult try_create_sync(AddressSpace addressSpace, const NodeId &parent, const QualifiedName &browseName, std::filesystem::path dirPath, const InstantiationOptions &options, bool writable=true) noexcept
Creates a new FileDirectoryType instance under parent, backed by dirPath, and wires all method handlers.
addressSpace(AddressSpace) - Address space the new node is instantiated into.parent(const NodeId &) - Node the new FileDirectoryType instance is organized under.browseName(const QualifiedName &) - BrowseName of the new instance.dirPath(std::filesystem::path) - Filesystem directory backing the node; created if absent.options(const InstantiationOptions &) - Instantiation options for the new subtree.writable(bool) - Whether the directory and its created files accept writes.
Returns: The owning helper on success, or an ErrorDetail on failure. Never throws.
FileDirectoryHelper create_sync(AddressSpace addressSpace, const NodeId &parent, const QualifiedName &browseName, std::filesystem::path dirPath, const InstantiationOptions &options, bool writable=true)
Creates a new FileDirectoryType instance under parent, backed by dirPath, and wires all method handlers.
addressSpace(AddressSpace) - Address space the new node is instantiated into.parent(const NodeId &) - Node the new FileDirectoryType instance is organized under.browseName(const QualifiedName &) - BrowseName of the new instance.dirPath(std::filesystem::path) - Filesystem directory backing the node; created if absent.options(const InstantiationOptions &) - Instantiation options for the new subtree.writable(bool) - Whether the directory and its created files accept writes.
Returns: The owning helper.
FileDirectoryHelperResult try_attach_sync(AddressSpace addressSpace, const NodeId &existingInstance, std::filesystem::path dirPath, const InstantiationOptions &options, bool writable=true) noexcept
Wraps an existing FileDirectoryType node and wires all method handlers against dirPath.
addressSpace(AddressSpace) - Address space containing the node.existingInstance(const NodeId &) - FileDirectoryType node to wire method handlers onto.dirPath(std::filesystem::path) - Filesystem directory the wrapped node operates on.options(const InstantiationOptions &) - Instantiation options applied to children created via the methods.writable(bool) - Whether the directory and its created files accept writes.
Returns: The helper on success, or an ErrorDetail on failure. Never throws.
Functions
FileDirectoryHelper()=default
Constructs an empty handle that owns no node and wires no method handlers.
const NodeId & node_id() const
Returns the NodeId of the backed FileDirectoryType node.
Returns: The NodeId of the backed FileDirectoryType node.
const FileDirectory & directory() const
Returns the typed accessor for the backed FileDirectoryType node.
Returns: The typed FileDirectory accessor for the backed node.
void release()
Detaches RAII ownership of the created subtree so it persists beyond this handle's lifetime.
std::shared_ptr< State > shared_state() const
The shared state backing this directory's installed handlers.
Returns: The shared state; outlives this accessor, because the installed handlers hold it.
FileDirectoryHelper(FileDirectory directory, std::shared_ptr< State > state)
Constructs a helper bound to an already-instantiated directory and its shared state.
directory(FileDirectory) - Typed accessor for the backed FileDirectoryType node.state(std::shared_ptr< State >) - Shared state driving the installed method handlers.
ua::TemporaryFileTransferConfig
struct
Configuration and host hooks for a TemporaryFileTransferHelper.
Carries the on-disk location and instantiation limits for transient transfer files, plus two optional host callbacks (onCommit, onGenerateForRead) that decide what an uploaded file becomes and what bytes a read transfer serves. Both callbacks default to unset, which yields a scratch transfer (uploads discarded, reads served an empty file).
Public attributes
std::filesystem::path tempDir
Filesystem directory holding the transient transfer files.
NodeId transientFileParent
Node under which transient FileType nodes are created (browsable).
EncodingLimits limits
Encoding limits applied when instantiating transient File nodes.
std::function< VoidResult(const std::filesystem::path &uploadedFile, shared_ptr< const MethodCallContext >)> onCommit
Invoked on CloseAndCommit of a write transfer with the path of the uploaded temp file.
std::function< Result< std::filesystem::path >(const Variant &generateOptions, shared_ptr< const MethodCallContext >)> onGenerateForRead
Invoked on GenerateFileForRead to obtain the file the client will read.
ua::TemporaryFileTransferHelper
class
Convenience class backing a TemporaryFileTransferType node in the address space.
Implements the GenerateFileForWrite, GenerateFileForRead, and CloseAndCommit methods. Each transfer gets a transient FileType node backed by a FileHelper over a temp file in TemporaryFileTransferConfig::tempDir; CloseAndCommit invokes the host commit hook (for write transfers), then removes the transient node and temp file. Transfers complete synchronously, so the CompletionStateMachine output is left null (valid for synchronous completion).
This is a value handle that holds shared ownership of the created subtree. Copying shares the same backing state; destroying the last handle tears the subtree down unless release was called first.
Static functions
TemporaryFileTransferHelperResult try_create_sync(AddressSpace addressSpace, const NodeId &parent, const QualifiedName &browseName, const InstantiationOptions &options, TemporaryFileTransferConfig config) noexcept
Instantiates a TemporaryFileTransferType node under parent and backs it with this helper.
addressSpace(AddressSpace) - Address space the node is created in.parent(const NodeId &) - Node under which the transfer object is instantiated.browseName(const QualifiedName &) - Browse name of the new transfer object.options(const InstantiationOptions &) - Instantiation options for the created subtree.config(TemporaryFileTransferConfig) - Configuration and host hooks (see TemporaryFileTransferConfig).
Returns: The helper handle on success, or an ErrorDetail on failure. Never throws.
TemporaryFileTransferHelper create_sync(AddressSpace addressSpace, const NodeId &parent, const QualifiedName &browseName, const InstantiationOptions &options, TemporaryFileTransferConfig config)
Instantiates a TemporaryFileTransferType node under parent and backs it with this helper.
addressSpace(AddressSpace) - Address space the node is created in.parent(const NodeId &) - Node under which the transfer object is instantiated.browseName(const QualifiedName &) - Browse name of the new transfer object.options(const InstantiationOptions &) - Instantiation options for the created subtree.config(TemporaryFileTransferConfig) - Configuration and host hooks (see TemporaryFileTransferConfig).
Returns: The helper handle.
Functions
TemporaryFileTransferHelper()=default
Constructs an empty handle that backs no node.
const NodeId & node_id() const
Returns the node id of the instantiated transfer object.
Returns: The node id of the instantiated transfer object.
const TemporaryFileTransfer & transfer() const
Returns the underlying TemporaryFileTransfer wrapper for the instantiated node.
Returns: The TemporaryFileTransfer wrapper for the instantiated node.
void release()
Detaches RAII ownership of the created subtree so it persists beyond this handle's lifetime.
TemporaryFileTransferHelper(TemporaryFileTransfer transfer, std::shared_ptr< State > state)
Constructs a helper that wraps an already-instantiated transfer object and its backing state.
transfer(TemporaryFileTransfer) - Wrapper for the instantiated TemporaryFileTransferType node.state(std::shared_ptr< State >) - Shared backing state owning the transient transfer machinery.
ua::BaseObject
class
Handle to an Object node whose type definition is the base BaseObjectType (i=58).
Wraps an existing or freshly instantiated Object node together with the AddressSpace it lives in. When the handle owns the node subtree it created, destroying the handle without first calling release removes that subtree from the address space; an attached handle (see attach_async) owns nothing and only references the node.
Move-only: copying would duplicate ownership of the underlying subtree. This type serves both as a usable handle and as the base class for generated, strongly typed Object handles, which call create_object_impl_async to instantiate.
Member types
Result< CreateResultData > CreateResult
Result carrying the outcome of an Object instantiation.
std::function< void(CreateResult)> CreateImplCompleteCallback
Callback receiving the CreateResult of create_object_impl_async.
std::function< void(BaseObjectResult)> AttachCompleteCallback
Callback receiving the BaseObjectResult of attach_async.
Static functions
void attach_async(AddressSpace addressSpace, const NodeId &existingInstance, AttachCompleteCallback complete) noexcept
Attaches an existing Object node as a BaseObject handle.
addressSpace(AddressSpace) - Address space containing the node.existingInstance(const NodeId &) - NodeId of the Object node to attach.complete(AttachCompleteCallback) - Receives the outcome: on success the Result holds the BaseObject handle; on failure it carries an ErrorDetail. This overload never throws.
Functions
BaseObject()=default
Constructs an empty handle that references no node.
~BaseObject()=default
BaseObject(BaseObject &&) noexcept=default
Transfers ownership of the referenced node and any owned subtree from the moved-from handle, leaving it empty.
BaseObject & operator=(BaseObject &&) noexcept=default
Transfers ownership of the referenced node and any owned subtree from the moved-from handle, leaving it empty.
Returns: Reference to this handle after the move.
const NodeId & node_id() const
Returns the NodeId of the referenced Object node.
Returns: The NodeId of the referenced node; a null NodeId when the handle is empty.
void release()
Releases ownership of the node subtree this handle created.
ua::BaseVariable
class
Handle to a Variable node whose type definition is the base BaseVariableType (i=62).
Wraps an existing or freshly instantiated Variable node together with the AddressSpace it lives in, and exposes the variable's live value: reading and writing the value, and installing the read/write handlers that produce and consume it. A Variable's value is dynamic and possibly externally sourced - it is never a stored attribute, so it is always accessed through this handle's value API rather than via attribute read/write.
When the handle owns the node subtree it created, destroying the handle without first calling release removes that subtree from the address space; a handle that references a pre-existing node owns nothing and only references it.
Move-only: copying would duplicate ownership of the underlying subtree. This type serves both as a usable handle and as the base class for generated, strongly typed Variable handles, which call create_variable_impl_async to instantiate.
Member types
std::function< void(DataValueResult)> ReadValueCompleteCallback
Callback receiving the DataValueResult of read_value_async.
std::function< void(VoidResult)> WriteValueCompleteCallback
Callback receiving the VoidResult of write_value_async.
Result< CreateResultData > CreateResult
Result carrying the outcome of a Variable instantiation.
std::function< void(CreateResult)> CreateImplCompleteCallback
Callback receiving the CreateResult of create_variable_impl_async.
Functions
BaseVariable()=default
Constructs an empty handle that references no node.
~BaseVariable()=default
BaseVariable(BaseVariable &&) noexcept=default
Transfers ownership of the referenced node and any owned subtree from the moved-from handle, leaving it empty.
BaseVariable & operator=(BaseVariable &&) noexcept=default
Transfers ownership of the referenced node and any owned subtree from the moved-from handle, leaving it empty.
Returns: Reference to this handle after the move.
const NodeId & node_id() const
Returns the NodeId of the referenced Variable node.
Returns: The NodeId of the referenced node; a null NodeId when the handle is empty.
void release()
Releases ownership of the node subtree this handle created.
void read_value_async(ReadValueCompleteCallback complete) const noexcept
Reads the variable's live value asynchronously.
complete(ReadValueCompleteCallback) - Receives the outcome: on success the Result holds the DataValue; on failure it carries an ErrorDetail. A null callback is ignored and the read is not performed. This overload never throws.
DataValueResult try_read_value_sync() const noexcept
Reads the variable's live value, blocking until complete.
Returns: The DataValue, or an ErrorDetail on failure. Never throws.
DataValue read_value_sync() const
Reads the variable's live value, blocking until complete.
Returns: The DataValue.
void write_value_async(DataValue value, WriteValueCompleteCallback complete) const noexcept
Writes the variable's live value asynchronously.
value(DataValue) - The DataValue to write (value, status, timestamps).complete(WriteValueCompleteCallback) - Receives the outcome: on success an empty Result; on failure it carries an ErrorDetail. A null callback is ignored and the write is not performed. This overload never throws.
VoidResult try_write_value_sync(DataValue value) const noexcept
Writes the variable's live value, blocking until complete.
value(DataValue) - The DataValue to write.
Returns: An empty Result on success, or an ErrorDetail on failure. Never throws.
void write_value_sync(DataValue value) const
Writes the variable's live value, blocking until complete.
value(DataValue) - The DataValue to write.
void set_read_handler_async(ExternalValueSource::ReadValueHandler handler, std::function< void(VoidResult)> done) const noexcept
Installs the read handler that produces the variable's value asynchronously.
handler(ExternalValueSource::ReadValueHandler) - The read handler to install (see ExternalValueSource).done(std::function< void(VoidResult)>) - Receives the outcome: on success an empty Result; on failure it carries an ErrorDetail (e.g. the node does not support handler registration). A null callback is ignored and the handler is not installed. This overload never throws.
VoidResult try_set_read_handler_sync(ExternalValueSource::ReadValueHandler handler) const noexcept
Installs the read handler that produces the variable's value, blocking until complete.
handler(ExternalValueSource::ReadValueHandler) - The read handler to install (see ExternalValueSource).
Returns: An empty Result on success, or an ErrorDetail on failure. Never throws.
void set_read_handler_sync(ExternalValueSource::ReadValueHandler handler) const
Installs the read handler that produces the variable's value, blocking until complete.
handler(ExternalValueSource::ReadValueHandler) - The read handler to install (see ExternalValueSource).
void set_write_handler_async(ExternalValueSource::WriteValueHandler handler, std::function< void(VoidResult)> done) const noexcept
Installs the write handler that consumes the variable's value asynchronously.
handler(ExternalValueSource::WriteValueHandler) - The write handler to install (see ExternalValueSource).done(std::function< void(VoidResult)>) - Receives the outcome: on success an empty Result; on failure it carries an ErrorDetail (e.g. the node does not support handler registration). A null callback is ignored and the handler is not installed. This overload never throws.
VoidResult try_set_write_handler_sync(ExternalValueSource::WriteValueHandler handler) const noexcept
Installs the write handler that consumes the variable's value, blocking until complete.
handler(ExternalValueSource::WriteValueHandler) - The write handler to install (see ExternalValueSource).
Returns: An empty Result on success, or an ErrorDetail on failure. Never throws.
void set_write_handler_sync(ExternalValueSource::WriteValueHandler handler) const
Installs the write handler that consumes the variable's value, blocking until complete.
handler(ExternalValueSource::WriteValueHandler) - The write handler to install (see ExternalValueSource).
ua::ChildFilterInfo
struct
Describes a non-mandatory child declaration offered to the optional-child filter.
One instance is passed to an OptionalChildFilter for each candidate child so the filter can decide whether to instantiate it.
Public attributes
QualifiedName mBrowseName
Browse name of the candidate child.
NodeClass mNodeClass
Node class of the candidate child.
NodeId mTypeDefinition
Type definition of the child; empty if it has no HasTypeDefinition reference.
ua::InstantiationOptions
struct
Tunable options controlling a single type-instantiation operation.
All fields are optional; a default-constructed instance instantiates only mandatory children using the SDK's default string-based NodeId allocation.
Public attributes
ua::EncodingLimits mLimits
Recursion/size limits bounding the instantiation work.
std::optional< NodeId > mParentReferenceType
Reference type linking the parent to the new instance; unset uses the SDK default.
NodeIdAllocator mNodeIdAllocator
Custom allocator for node IDs.
OptionalChildFilter mOptionalChildFilter
Filter deciding which non-mandatory children to instantiate.
std::optional< uint16_t > mTargetNamespaceIndex
Namespace index override for the entire instantiated subtree.
bool mInstantiateNestedTypeOptionals
Also instantiate OPTIONAL children declared on a child's TYPE DEFINITION but not redeclared on its instance declaration (e.g.
ua::VariableInstantiationAttributes
struct
Attribute overrides applied to a Variable node as it is instantiated.
Passed to InstantiationService::instantiate_variable_async to set instance-specific Variable attributes that differ from the VariableType definition. Each field is optional: an absent (std::nullopt) field leaves the attribute at the value inherited from the type definition, while a present field overrides it on the new instance.
Public attributes
std::optional< NodeId > mDataType
DataType of the instance's Value, or std::nullopt to inherit from the type.
std::optional< int32_t > mValueRank
ValueRank of the instance, or std::nullopt to inherit from the type.
std::optional< AccessLevelType > mAccessLevel
AccessLevel bitmask of the instance, or std::nullopt to leave the node's default.
ua::InstantiationService
class
Instantiates type-defined nodes (objects, variables, and optional members) into an address space.
Walks an ObjectType or VariableType definition and materialises its mandatory children (and any selected optional members) under a parent node, allocating NodeIds, attaching HasTypeDefinition and parent edges, and copying attributes recursively. Every operation posts to the owning AddressSpace strand and completes asynchronously on an unspecified worker thread.
The service holds the AddressSpace by value; the caller need not keep its own copy alive for the duration of a call.
Member types
std::function< void(NodeSubtreeResult)> InstantiateCompleteCallback
Completion callback for an instantiation that creates a node subtree.
Functions
InstantiationService(AddressSpace addressSpace)
Constructs a service that instantiates into the given address space.
addressSpace(AddressSpace) - Address space the service materialises nodes into; held by value for the lifetime of the service.
void instantiate_object_async(const NodeId &parent, const QualifiedName &browseName, const NodeId &typeDefinition, const InstantiationOptions &options, InstantiateCompleteCallback complete) const noexcept
Instantiates an object of typeDefinition as a child of parent.
parent(const NodeId &) - Node the new object is attached to as a child.browseName(const QualifiedName &) - Browse name of the new object node.typeDefinition(const NodeId &) - ObjectType whose definition is instantiated.options(const InstantiationOptions &) - Allocation and filtering policy; see InstantiationOptions.complete(InstantiateCompleteCallback) - Receives the outcome: on success a NodeSubtree rooted at the new object, on failure an ErrorDetail. This overload never throws.
void instantiate_variable_async(const NodeId &parent, const QualifiedName &browseName, const NodeId &typeDefinition, const InstantiationOptions &options, const VariableInstantiationAttributes &attributes, InstantiateCompleteCallback complete) const noexcept
Instantiates a variable of typeDefinition as a child of parent.
parent(const NodeId &) - Node the new variable is attached to as a child.browseName(const QualifiedName &) - Browse name of the new variable node.typeDefinition(const NodeId &) - VariableType whose definition is instantiated.options(const InstantiationOptions &) - Allocation and filtering policy; see InstantiationOptions.attributes(const VariableInstantiationAttributes &) - Variable-specific attributes applied to the created node.complete(InstantiateCompleteCallback) - Receives the outcome: on success a NodeSubtree rooted at the new variable, on failure an ErrorDetail. This overload never throws.
void instantiate_optional_members_async(const NodeId &instance, const NodeId &typeDefinition, const InstantiationOptions &options, OptionalChildFilter optionalFilter, std::function< void(VoidResult)> complete) const noexcept
Materialises the optional members of typeDefinition onto an existing instance.
instance(const NodeId &) - Existing node the selected members are added to.typeDefinition(const NodeId &) - Type whose optional members are considered.options(const InstantiationOptions &) - Allocation policy; see InstantiationOptions.optionalFilter(OptionalChildFilter) - Predicate selecting which non-mandatory members to materialise; see OptionalChildFilter.complete(std::function< void(VoidResult)>) - Receives the outcome: a success VoidResult, or an ErrorDetail on failure. This overload never throws.
ua::NodeSubtree
class
An owning, move-only handle to the nodes produced by a single instantiation.
Returned by the instantiation engine, it records the subtree's root. On destruction the handle fires a fire-and-forget async delete of exactly the nodes it created (reverse creation order, one single-node AddressSpace::delete_node_async each - not a reference-walked cascade) - never a blocking/synchronous call - giving instantiated subtrees RAII lifetime tied to this object. Call release() to keep the nodes alive past the handle's lifetime, or remove_async() to delete them eagerly.
The handle is move-only: moving transfers ownership and leaves the source released, so only one handle ever owns a given subtree.
Functions
NodeSubtree()=default
Constructs an empty handle that owns no nodes.
NodeSubtree(AddressSpace addressSpace, NodeId rootId, std::vector< NodeId > createdNodes)
Constructs a handle owning a freshly instantiated subtree.
addressSpace(AddressSpace) - Address space the nodes live in and are deleted from on cleanup; copied and retained by the handle.rootId(NodeId) - Node id of the subtree's root.createdNodes(std::vector< NodeId >) - Ids of every node created for the subtree, in creation order; cleanup deletes them in reverse.
NodeSubtree(NodeSubtree &&other) noexcept
Move-constructs, transferring ownership and leaving other released.
other(NodeSubtree &&) - Handle whose owned subtree is transferred; left released.
NodeSubtree & operator=(NodeSubtree &&other) noexcept
Move-assigns, removing this handle's current subtree before taking other's.
other(NodeSubtree &&) - Handle whose owned subtree is adopted; left released.
Returns: Reference to this handle.
~NodeSubtree()
Deletes the owned nodes unless the handle was released or already removed.
const NodeId & root() const
Returns the node id of the subtree's root.
Returns: The NodeId identifying the subtree's root node.
void release()
Abandons ownership so the nodes are not deleted on destruction.
void remove_async()
Asynchronously deletes the owned subtree and releases the handle.
void add_created_node(NodeId id)
Records a node as part of the owned subtree so cleanup will delete it.
id(NodeId) - Node id to track for cleanup.
ua::ReferenceView
class
Immutable, XML-free view of a single reference, passed to reference_filter.
Functions
ReferenceView(NodeId referenceTypeId, NodeId targetId, bool isForward)
Constructs a view over one reference.
referenceTypeId(NodeId) - File-local NodeId of the reference type.targetId(NodeId) - File-local NodeId of the referenced (target) node.isForward(bool) - True for a forward reference, false for an inverse one.
const NodeId & reference_type_id() const
File-local NodeId of the reference type.
Returns: The file-local NodeId of the reference type.
const NodeId & target_id() const
File-local NodeId of the referenced (target) node.
Returns: The file-local NodeId of the referenced (target) node.
bool is_forward() const
True if the reference points forward, false if it is inverse.
Returns: True if the reference points forward, false if it is inverse.
ua::NodeView
class
Immutable, XML-free view of a single node.
Backed by the (private) parse-tree node via a non-owning typed pointer; the accessors below are the only surface customers see. Ids and names are in the file's own (document-local) namespace, matching what a node_filter decides about before any server-side translation. The richer accessors (references, as_data_type, as_variable) require a parsed NodeSetDocument context; in a bare node_filter they return empty.
Functions
Constructs a view over a parse-tree node, with an optional document context.
node(const ua::xml::nodeset::Node *) - Non-owning pointer to the private parse-tree node.document(const NodeSetDocumentImpl *) - Non-owning pointer to the owning document context, or nullptr when the view is supplied to a bare node_filter (richer accessors then return empty).
NodeId node_id() const
File-local NodeId of this node.
Returns: This node's file-local NodeId.
QualifiedName browse_name() const
File-local browse name of this node.
Returns: This node's file-local browse name.
NodeClass node_class() const
NodeClass of this node.
Returns: This node's NodeClass.
optional< String > category() const
The node's Category annotation, or empty if absent.
Returns: The node's Category annotation, or empty if the node has none.
optional< NodeReleaseStatus > release_status() const
The node's <ReleaseStatus> annotation, or empty if unspecified.
Returns: The node's release status, or empty if the annotation is unspecified.
optional< XmlElement > extensions() const
The node's raw <Extensions> block, or empty if absent.
Returns: The node's raw <Extensions> block, or empty if absent.
std::vector< ReferenceView > references() const
This node's outgoing references, with file-local ids.
Returns: This node's outgoing references, with file-local ids.
optional< DataTypeView > as_data_type() const
DataType-specific detail, or empty if this node is not a DataType.
Returns: DataType-specific detail, or empty if this node is not a DataType or carries no document context.
optional< VariableView > as_variable() const
Variable-specific detail, or empty if this node is not a Variable.
Returns: Variable-specific detail, or empty if this node is not a Variable or carries no document context.
ua::DataTypeFieldView
struct
One field of an (aggregated) DataType structure/enum definition.
Public attributes
String name
Field name.
NodeId dataType
File-local NodeId of the field's DataType.
int32_t valueRank
Value rank: -1 for a scalar, >= 0 for an array of that dimension.
bool isOptional
True if the field is optional in the structure.
ua::DataTypeView
class
DataType-specific view: abstractness, structure/enum kind, and the aggregated field list.
The field list includes base-type fields, resolved across the parsed document.
Functions
DataTypeView(const ua::xml::nodeset::Node *node, const NodeSetDocumentImpl *document)
Constructs a DataType view over a parse-tree node and its document context.
node(const ua::xml::nodeset::Node *) - Non-owning pointer to the private parse-tree node.document(const NodeSetDocumentImpl *) - Non-owning pointer to the owning document context.
bool is_abstract() const
True if the DataType is abstract.
Returns: True if the DataType is abstract.
bool is_structure() const
True if the DataType is a structure.
Returns: True if the DataType is a structure.
bool is_enumeration() const
True if the DataType is an enumeration.
Returns: True if the DataType is an enumeration.
std::vector< DataTypeFieldView > fields() const
The aggregated field list, including inherited base-type fields.
Returns: The aggregated field list, including inherited base-type fields.
ua::VariableView
class
Variable-specific view: the variable's DataType and value rank.
Functions
VariableView(const ua::xml::nodeset::Node *node)
Constructs a Variable view over a parse-tree node.
node(const ua::xml::nodeset::Node *) - Non-owning pointer to the private parse-tree node.
NodeId data_type() const
File-local NodeId of the variable's DataType.
Returns: The file-local NodeId of the variable's DataType.
int32_t value_rank() const
Value rank: -1 for a scalar, >= 0 for an array of that dimension.
Returns: The variable's value rank: -1 for a scalar, >= 0 for an array of that dimension.
ua::NamespaceMapping
struct
One server namespace slot allocated (or resolved) for a URI the file declared.
Public attributes
String uri
Declared namespace URI.
uint16_t serverIndex
File-local namespace index for the URI.
ua::ModelRef
struct
A reference to a dependent model declared via <RequiredModel>.
Public attributes
String uri
Model namespace URI.
String version
Required model version string.
ua::NodeSetParseOptions
struct
Options controlling how a NodeSet stream is parsed into a NodeSetDocument.
Public attributes
Resolves <RequiredModel> dependencies to their NodeSet streams.
StructureResolver structureResolver
Resolves custom ExtensionObject value types.
bool decodeValues
When false, Variant values are not decoded (type-graph-only inspection). Defaults to true.
ua::NodeSetDocument
class
Immutable, owned read model of a parsed NodeSet (and its resolved dependencies).
Produced by try_parse_nodeset_sync; move-only and not copyable. The document exposes no import method - importing it into an AddressSpace is a separate free-function concern (see ua_nodeset_import.h).
try_parse_nodeset_sync
Functions
NodeSetDocument(std::unique_ptr< NodeSetDocumentImpl > impl)
Constructs a document from its private implementation.
impl(std::unique_ptr< NodeSetDocumentImpl >) - Owned implementation backing the read model.
NodeSetDocument(NodeSetDocument &&) noexcept
Move-constructs, transferring ownership of the read model.
NodeSetDocument & operator=(NodeSetDocument &&) noexcept
Move-assigns, transferring ownership of the read model.
Returns: Reference to this document.
std::span< const NamespaceMapping > declared_namespaces() const
Namespaces the file declares, in file-local order.
Returns: The namespaces the file declares, in file-local order.
std::span< const ModelRef > required_models() const
The <RequiredModel> dependencies declared by the file.
Returns: The <RequiredModel> dependencies declared by the file.
std::vector< NodeView > nodes() const
All parsed nodes, as file-local views.
Returns: All parsed nodes, as file-local views.
Finds a parsed node by its file-local NodeId.
nodeId(const NodeId &) - File-local NodeId to look up.
Returns: The matching node view, or empty if no node has that id.
optional< XmlElement > extensions() const
The NodeSet-level <Extensions> block describing the primary nodeset, or empty if absent.
Returns: The NodeSet-level <Extensions> block, or empty if absent.
DateTime last_modified() const
The primary nodeset's LastModified timestamp.
Returns: The timestamp, or a default-constructed (epoch) DateTime when the attribute is absent.
ua::NodeSetExportSummary
struct
Outcome counts of a completed NodeSet export.
Public attributes
std::vector< NamespaceMapping > namespacesWritten
The non-NS0 namespaces written to the document, in file order.
std::size_t nodesExported
Count of nodes the NodeSetExportOptions::nodeFilter accepted.
std::size_t referencesExported
Count of references written across all exported nodes.
ua::NodeSetModelRef
struct
A <RequiredModel> dependency declared by an exported <Model>.
Public attributes
String uri
Required model namespace URI.
String version
Required model version string.
DateTime publicationDate
Required model publication date.
ua::NodeSetExportModel
struct
One <Model> entry written to the document's <Models> header.
Public attributes
String uri
Model namespace URI.
String version
Model version string.
DateTime publicationDate
Model publication date.
std::vector< NodeSetModelRef > requiredModels
Declared <RequiredModel> dependencies.
ua::ExportNodeView
struct
Immutable, lightweight view of a node passed to NodeSetExportOptions::nodeFilter.
Unlike the import-side NodeView (backed by a parse tree), this carries the live node's identity and browse name directly - the attributes a filter needs to decide whether to export the node.
Public attributes
NodeId nodeId
The node's NodeId (server namespace index).
NodeClass nodeClass
The node's NodeClass.
QualifiedName browseName
The node's browse name (server namespace index).
ua::NodeSetExportOptions
struct
Controls which namespaces, nodes, and references are exported, and how the document is framed.
All members default to a permissive configuration: empty filters include everything, the scope is Scope::Full, aliases are emitted, and an unencodable value fails the export.
Member types
Scope (enum)
Subset of the address space to export.
Full- Export all nodes and references the filters accept.TypeDefinitionsOnly- Export only type-definition nodes (Object/Variable/Data/Reference types).
OnUnencodableStructure (enum)
Disposition for a value that cannot be transcoded to XML (an unresolved opaque binary-bodied ExtensionObject).
Fail- Abort the export with a clean Result error (default).OmitValue- Omit the offending <Value> but keep the rest of the node and the document.
Public attributes
std::vector< uint16_t > namespaces
Server namespace indices to export.
std::function< bool(const ExportNodeView &)> nodeFilter
Predicate selecting which nodes are exported; an empty function includes all.
std::function< bool(const ReferenceView &)> referenceFilter
Predicate selecting which references are exported; an empty function includes all.
enum ua::NodeSetExportOptions::Scope scope
Defaults to Scope::Full.
std::vector< NodeSetExportModel > models
<Models> header entries, each with its <RequiredModel> dependencies.
optional< DateTime > lastModified
Optional LastModified timestamp, written as an attribute on <UANodeSet> when set.
bool emitAliases
Whether to emit an <Aliases> table giving symbolic names to the reference/data types used.
StructureResolver structureResolver
Reifies an opaque binary-bodied ExtensionObject value to a typed Structure so it can be transcoded to XML.
enum ua::NodeSetExportOptions::OnUnencodableStructure onUnencodableStructure
Defaults to OnUnencodableStructure::Fail.
ua::NodeSetImportSummary
struct
Outcome counts of a completed NodeSet import.
Public attributes
std::vector< NamespaceMapping > namespacesAllocated
URIs the file declared that were resolved to, or newly allocated in, the server namespace table during this import.
std::size_t nodesImported
Count of nodes the NodeSetImportOptions::nodeFilter accepted.
std::size_t referencesImported
Count of references the NodeSetImportOptions::referenceFilter accepted.
ua::NodeSetImportOptions
struct
Controls how a NodeSet is filtered, scoped, and resolved during import.
All members default to a permissive, side-effect-free configuration: empty filters include everything, the scope is Scope::Full, and unset resolvers disable their respective behaviour (surfacing the corresponding gap as a clean Result error rather than a crash).
Member types
Scope (enum)
Subset of the NodeSet to import.
Full- Import all nodes and references the filters accept.TypeDefinitionsOnly- Import only type-definition nodes (types, not instances).
OnUnknownStructure (enum)
Disposition for a value containing an ExtensionObject whose type cannot be resolved.
Fail- Abort the import with a clean Result error (default).ImportOpaque- Store the value as a preserved opaque ExtensionObject.
Public attributes
std::function< bool(const NodeView &)> nodeFilter
Predicate selecting which nodes are imported; an empty function includes all.
std::function< bool(const ReferenceView &)> referenceFilter
Predicate selecting which references are imported; an empty function includes all.
enum ua::NodeSetImportOptions::Scope scope
Defaults to Scope::Full.
NamespaceFactory namespaceFactory
Allocates server namespace slots for URIs the file declares but the server lacks.
Resolves a <RequiredModel> dependency to the NodeSet stream that satisfies it.
StructureResolver structureResolver
Resolves the custom ExtensionObject value types (named by <TypeId>) encountered during decode; empty disables custom types.
enum ua::NodeSetImportOptions::OnUnknownStructure onUnknownStructure
Defaults to OnUnknownStructure::Fail.
ua::AddressSpace
class
The server's node/reference graph and the entry point for node access.
An AddressSpace owns a set of Namespace instances (indexed by the NamespaceArray) and routes node operations to the namespace that owns the target NodeId. It is a cheap-to-copy value handle (Pimpl) over a shared implementation: copies share the same underlying graph, and the graph stays alive while any copy (or a locked WeakAddressSpace) exists.
Each namespace serializes its own mutable state on a private strand; the *_async methods post work there and complete on an unspecified worker thread, while the sync / try_sync variants block the calling thread until that work completes.
Member types
std::function< void(Result< uint16_t >)> AddNamespaceCallback
Callback receiving the permanent index assigned by asynchronous namespace registration.
std::function< void(VoidResult)> DeleteNodeCompleteCallback
Callback receiving the outcome of an asynchronous node deletion.
Static functions
AddressSpace create(String applicationUri, boost::asio::any_io_executor executor)
Creates an AddressSpace with namespace 0 (and the application namespace) initialised.
applicationUri(String) - Application URI seeded into namespace 1 and the ServerArray.executor(boost::asio::any_io_executor) - Executor on which namespace strands and async completions run.
Returns: A handle to the newly created address space.
Functions
const ExecutionLimits & limits() const
Returns the per-operation execution budgets applied while a single operation runs.
Returns: The current execution budgets.
void set_limits(ExecutionLimits limits)
Sets the per-operation execution budgets applied while a single operation runs.
limits(ExecutionLimits) - New budgets to apply to subsequent operations. Every field must be greater than zero. See limits for what these do and do not bound.
boost::asio::any_io_executor executor() const
Returns the executor on which this address space's async work runs.
Returns: The bound I/O executor.
ua::Logger logger() const
Returns the logger for async work done on this address space's behalf.
Returns: The bound logger, or a no-op logger if none was seeded.
uint64_t model_generation() const noexcept
Returns the monotonic generation of committed node/reference model mutations.
Returns: The number of model mutations committed so far, or 0 when this address space has no reference-mutation coordinator to count them. The value never decreases, and it SATURATES at UINT64_MAX rather than wrapping - so a cache comparing a stored generation against this one can never be fooled into reusing a stale entry by wrap-around, at the cost of ceasing to invalidate once saturated.
void set_logger(ua::Logger logger)
Seeds the logger returned by logger().
logger(ua::Logger) - The logger to bind (a value handle; copied).
shared_ptr< Namespace > create_namespace(string_view uri)
Creates a new in-memory namespace for uri.
uri(string_view) - Namespace URI. If a namespace with this URI already exists, the caller should obtain that instance from namespace_array instead.
Returns: Shared ownership of the namespace; never null.
shared_ptr< Namespace > create_namespace(string_view uri, std::vector< RolePermissionType > rolePermissions, std::optional< AccessRestrictionType > accessRestrictions=std::nullopt)
Creates a new in-memory namespace with declarative access-control defaults.
uri(string_view) - Namespace URI.rolePermissions(std::vector< RolePermissionType >) - Engaged Role-model default. An empty vector grants nothing.accessRestrictions(std::optional< AccessRestrictionType >) - Optional channel restriction inherited by undecorated nodes.
Returns: Shared ownership of the configured namespace; never null.
void add_namespace_async(shared_ptr< Namespace > namespaceToAdd, AddNamespaceCallback callback) noexcept
Registers namespaceToAdd through the address-space lifecycle coordinator.
namespaceToAdd(shared_ptr< Namespace >) - Candidate namespace. Must be non-null, have a non-empty unique URI and fit in the remaining UInt16 namespace-index space.callback(AddNamespaceCallback) - Receives the permanent dense index, or a rich validation, preparation or shutdown failure.
Registers a namespace and blocks the external caller until the canonical async flow completes.
namespaceToAdd(shared_ptr< Namespace >) - The namespace to register.
Returns: The permanent index, or the async operation's exact StatusCode and ErrorDetail. Never throws.
uint16_t add_namespace_sync(shared_ptr< Namespace > namespaceToAdd)
Registers a namespace and blocks the external caller until the canonical async flow completes.
namespaceToAdd(shared_ptr< Namespace >) - The namespace to register.
Returns: The permanent dense index.
Looks up the node identified by nodeId, completing asynchronously.
nodeId(const NodeId &) - Node to look up.callback(Namespace::FindNodeCompleteCallback) - Receives the outcome: on success the Result holds a NodeAccessor for the node; on failure it carries an ErrorDetail (e.g. BadNodeIdUnknown when the namespace index is unknown). This overload never throws.
Resolves a batch of nodes, grouping by owning namespace, completing asynchronously.
nodeIds(std::span< const NodeId >) - Nodes to resolve, viewed but not owned by the callee. The span need only stay valid for the synchronous portion of the call.callback(Namespace::FindNodesCompleteCallback) - Receives a BatchResult with one NodeAccessorResult per input id, in request order (good with an accessor, or a bad StatusCode carrying any ErrorDetail - e.g. BadNodeIdUnknown for an unknown namespace index). The batch status is good whenever per-item results were produced. Never throws.
void enumerate_nodes_async(uint16_t namespaceIndex, Namespace::EnumerateNodesCallback callback) noexcept
Enumerates the NodeIds of every node owned by the namespace at namespaceIndex.
namespaceIndex(uint16_t) - Index of the namespace whose nodes are enumerated.callback(Namespace::EnumerateNodesCallback) - Receives a Result holding the owned NodeIds on success, or a bad StatusCode carrying any ErrorDetail (BadNodeIdUnknown for an unknown index; BadNotSupported if the namespace cannot enumerate). This overload never throws.
NodeAccessorResult try_find_node_sync(const NodeId &nodeId) noexcept
Looks up the node identified by nodeId, blocking until complete.
nodeId(const NodeId &) - Node to look up.
Returns: A NodeAccessor on success, or an ErrorDetail on failure. Never throws.
NodeAccessor find_node_sync(const NodeId &nodeId)
Looks up the node identified by nodeId, blocking until complete.
nodeId(const NodeId &) - Node to look up.
Returns: A NodeAccessor for the node.
Looks up nodeId and downcasts the accessor to T, blocking until complete.
nodeId(const NodeId &) - Node to look up.
Returns: The node accessor as T, an ErrorDetail with BadNodeClassInvalid if the node is not a T, or the lookup's own failure detail. Never throws.
T find_sync(const NodeId &nodeId)
Looks up nodeId and downcasts the accessor to T, blocking until complete.
nodeId(const NodeId &) - Node to look up.
Returns: The node accessor as T.
Looks up nodeId and downcasts the accessor to T, completing asynchronously.
nodeId(const NodeId &) - Node to look up.callback(std::function< void(Result< T >)>) - Receives the outcome: the accessor as T on success, an ErrorDetail with BadNodeClassInvalid if the node is not a T, or the lookup's own failure detail. This overload never throws.
Creates a node of nodeClass at nodeId, completing asynchronously.
nodeId(const NodeId &) - Identifier for the new node; its namespace index selects the owner.nodeClass(NodeClass) - Node class to create (Object, Variable, Method, ...).initialAttributes(InitialAttributes) - Standard attributes to apply atomically at creation (seam refactor 5.2); may be empty for a bare node.callback(Namespace::CreateNodeCompleteCallback) - Receives the outcome: on success a NodeAccessor for the new node; on failure an ErrorDetail (e.g. BadNodeIdUnknown for an unknown namespace). This overload never throws.
Creates a bare node of nodeClass at nodeId, completing asynchronously.
nodeId(const NodeId &) - Identifier for the new node; its namespace index selects the owner.nodeClass(NodeClass) - Node class to create (Object, Variable, Method, ...).callback(Namespace::CreateNodeCompleteCallback) - Receives the outcome, exactly as the initial-attribute overload. Never throws.
Creates a node of nodeClass at nodeId, blocking until complete.
nodeId(const NodeId &) - Identifier for the new node.nodeClass(NodeClass) - Node class to create.initialAttributes(InitialAttributes) - Standard attributes to apply atomically at creation; may be empty.
Returns: A NodeAccessor for the new node, or an ErrorDetail on failure. Never throws.
NodeAccessor create_node_sync(const NodeId &nodeId, NodeClass nodeClass, InitialAttributes initialAttributes={})
Creates a node of nodeClass at nodeId, blocking until complete.
nodeId(const NodeId &) - Identifier for the new node.nodeClass(NodeClass) - Node class to create.initialAttributes(InitialAttributes) - Standard attributes to apply atomically at creation; defaults to none.
Returns: A NodeAccessor for the new node.
Creates a node and downcasts the accessor to T, blocking until complete.
nodeId(const NodeId &) - Identifier for the new node.nodeClass(NodeClass) - Node class to create.initialAttributes(InitialAttributes) - Standard attributes to apply atomically at creation; defaults to none.
Returns: The new node's accessor as T, an ErrorDetail with BadNodeClassInvalid if it is not a T, or the creation's own failure detail. Never throws.
Creates a node and downcasts the accessor to T, blocking until complete.
nodeId(const NodeId &) - Identifier for the new node.nodeClass(NodeClass) - Node class to create.initialAttributes(InitialAttributes) - Standard attributes to apply atomically at creation; defaults to none.
Returns: The new node's accessor as T.
Creates a node and downcasts the accessor to T, completing asynchronously.
nodeId(const NodeId &) - Identifier for the new node.nodeClass(NodeClass) - Node class to create.initialAttributes(InitialAttributes) - Standard attributes to apply atomically at creation; may be empty.callback(std::function< void(Result< T >)>) - Receives the outcome: the new node's accessor as T on success, an ErrorDetail with BadNodeClassInvalid if it is not a T, or the creation's own failure detail. This overload never throws.
Creates a bare node and downcasts the accessor to T, completing asynchronously.
nodeId(const NodeId &) - Identifier for the new node.nodeClass(NodeClass) - Node class to create.callback(std::function< void(Result< T >)>) - Receives the outcome, exactly as the initial-attribute overload. Never throws.
void delete_node_async(const NodeId &nodeId, bool deleteForwardHierarchicallyReferencedNodes, DeleteNodeCompleteCallback callback) noexcept
Deletes the node identified by nodeId, completing asynchronously.
nodeId(const NodeId &) - Node to delete.deleteForwardHierarchicallyReferencedNodes(bool) - If true, recursively delete the whole subtree: nodeId and every node reachable from it via forward hierarchical references (any subtype of HierarchicalReferences, in any namespace). Descendants are deleted before their parents; cycles and shared nodes are deleted once. If false, only nodeId is deleted (the spec-aligned single-node DeleteNodes).callback(DeleteNodeCompleteCallback) - Receives the outcome: success, or an ErrorDetail on failure (e.g. BadNodeIdUnknown). This overload never throws.
VoidResult try_delete_node_sync(const NodeId &nodeId, bool deleteForwardHierarchicallyReferencedNodes) noexcept
Deletes the node identified by nodeId, blocking until complete.
nodeId(const NodeId &) - Node to delete.deleteForwardHierarchicallyReferencedNodes(bool) - If true, recursively delete the whole forward-hierarchical subtree (see delete_node_async); if false, only nodeId.
Returns: Success, or an ErrorDetail on failure. Never throws.
void delete_node_sync(const NodeId &nodeId, bool deleteForwardHierarchicallyReferencedNodes)
Deletes the node identified by nodeId, blocking until complete.
nodeId(const NodeId &) - Node to delete.deleteForwardHierarchicallyReferencedNodes(bool) - If true, recursively delete the whole forward-hierarchical subtree (see delete_node_async); if false, only nodeId.
void shutdown_async(std::function< void(VoidResult)> callback) noexcept
Stops the background work every registered namespace is running.
callback(std::function< void(VoidResult)>) - Invoked exactly once when every namespace has stopped. Runs on an unspecified worker thread. Never throws.
const NamespaceArray & namespace_array() const
Returns the array mapping namespace indices to namespace URIs.
Returns: Read-only reference to the committed namespace array.
ServerArray & server_array()
Returns the array of server URIs known to this address space.
Returns: Mutable reference to the server array.
const ServerArray & server_array() const
Returns the array of server URIs known to this address space.
Returns: Read-only reference to the server array.
WeakAddressSpace weak() const
Returns a non-owning weak handle to this address space.
Returns: A WeakAddressSpace that does not keep the graph alive and must be lock()-ed before use.
ua::WeakAddressSpace
class
A non-owning weak handle to an AddressSpace.
Holds a weak reference to the shared graph; lock() yields an owning AddressSpace if the graph is still alive. Use this to break ownership cycles and to safely reference an address space from async work.
Functions
WeakAddressSpace()=default
Constructs an empty handle that locks to nullopt.
WeakAddressSpace(const AddressSpace &addressSpace)
Constructs a weak handle referencing addressSpace.
addressSpace(const AddressSpace &) - Address space to observe; not kept alive by this handle.
optional< AddressSpace > lock() const
Attempts to obtain an owning handle to the referenced address space.
Returns: The AddressSpace if it is still alive, otherwise nullopt.
ua::dynamic_types::AddressSpaceModelAccess
class
TypeModelAccess implementation that reads and browses a local AddressSpace.
Server-side adapter that satisfies the TypeModelAccess Read/Browse contract by querying the in-memory address space directly, bypassing the service layer (no authentication, session, or diagnostics). Use SessionModelAccess for the client-side variant that issues service calls over a session.
The referenced AddressSpace is held by reference and must outlive this adapter and every outstanding callback. As with the base interface, this type is not safe for concurrent use from multiple threads against the same instance.
TypeModelAccess
Functions
AddressSpaceModelAccess(ua::AddressSpace &addressSpace)
Constructs an adapter over addressSpace.
addressSpace(ua::AddressSpace &) - Address space queried by read_async / browse_async. Held by reference; must outlive this adapter and all outstanding callbacks.
void read_async(std::vector< ua::ReadValueId > nodesToRead, ReadCallback complete) override
Reads one or more attribute values from the local address space.
nodesToRead(std::vector< ua::ReadValueId >) - Attributes to read, each a NodeId + AttributeId pair.complete(ReadCallback) - Receives the outcome: on success a Result holding the per-input ua::DataValue vector; on failure a Result carrying an ua::ErrorDetail. Never throws.
void browse_async(std::vector< ua::BrowseDescription > nodesToBrowse, BrowseCallback complete) override
Browses references from one or more nodes in the local address space.
nodesToBrowse(std::vector< ua::BrowseDescription >) - Nodes to browse, each describing a starting NodeId, direction, and reference-type filter.complete(BrowseCallback) - Receives the outcome: on success a Result holding the per-input ua::BrowseResult vector; on failure a Result carrying an ua::ErrorDetail. Never throws.
ua::BaseEvent
class
Base class for all OPC UA events.
Holds the nine mandatory BaseEventType properties as concrete members for O(1) access. Subclasses (generated or hand-written) add type-specific fields and override resolve_field() to expose them.
This is a pure value type: no async, no strands, no I/O. Instances are constructed, populated, and handed to the EventBus, which fills in any unset auto-assigned fields (see the per-member notes) before dispatch.
Functions
Variant resolve_field(std::span< const QualifiedName > browse_path) const
Resolves a field by browse path for EventFilter evaluation.
browse_path(std::span< const QualifiedName >) - Relative browse path of the field to resolve.
Returns: The field value, or a null Variant if the field is not part of this event type.
std::unique_ptr< BaseEvent > clone() const
Creates a heap-allocated copy preserving the concrete event type.
Returns: An owning pointer to a copy with the same dynamic type as *this.
ExpandedNodeId event_type_expanded() const
Returns the EventType id in URI-bearing form.
Returns: The EventType identifier as an ExpandedNodeId.
bool is_condition_event() const
Returns true for condition-derived events (Condition and all subtypes).
Returns: true if this event derives from ConditionType, otherwise false.
BaseEvent()=default
~BaseEvent()=default
Copy-constructs a BaseEvent; the field snapshots are value members, so the copy is independent.
Copy-assigns a BaseEvent; the field snapshots are value members, so the copy is independent.
Returns: Reference to this event.
Move-constructs a BaseEvent, transferring the field snapshots from the source.
Move-assigns a BaseEvent, transferring the field snapshots from the source.
Returns: Reference to this event.
Public attributes
ByteString eventId
Unique identifier for this event occurrence.
NodeId eventType
NodeId of the EventType (e.g.
NodeId sourceNode
NodeId of the node that is the source of the event.
String sourceName
Human-readable description of the event source.
UtcTime time
Time the event occurred.
UtcTime receiveTime
Time the server received the event.
LocalizedText message
Human-readable event description.
uint16_t severity
Severity from 1 (lowest) to 1000 (highest).
std::optional< NodeId > conditionClassId
NodeId of the condition class this event belongs to, if any.
std::optional< LocalizedText > conditionClassName
Human-readable name of the condition class named by condition_class_id, if any.
std::optional< NodeId > conditionNodeId
NodeId of the ConditionType instance this event is about (the ConditionId), if any.
std::shared_ptr< const std::vector< NodeId > > eventTypeHierarchy
The resolved EventType supertype chain for this event occurrence: [event_type, parent, ..., BaseEventType].
ua::GenericEvent
class
Property-bag event for event types that have no generated C++ struct.
Extends BaseEvent with a set of extension fields keyed by browse path, letting an application emit custom or user-defined event types without code-generating a payload class. The mandatory BaseEventType properties are set through the inherited BaseEvent members; type-specific properties are added with set_field. Like BaseEvent this is a plain data type no async, no strands, no I/O - so instances are not thread-safe and must be externally synchronised if shared.
BaseEvent
Functions
GenericEvent(NodeId type_id)
Constructs an event of the given EventType.
type_id(NodeId) - NodeId of the EventType this occurrence represents; moved into the inherited BaseEvent::eventType member.
void set_field(std::vector< QualifiedName > browse_path, Variant value)
Sets an extension field, addressed by its browse path relative to the EventType.
browse_path(std::vector< QualifiedName >) - Browse path identifying the field; moved into storage.value(Variant) - Field value; moved into storage. A null Variant clears the field's value but keeps the path addressable.
Variant resolve_field(std::span< const QualifiedName > browse_path) const override
Resolves a field by browse path, checking mandatory base fields first, then the extension fields added via set_field.
browse_path(std::span< const QualifiedName >) - Browse path relative to the EventType.
Returns: The field value, or a null Variant if no base or extension field matches browse_path.
std::unique_ptr< BaseEvent > clone() const override
Creates a heap-allocated copy preserving the concrete type and extension fields.
Returns: An owning copy of this event as a BaseEvent pointer; never null.
ua::NamespaceHistoryDelegate
class
Extension seam through which a namespace serves OPC UA historical data and events.
A namespace implements this interface to expose history for the nodes it owns; the SDK's HistoryRead and HistoryUpdate services dispatch to it. Each operation is a batched, callback-canonical request: the delegate receives the full list of per-node items and reports each outcome through a BatchResult delivered to the supplied callback. The batch-level status reports whether the request as a whole was accepted; the per-item Result values carry each node's outcome and, on failure, an ErrorDetail.
All operations have default implementations that report BadHistoryOperationUnsupported for every item, so a delegate need only override the operations whose support it declares via capabilities. Every *_async method is noexcept and never throws - failures are reported through the result payload, never by exception.
The callback may be invoked inline on the calling stack or later from a worker thread; callers apply the post discipline (see async rules). Do not block the callback.
Member types
DetailKind (enum)
Identifies which kind of history read a continuation point belongs to.
Raw- Raw value-history read.Modified- Modified/replaced value-history read.AtTime- Read-at-time.Processed- Aggregate-processed read.Annotation- Annotation read.Events- Historical-event read.
std::any Cursor
Opaque pagination state, created and interpreted only by the delegate.
Result< HistoryReadRawSuccess > ReadRawItemResult
Per-item result of a raw/modified value-history read.
Result< HistoryReadAtTimeSuccess > ReadAtTimeItemResult
Per-item result of a read-at-time operation.
Result< HistoryReadProcessedSuccess > ReadProcessedItemResult
Per-item result of an aggregate-processed read.
Result< HistoryReadAnnotationSuccess > ReadAnnotationItemResult
Per-item result of an annotation read.
Result< HistoryReadEventsSuccess > ReadEventsItemResult
Per-item result of a historical-event read.
Result< HistoryUpdateSuccess > UpdateDataItemResult
Per-item result of a value-history update.
Result< HistoryUpdateSuccess > UpdateEventsItemResult
Per-item result of a historical-event update.
Result< HistoryUpdateSuccess > UpdateStructureDataItemResult
Per-item result of a structured-history update.
UpdateDataItemResult DeleteItemResult
Per-item result of any history delete operation.
std::function< void(BatchResult< ReadRawItemResult >)> ReadRawCallback
Callback receiving the per-item outcomes of a read_raw_async batch.
std::function< void(BatchResult< ReadAtTimeItemResult >)> ReadAtTimeCallback
Callback receiving the per-item outcomes of a read_at_time_async batch.
std::function< void(BatchResult< ReadProcessedItemResult >)> ReadProcessedCallback
Callback receiving the per-item outcomes of a read_processed_async batch.
std::function< void(BatchResult< ReadAnnotationItemResult >)> ReadAnnotationCallback
Callback receiving the per-item outcomes of a read_annotations_async batch.
std::function< void(BatchResult< ReadEventsItemResult >)> ReadEventsCallback
Callback receiving the per-item outcomes of a read_events_async batch.
std::function< void(BatchResult< UpdateDataItemResult >)> UpdateDataCallback
Callback receiving the per-item outcomes of an update_data_async batch.
std::function< void(BatchResult< UpdateEventsItemResult >)> UpdateEventsCallback
Callback receiving the per-item outcomes of an update_events_async batch.
std::function< void(BatchResult< UpdateStructureDataItemResult >)> UpdateStructureDataCallback
Callback receiving the per-item outcomes of an update_structure_data_async batch.
std::function< void(BatchResult< DeleteItemResult >)> DeleteRawCallback
Callback receiving the per-item outcomes of a delete_raw_async batch.
std::function< void(BatchResult< DeleteItemResult >)> DeleteAtTimeCallback
Callback receiving the per-item outcomes of a delete_at_time_async batch.
std::function< void(BatchResult< DeleteItemResult >)> DeleteEventsCallback
Callback receiving the per-item outcomes of a delete_events_async batch.
Functions
~NamespaceHistoryDelegate()=default
Capabilities capabilities() const noexcept
Declares which history operations this delegate supports.
Returns: The supported-operation flags. The default returns all-false (no operations supported).
void read_raw_async(const ReadContext &context, std::vector< ReadRawItem > items, ReadRawCallback callback) noexcept
Reads raw or modified value history for a batch of nodes.
context(const ReadContext &) - Read context, including cancellation flag and timestamp preference.items(std::vector< ReadRawItem >) - Per-node read requests, taken by value so the delegate may retain them.callback(ReadRawCallback) - Receives a BatchResult whose batch status reports whether the request was accepted, and each per-item Result holds the node's values or an ErrorDetail. This method never throws.
void read_at_time_async(const ReadContext &context, std::vector< ReadAtTimeItem > items, ReadAtTimeCallback callback) noexcept
Reads values at specific timestamps for a batch of nodes.
context(const ReadContext &) - Read context, including cancellation flag and timestamp preference.items(std::vector< ReadAtTimeItem >) - Per-node read requests, taken by value so the delegate may retain them.callback(ReadAtTimeCallback) - Receives a BatchResult whose per-item Result holds the node's values or an ErrorDetail. This method never throws.
void read_processed_async(const ReadContext &context, std::vector< ReadProcessedItem > items, ReadProcessedCallback callback) noexcept
Reads aggregate-processed value history for a batch of nodes.
context(const ReadContext &) - Read context, including cancellation flag and timestamp preference.items(std::vector< ReadProcessedItem >) - Per-node read requests, taken by value so the delegate may retain them.callback(ReadProcessedCallback) - Receives a BatchResult whose per-item Result holds the aggregated values or an ErrorDetail. This method never throws.
void read_annotations_async(const ReadContext &context, std::vector< ReadAnnotationItem > items, ReadAnnotationCallback callback) noexcept
Reads history annotations for a batch of nodes.
context(const ReadContext &) - Read context, including cancellation flag and timestamp preference.items(std::vector< ReadAnnotationItem >) - Per-node read requests, taken by value so the delegate may retain them.callback(ReadAnnotationCallback) - Receives a BatchResult whose per-item Result holds the annotation values or an ErrorDetail. This method never throws.
void read_events_async(const ReadContext &context, std::vector< ReadEventsItem > items, ReadEventsCallback callback) noexcept
Reads historical events for a batch of event-source nodes.
context(const ReadContext &) - Read context, including cancellation flag and timestamp preference.items(std::vector< ReadEventsItem >) - Per-node read requests, taken by value so the delegate may retain them.callback(ReadEventsCallback) - Receives a BatchResult whose per-item Result holds the matching events or an ErrorDetail. This method never throws.
void update_data_async(const UpdateContext &context, std::vector< UpdateDataItem > items, UpdateDataCallback callback) noexcept
Inserts or replaces historical values for a batch of nodes.
context(const UpdateContext &) - Update context, including the cancellation flag.items(std::vector< UpdateDataItem >) - Per-node update requests, taken by value so the delegate may retain them.callback(UpdateDataCallback) - Receives a BatchResult whose per-item Result holds the per-value status codes or an ErrorDetail. This method never throws.
void update_events_async(const UpdateContext &context, std::vector< UpdateEventsItem > items, UpdateEventsCallback callback) noexcept
Inserts, replaces, or updates historical events for a batch of event-source nodes.
context(const UpdateContext &) - Update context, including the cancellation flag.items(std::vector< UpdateEventsItem >) - Per-node update requests, taken by value so the delegate may retain them.callback(UpdateEventsCallback) - Receives a BatchResult whose per-item Result holds the per-event status codes or an ErrorDetail. This method never throws.
void update_structure_data_async(const UpdateContext &context, std::vector< UpdateStructureDataItem > items, UpdateStructureDataCallback callback) noexcept
Inserts, replaces, updates, or removes structured history (e.g.
context(const UpdateContext &) - Update context, including the cancellation flag.items(std::vector< UpdateStructureDataItem >) - Per-node update requests, taken by value so the delegate may retain them.callback(UpdateStructureDataCallback) - Receives a BatchResult whose per-item Result holds the per-entry status codes or an ErrorDetail. This method never throws.
void delete_raw_async(const UpdateContext &context, std::vector< DeleteRawItem > items, DeleteRawCallback callback) noexcept
Deletes raw or modified value history over a time range for a batch of nodes.
context(const UpdateContext &) - Update context, including the cancellation flag.items(std::vector< DeleteRawItem >) - Per-node delete requests, taken by value so the delegate may retain them.callback(DeleteRawCallback) - Receives a BatchResult whose per-item Result holds the outcome or an ErrorDetail. This method never throws.
void delete_at_time_async(const UpdateContext &context, std::vector< DeleteAtTimeItem > items, DeleteAtTimeCallback callback) noexcept
Deletes values at specific timestamps for a batch of nodes.
context(const UpdateContext &) - Update context, including the cancellation flag.items(std::vector< DeleteAtTimeItem >) - Per-node delete requests, taken by value so the delegate may retain them.callback(DeleteAtTimeCallback) - Receives a BatchResult whose per-item Result holds the outcome or an ErrorDetail. This method never throws.
void delete_events_async(const UpdateContext &context, std::vector< DeleteEventsItem > items, DeleteEventsCallback callback) noexcept
Deletes historical events for a batch of event-source nodes.
context(const UpdateContext &) - Update context, including the cancellation flag.items(std::vector< DeleteEventsItem >) - Per-node delete requests, taken by value so the delegate may retain them.callback(DeleteEventsCallback) - Receives a BatchResult whose per-item Result holds the outcome or an ErrorDetail. This method never throws.
void release_cursor(Cursor cursor) noexcept
Releases a continuation cursor the delegate previously issued.
cursor(Cursor) - The cursor to release; ownership transfers to this call.
ua::MethodAdapter
class
Decodes a Call service request into a strongly-typed method handler.
Wraps a handler that receives method input arguments as a typed InputArgs tuple instead of a raw Variant list. When invoked as a node's method callable, the adapter validates arity, decodes each Variant into the corresponding tuple element, and forwards the result to the wrapped handler; decode and arity failures are reported to the completion callback without reaching the handler.
InputArgs is a std::tuple whose elements name the expected argument types in order. A trailing std::optional<U> element marks an optional trailing input argument (OPC 10000-4 5.11.2.2) that the client may omit, in which case the handler receives std::nullopt. Optional arguments must follow all required ones (OPC 10000-3 5.7.3); this trailing-only invariant is checked at compile time.
InputArgs std::tuple of expected input-argument types, in declaration order, with optional trailing elements modelled as std::optional<U>.
Member types
std::function< void(const NodeId &objectId, const InputArgs &, shared_ptr< const MethodCallContext >, CallMethodResult, Node::CallMethodCompleteCallback)> Handler
Typed method handler invoked once the input arguments are decoded.
Functions
MethodAdapter(Handler handler)
Constructs an adapter that forwards decoded calls to handler.
handler(Handler) - Typed handler invoked on a successful argument decode. Moved into the adapter and retained for the adapter's lifetime.
void operator()(const CallMethodRequest &callMethodRequest, shared_ptr< const MethodCallContext > context, Node::CallMethodCompleteCallback callback) const
Decodes callMethodRequest and invokes the wrapped handler.
callMethodRequest(const CallMethodRequest &) - Request carrying the object NodeId and input argument Variant list.context(shared_ptr< const MethodCallContext >) - Per-call session context, or null when no session context is available. Held by shared ownership for the (possibly asynchronous) duration of the call.callback(Node::CallMethodCompleteCallback) - Receives the CallResult outcome exactly once.
ua::ExternalReference
struct
A reference from a deleted node whose target lives in another namespace.
Returned by Namespace::delete_node so the caller (the owning AddressSpace) can remove the corresponding inverse reference from the target node, which a single namespace cannot reach on its own.
Public attributes
NodeId referenceType
Type of the dangling reference.
ExpandedNodeId target
Cross-namespace endpoint that still holds the inverse reference.
bool isForward
Direction of the reference as seen from the deleted node.
ua::Namespace
class
One OPC UA namespace within the server address space.
A namespace owns a disjoint set of nodes addressed under a single namespace URI / index and exposes asynchronous, callback-canonical operations to find, create and delete those nodes, plus optional data-change monitoring. The owning AddressSpace routes every request to the namespace that owns the target node. Implementations decide their own threading and serialization (typically a private strand); callers invoke from any thread and the completion callback runs on an unspecified worker thread - do not block it.
Implementations override the pure-virtual core (uri, set_index, find_node, delete_node) and may override the optional hooks - create_node (which by default declines with BadNotSupported), the monitoring operations and the service-delegate hooks - to extend behaviour for the namespace; the base provides safe no-op / decline defaults for every optional hook.
Member types
std::function< void(NodeAccessorResult)> FindNodeCompleteCallback
Callback delivering the outcome of find_node.
std::function< void(BatchResult< NodeAccessorResult >)> FindNodesCompleteCallback
Callback delivering the per-item outcome of find_nodes.
Callback delivering the outcome of enumerate_nodes.
std::function< void(NodeAccessorResult)> CreateNodeCompleteCallback
Callback delivering the outcome of create_node.
std::function< void(DeleteNodeResult)> DeleteNodeCompleteCallback
Callback delivering the outcome of delete_node.
std::function< void(BatchResult< MonitoringCreateItemResult >)> CreateMonitoringCallback
Callback delivering the per-item outcome of create_monitoring.
std::function< void(BatchResult< VoidResult >)> DeleteMonitoringCallback
Callback delivering the per-handle outcome of delete_monitoring.
std::function< void(BatchResult< MonitoringModifyItemResult >)> ModifyMonitoringCallback
Callback delivering the per-item outcome of modify_monitoring.
Functions
Namespace()=default
~Namespace()
String uri() const =0
Returns the namespace URI that uniquely identifies this namespace.
Returns: The namespace URI, the string form used to register and look this namespace up in the server's namespace array.
void set_index(uint16_t index)=0
Assigns the namespace index this namespace occupies in the server's namespace array.
index(uint16_t) - Zero-based candidate namespace-array slot.
void shutdown_async(std::function< void(VoidResult)> callback) noexcept=0
Stops the background work this namespace is running, without destroying it.
callback(std::function< void(VoidResult)>) - Invoked exactly once when this namespace has no work left running. Runs on an unspecified worker thread. Never throws.
void find_node(const NodeId &nodeId, FindNodeCompleteCallback callback)=0
Resolves a node owned by this namespace to an accessor.
nodeId(const NodeId &) - Identifier of the node to resolve. Its namespace index is assumed to belong to this namespace.callback(FindNodeCompleteCallback) - Receives a NodeAccessorResult - on success an accessor for the node; on failure a bad StatusCode carrying any ErrorDetail (e.g. BadNodeIdUnknown). Never throws.
void find_nodes(std::span< const NodeId > nodeIds, FindNodesCompleteCallback callback)
Resolves a batch of nodes owned by this namespace to accessors.
nodeIds(std::span< const NodeId >) - Identifiers to resolve, viewed but not owned by the callee; each is assumed to belong to this namespace. The span is valid only for the synchronous portion of the call - an implementation that completes asynchronously copies what it needs before returning.callback(FindNodesCompleteCallback) - Receives a BatchResult with one NodeAccessorResult per input id, in request order (good with an accessor, or a bad StatusCode carrying any ErrorDetail). The batch status is good whenever per-item results were produced. Never throws.
void enumerate_nodes(EnumerateNodesCallback callback) const
Enumerates the NodeIds of every node this namespace owns.
callback(EnumerateNodesCallback) - Receives a Result holding the owned NodeIds on success, or a bad StatusCode (BadNotSupported by default) carrying any ErrorDetail. Never throws.
Creates a node of the given class in this namespace, with its initial attributes.
nodeId(const NodeId &) - Identifier for the new node; must not already exist in this namespace.nodeClass(NodeClass) - OPC UA node class to instantiate.initialAttributes(InitialAttributes) - Standard attributes (id + wire-form value) to apply atomically as the node is created; may be empty for a bare node. A Variable's live value is not a creation attribute (use a value source / write_value); a VariableType's static default Value may be supplied here.callback(CreateNodeCompleteCallback) - Receives a NodeAccessorResult - on success an accessor for the created node; on failure a bad StatusCode carrying any ErrorDetail (BadNotSupported from the base default). Never throws.
void delete_node(const NodeId &nodeId, bool deleteForwardHierarchicalRefs, DeleteNodeCompleteCallback callback)=0
Deletes a node and its intra-namespace references from this namespace.
nodeId(const NodeId &) - Identifier of the node to delete.deleteForwardHierarchicalRefs(bool) - When true, also delete nodes reachable by forward hierarchical references from this node (recursive subtree delete).callback(DeleteNodeCompleteCallback) - Receives a DeleteNodeResult - on success the ExternalReference entries needing cross-namespace cleanup; on failure a bad StatusCode carrying any ErrorDetail. Never throws.
void create_monitoring(std::span< const MonitoringCreateItem > items, CreateMonitoringCallback callback)
Creates data-change monitoring registrations for a batch of items.
items(std::span< const MonitoringCreateItem >) - Items to register, viewed but not owned by the callee.callback(CreateMonitoringCallback) - Receives a BatchResult with one MonitoringCreateItemResult per input item (handle on success, bad StatusCode carrying any ErrorDetail on failure). Never throws.
void delete_monitoring(std::span< const MonitoringHandle > handles, DeleteMonitoringCallback callback)
Deletes monitoring registrations identified by handle.
handles(std::span< const MonitoringHandle >) - Handles to release, viewed but not owned by the callee.callback(DeleteMonitoringCallback) - Receives a BatchResult with one VoidResult per input handle. Never throws.
void modify_monitoring(std::span< const MonitoringModifyItem > items, ModifyMonitoringCallback callback)
Modifies existing monitoring registrations.
items(std::span< const MonitoringModifyItem >) - Modification requests, viewed but not owned by the callee.callback(ModifyMonitoringCallback) - Receives a BatchResult with one MonitoringModifyItemResult per input item. Never throws.
shared_ptr< NamespaceBrowseDelegate > browse_delegate() noexcept
Returns the delegate that customizes Browse-service handling for this namespace.
Returns: The browse delegate, or nullptr to use the SDK's default Browse handling.
shared_ptr< NamespaceRegisterNodesDelegate > register_nodes_delegate() noexcept
Returns the delegate that customizes RegisterNodes/UnregisterNodes handling for this namespace.
Returns: The register-nodes delegate, or nullptr to use the SDK's default handling.
shared_ptr< NamespaceMethodDelegate > method_delegate() noexcept
Returns the delegate that customizes Call-service (method) handling for this namespace.
Returns: The method delegate, or nullptr to use the SDK's default Call handling.
shared_ptr< NamespaceHistoryDelegate > history_delegate() noexcept
Returns the delegate that provides historical-access for nodes in this namespace.
Returns: The history delegate, or nullptr if this namespace has no history support.
SemanticChangeSource * semantic_change_source() noexcept
Optional capability for SemanticsChanged delivery (CTT Data Access Analog 008).
Returns: The namespace's SemanticChangeSource used to signal SemanticsChanged data-changes, or nullptr when the namespace does not track semantic changes.
std::optional< PermissionType > effective_permissions(const AccessIdentity &identity, std::optional< NodeAccessor > node) const
What identity may do with node, or with this namespace when node is absent.
identity(const AccessIdentity &) - The caller equivalence class; borrowed for the call only.node(std::optional< NodeAccessor >) - A node of this namespace, or nullopt to ask about the namespace itself; borrowed for the call only.
Returns: The effective permission bits, or nullopt when only the asynchronous member can answer.
void effective_permissions_async(shared_ptr< const AccessIdentity > identity, std::optional< std::vector< NodeId > > nodes, EffectivePermissionsCallback callback)
Resolves and returns effective permissions for node subjects or for this namespace.
identity(shared_ptr< const AccessIdentity >) - The caller equivalence class, by owning handle so it can be retained across the asynchronous boundary.nodes(std::optional< std::vector< NodeId > >) - Engaged and non-empty for node subjects, or disengaged for the namespace subject. Owned by the call.callback(EffectivePermissionsCallback) - Completion carrying the effective masks; invoked exactly once.
void validate_role_permissions_update_async(NodeId nodeId, std::optional< std::vector< RolePermissionType > > proposedRolePermissions, std::function< void(VoidResult)> callback) noexcept
Prospectively validates a mutable RolePermissions update owned by this namespace.
nodeId(NodeId) - The existing node whose policy would change.proposedRolePermissions(std::optional< std::vector< RolePermissionType > >) - Exact stored proposal, or nullopt to clear the override.callback(std::function< void(VoidResult)>) - Completion invoked exactly once with the policy verdict.
std::optional< std::vector< RolePermissionType > > default_role_permissions() const
This namespace's DefaultRolePermissions - the Part 3 5.2.9 fallback for a node carrying none.
Returns: The namespace-wide default; see the three states above.
std::optional< AccessRestrictionType > default_access_restrictions() const
This namespace's DefaultAccessRestrictions - the channel condition for a node carrying none.
Returns: The namespace-wide channel condition, or nullopt for none. Default: nullopt.
void on_identity_released(const AccessIdentityKey &key) noexcept
No further call will name key.
key(const AccessIdentityKey &) - The key of the identity now dead. Never reissued.
std::optional< NodeId > metadata_object() const
The NamespaceMetadataType Object this namespace already serves for itself.
Returns: The Object this namespace serves, or nullopt to let the SDK create one.
ua::NamespaceArray
class
The address space's table of registered namespaces, keyed by index and URI.
Holds the ordered list of Namespace instances that back a server's address space. The position of a namespace in this table is its namespace index, the small integer that qualifies every NodeId on the wire; index 0 is OPC UA NS0 (http://opcfoundation.org/UA/), installed by initialise(). Lookups are bidirectional: index -> URI/Namespace and URI -> index/Namespace.
All operations are internally synchronised by a shared mutex, so the table may be queried and extended concurrently from any thread.
Functions
shared_ptr< Namespace > get_namespace(uint16_t index) const
Returns the namespace registered at index, or nullptr if none.
index(uint16_t) - Namespace index to resolve.
Returns: The Namespace at index, or an empty shared_ptr if index is out of range. Does not throw.
shared_ptr< Namespace > get_namespace(string_view uri) const
Returns the namespace whose URI equals uri.
uri(string_view) - Namespace URI to resolve. Not retained.
Returns: The matching Namespace.
uint16_t get_namespace_index(string_view uri) const
Returns the index of the namespace whose URI equals uri.
uri(string_view) - Namespace URI to resolve. Not retained.
Returns: The namespace index for uri.
String get_namespace_uri(uint16_t index) const
Returns the URI of the namespace registered at index.
index(uint16_t) - Namespace index to resolve.
Returns: The namespace URI at index.
Returns the registered URIs ordered by namespace index.
Returns: The namespace array as published in the NamespaceArray Variable, element i being the URI of namespace index i.
ua::AccessIdentityKey
class
Identifies an access identity for as long as it is live.
Opaque, stable for the identity's lifetime, never reused within a server, equality-comparable and hashable - which is the whole of its contract, because its only purpose is to let a namespace key its own tables by the caller it was asked about and drop the row when Namespace::on_identity_released names it.
A namespace shall not read anything into the value: it is a server-assigned token, not an index, and two servers in one process assign from separate sequences.
Functions
AccessIdentityKey() noexcept=default
Constructs the key no live identity ever carries, so a default-constructed key compares equal to no issued one.
AccessIdentityKey(uint64_t value) noexcept
Constructs a key over a server-assigned token.
value(uint64_t) - Non-zero token; the server's identity table is the only thing that may assign one.
bool valid() const noexcept
Whether this key names an identity at all.
Returns: true iff the key was assigned rather than default-constructed.
uint64_t value() const noexcept
The opaque token, for hashing and for correlating a log line with a key.
Returns: The assigned token, or zero for a default-constructed key.
ua::AccessIdentity
class
The equivalence class of callers a namespace is asked about.
Not a Session. Several sessions of one user, on one endpoint, with one application URI and one claim set are one identity and are prepared once; the same user on an unsecured and on an encrypted endpoint are two, because Part 18 4.4.1 compares Endpoint settings when granting Roles, so the two can hold different Roles and must not share an answer.
The SDK keeps an identity alive from the moment it is first named until the last caller mapping to it has gone, and issues no call naming it outside that window. A namespace may therefore hold the key - never the object - in its own tables and rely on Namespace::on_identity_released to tell it when the row is dead.
Functions
AccessIdentity(AccessIdentityKey key, std::vector< NodeId > grantedRoles, shared_ptr< const UserIdentity > user, shared_ptr< const EndpointSecurityContext > endpoint, String applicationUri) noexcept
Assembles an identity.
key(AccessIdentityKey) - The server-assigned key, already unique among live identities.grantedRoles(std::vector< NodeId >) - Part-18 Role NodeIds granted to this identity; may be empty.user(shared_ptr< const UserIdentity >) - The authenticated principal; non-null, and outlives this object.endpoint(shared_ptr< const EndpointSecurityContext >) - The negotiated endpoint security context; non-null, and outlives this object.applicationUri(String) - The calling client's application URI, copied because the address-space layer cannot see inside endpoint.
AccessIdentity(AccessIdentityKey key, std::vector< NodeId > grantedRoles, std::vector< NodeId > registeredRoles, shared_ptr< const UserIdentity > user, shared_ptr< const EndpointSecurityContext > endpoint, String applicationUri, uint64_t roleConfigurationEpoch=0) noexcept
Assembles an identity with a coherent snapshot of every configured Role.
key(AccessIdentityKey) - The interning key for this identity.grantedRoles(std::vector< NodeId >) - The Roles the identity holds.registeredRoles(std::vector< NodeId >) - Every Role in configuration, granted or not.user(shared_ptr< const UserIdentity >) - The authenticated user the identity was activated for.endpoint(shared_ptr< const EndpointSecurityContext >) - The endpoint security context the Session activated over.applicationUri(String) - The client application URI the Session presented.roleConfigurationEpoch(uint64_t) - The RoleConfiguration generation the snapshots were read at; zero when the identity was built without one.
const AccessIdentityKey & key() const noexcept
The key that names this identity for as long as it is live.
Returns: The key; stable, and never reissued once the identity is released.
std::span< const NodeId > granted_roles() const noexcept
The Part-18 Roles granted to this identity, as NodeIds.
Returns: The granted Roles, in configuration order; may be empty. Valid while this object is.
std::optional< std::span< const NodeId > > registered_roles() const noexcept
Returns the complete registered Role set captured with granted_roles.
Returns: Every registered Role, or nullopt when no RoleConfiguration snapshot was taken.
const UserIdentity & user() const noexcept
The authenticated principal - kind, id and claims - for a namespace deciding its own way.
Returns: The principal. Valid while this object is.
std::string_view application_uri() const noexcept
The calling client's verified application URI.
Returns: The URI, possibly empty. Valid while this object is.
uint64_t role_configuration_epoch() const noexcept
RoleConfiguration epoch against which the Role snapshots were evaluated.
Returns: The epoch the Role snapshots were read at, or zero when there was no configuration.
const EndpointSecurityContext & endpoint() const noexcept
The negotiated endpoint security context - mode, policy, endpoint and transport.
Returns: The endpoint context. Valid while this object is.
ua::MonitoringCreateItem
struct
Per-item input describing one node attribute to begin monitoring.
One element of the batch passed to Namespace::create_monitoring(). MonitoringCreateItemResult, MonitoringModifyItem
Public attributes
NodeId nodeId
Node whose attribute is sampled.
AttributeId attributeId
Attribute of nodeId to monitor.
IntegerId monitoredItemId
Caller's identifier, echoed back to sink on delivery.
Duration samplingInterval
Requested sampling interval in milliseconds; 0 requests the fastest practical rate, subject to revision.
uint32_t queueSize
Maximum samples buffered before older values are overwritten.
std::shared_ptr< SampleSink > sink
Shared sink that receives sampled values; one per subscription.
ua::MonitoringCreateSuccess
struct
Successful per-item outcome of Namespace::create_monitoring().
MonitoringCreateItemResult
Public attributes
MonitoringHandle handle
Handle identifying the new registration; pass to delete_monitoring() / modify_monitoring().
Duration revisedSamplingInterval
Interval the namespace will actually sample at, in milliseconds; may differ from the requested value.
ua::MonitoringModifyItem
struct
Per-item input describing a change to an existing monitoring registration.
One element of the batch passed to Namespace::modify_monitoring(). MonitoringModifyItemResult, MonitoringCreateItem
Public attributes
MonitoringHandle handle
Handle of the registration to modify, from MonitoringCreateSuccess::handle.
Duration samplingInterval
New requested sampling interval in milliseconds; 0 requests the fastest practical rate, subject to revision.
uint32_t queueSize
New maximum number of buffered samples.
ua::MonitoringModifySuccess
struct
Successful per-item outcome of Namespace::modify_monitoring().
MonitoringModifyItemResult
Public attributes
Duration revisedSamplingInterval
Interval the namespace will actually sample at after the change, in milliseconds; may differ from requested.
ua::default_ns::NamespaceMonitoringSupport
class
Reusable helper for namespace implementations that support monitoring.
Owns a SamplingEngine and maps namespace-level monitoring handles to engine entries. A namespace implementation resolves the requested nodes itself (synchronously or asynchronously) and passes the resolved items to create_monitoring(); the helper routes each item to the engine and returns per-item results, including the dispatch key the namespace uses to wire up write notifiers for exception-based sampling.
Thread-safety: every public method is synchronous and may be called from any thread. The internal record map and handle counter are guarded by a private mutex. User-facing sinks are never invoked while that mutex is held - state is copied out under the lock first, and the caller fires the sink afterwards (see invalidate_node()).
Lifetime: derives from std::enable_shared_from_this so that write-notifier lambdas installed on nodes can capture a weak_ptr to the helper and bail out safely if it has already been destroyed. Always own instances through a std::shared_ptr. Non-copyable.
Functions
NamespaceMonitoringSupport(boost::asio::any_io_executor executor, ua::Logger logger={})
Constructs the support helper and its underlying sampling engine.
executor(boost::asio::any_io_executor) - Executor on which the engine schedules its sampling-bucket timers; sampling ticks run on this executor's threads.logger(ua::Logger) - Logger the engine hands to ua::async::guarded so an exception escaping a sampling-continuation post is recorded rather than lost; default-constructs silent.
Destroys the helper, releasing the engine and all tracked registrations.
std::vector< CreateResult > create_monitoring(std::span< const ResolvedMonitoringItem > items)
Creates monitoring registrations for a set of resolved items.
items(std::span< const ResolvedMonitoringItem >) - Resolved create requests, one entry per requested monitored item.
Returns: One CreateResult per input item, in the same order.
std::vector< ModifyResult > modify_monitoring(std::span< const MonitoringModifyItem > items)
Modifies existing monitoring registrations.
items(std::span< const MonitoringModifyItem >) - Modify requests, each identifying an existing registration.
Returns: One ModifyResult per input item, in the same order.
std::vector< VoidResult > delete_monitoring(std::span< const MonitoringHandle > handles)
Deletes monitoring registrations identified by namespace handle.
handles(std::span< const MonitoringHandle >) - Namespace handles of the registrations to remove.
Returns: One VoidResult per input handle, in the same order; an unknown handle yields a failure result.
void notify_value_changed(uint32_t dispatchKey, DataValue newValue)
Notifies the engine that a monitored value has changed.
dispatchKey(uint32_t) - Key obtained from a CreateResult or ModifyResult.newValue(DataValue) - The value just written, forwarded to the engine.
void shutdown()
Cancels all sampling timers and clears every registration.
std::vector< InvalidationEntry > invalidate_node(Node *node)
Stops all monitoring registrations for a node in the engine.
node(Node *) - Node whose registrations are being invalidated.
Returns: The (sink, monitoredItemId) pairs to notify; the caller MUST fire them only after releasing any locks it holds.
std::vector< InvalidationEntry > find_value_monitors(Node *node) const
Finds all Value-attribute monitoring registrations for a node WITHOUT removing them.
node(Node *) - Node whose value monitors are being collected.
Returns: The (sink, monitoredItemId) pairs to notify; the caller MUST fire them only after releasing any locks it holds.
std::optional< MonitoringRecord > find_record(MonitoringHandle nsHandle) const
Looks up the record for a namespace handle.
nsHandle(MonitoringHandle) - Namespace handle to look up.
Returns: The matching record, or std::nullopt if the handle is unknown.
ua::NamespaceBrowseDelegate
class
Per-namespace hook that takes over Browse and BrowseNext for selected nodes.
A namespace may register a delegate to answer Browse requests itself instead of the SDK's address-space-backed implementation - for example to project a large or externally-backed information model on demand. For each batch the SDK first asks wants_browse_override; if accepted, the delegate produces the references via browse_async and owns continuation state through opaque resume tokens, which the SDK stores and hands back on BrowseNext (and releases via release_resume_token).
Implementations must be safe to call concurrently from the server's worker threads; the SDK does not serialize delegate calls onto any particular strand.
Member types
Result< BrowseItemSuccess > BrowseItemResult
Outcome for a single browsed item: a BrowseItemSuccess or an ErrorDetail.
std::function< void(BatchResult< BrowseItemResult >)> CompleteCallback
Callback delivering the per-item outcomes for an entire batch.
Functions
~NamespaceBrowseDelegate()=default
bool wants_browse_override(const Context &context, const std::vector< Item > &items) const noexcept
Decides whether this delegate will handle the given items.
context(const Context &) - Request-wide inputs for the batch.items(const std::vector< Item > &) - Items the SDK is offering to this delegate.
Returns: true to handle the batch via browse_async; false (default) to fall back to the SDK.
void browse_async(const Context &context, std::vector< Item > items, CompleteCallback callback) noexcept=0
Executes Browse/BrowseNext for the given items and delivers the outcomes asynchronously.
context(const Context &) - Request-wide inputs for the batch; valid only for the duration of the call.items(std::vector< Item >) - Nodes to browse, taken by value so the delegate may retain them.callback(CompleteCallback) - Receives the BatchResult; invoked exactly once.
void release_resume_token(ByteString token) noexcept
Notifies the delegate that a stored resume token will no longer be used.
token(ByteString) - The continuation token previously returned by browse_async.
ua::NamespaceMethodDelegate
class
Per-namespace delegate that overrides the Call service for a namespace.
When a namespace registers a delegate, the SDK routes CallMethodRequest items whose objectId falls in that namespace to the delegate instead of performing the default address-space-based method lookup and invocation. Items destined for other namespaces are unaffected.
The SDK performs per-item authorization before items reach the delegate; only authorized items are included in the batch handed to call_async.
Implementations subclass this type to supply namespace-specific method dispatch. call_async is the extension contract and must be implemented.
Member types
Result< CallMethodResult > MethodItemResult
Outcome of a single method call: a CallMethodResult on success, or an ErrorDetail describing why the call could not be executed at all.
std::function< void(BatchResult< MethodItemResult >)> CompleteCallback
Completion callback for call_async, receiving the per-item batch outcome.
Functions
~NamespaceMethodDelegate()=default
bool wants_call_override(const Context &context, const std::vector< Item > &items) const noexcept
Decides whether this delegate handles the given items.
context(const Context &) - Per-call context for the batch.items(const std::vector< Item > &) - The items the SDK proposes to route to this delegate.
Returns: true to handle the items via call_async; false (default) to fall back to the SDK.
void call_async(const Context &context, std::vector< Item > items, CompleteCallback callback) noexcept=0
Executes the method calls for the given items and reports the outcome asynchronously.
context(const Context &) - Per-call context for the batch; poll context.mCancelled to abandon long-running work.items(std::vector< Item >) - Items to execute, taken by value so the implementation may move from them.callback(CompleteCallback) - Receives the BatchResult outcome. Invoked exactly once; errors are reported through the result, never thrown.
ua::NamespaceRegisterNodesDelegate
class
Optional capability hook for namespaces that implement RegisterNodes/UnregisterNodes.
A namespace inherits from this interface to take over RegisterNodes and UnregisterNodes for its own nodes - for example to allocate optimized, session-scoped NodeId aliases that make repeated access to externally-backed nodes cheaper. Namespaces that do not provide a delegate get the default behaviour: RegisterNodes echoes back the requested NodeIds unchanged, and UnregisterNodes is a no-op.
Implementations must be safe to call from the server's worker threads; the SDK does not serialize delegate calls onto any particular strand.
Member types
std::function< void(BatchResult< NodeId >)> RegisterCompleteCallback
Callback delivering the per-item RegisterNodes outcomes for an entire batch.
std::function< void(VoidResult)> UnregisterCompleteCallback
Callback signalling completion of an UnregisterNodes batch.
Functions
~NamespaceRegisterNodesDelegate()=default
void register_nodes_async(const Context &context, std::vector< Item > items, RegisterCompleteCallback callback) noexcept=0
Registers the given nodes and delivers the resulting NodeIds asynchronously.
context(const Context &) - Request-wide inputs for the batch; valid only for the duration of the call.items(std::vector< Item >) - Nodes to register, taken by value so the delegate may retain them.callback(RegisterCompleteCallback) - Receives the BatchResult; invoked exactly once.
void unregister_nodes_async(const Context &context, std::vector< Item > items, UnregisterCompleteCallback callback) noexcept=0
Releases registrations previously created by register_nodes_async.
context(const Context &) - Request-wide inputs for the batch; valid only for the duration of the call.items(std::vector< Item >) - Nodes to unregister, taken by value so the delegate may retain them.callback(UnregisterCompleteCallback) - Receives the VoidResult; invoked exactly once.
ua::MethodCallContext
struct
Per-call session context threaded through to method handlers.
Populated by the Call service from the active session and passed by shared ownership to Node::call, so a handler that completes asynchronously may retain it past the call's synchronous portion. A null shared_ptr<const MethodCallContext> indicates no session context is available - e.g. direct calls from tests or internal SDK operations; handlers that require session state must fail closed in that case.
Public attributes
String clientUserId
Authenticated user identity of the calling session (the ClientUserId reported in condition events).
NodeId sessionId
NodeId of the calling session, used for cross-session validation (e.g. ConditionRefresh).
MessageSecurityMode channelSecurityMode
Security mode of the secure channel over which the call was made.
std::vector< LocaleId > sessionLocales
Locale preference list supplied by the session at ActivateSession.
ua::ExternalValueSource
class
Optional capability seam for Variable nodes that support runtime value-handler registration and external value-change notification.
A namespace implementation whose Variable nodes accept programmatic handler installation inherits from this interface and overrides Node::external_value_source() to return this. Implementations that do not support handler registration (e.g. proxies to remote servers) do not inherit it; callers detect support via Node::external_value_source(), which returns nullptr when unsupported.
Member types
std::function< void(DataValueResult)> ReadValueCompleteCallback
Completion callback for a registered read handler, carrying the value or an ErrorDetail on failure.
std::function< void(ReadValueCompleteCallback)> ReadValueHandler
Handler invoked to produce the Variable's live value; it completes by invoking the supplied ReadValueCompleteCallback.
std::function< void(VoidResult)> WriteValueCompleteCallback
Completion callback for a registered write handler, signalling success or an ErrorDetail on failure.
std::function< void(DataValue, WriteValueCompleteCallback)> WriteValueHandler
Handler invoked to apply a new value to the external source; it completes by invoking the supplied WriteValueCompleteCallback.
Functions
ExternalValueSource()=default
~ExternalValueSource()=default
VoidResult set_read_value_handler(ReadValueHandler handler)=0
Installs the handler that produces the Variable's value on read.
handler(ReadValueHandler) - Invoked for each read; ownership is transferred to the node.
Returns: Success, or an ErrorDetail when the source rejects registration. Never throws.
VoidResult set_write_value_handler(WriteValueHandler handler)=0
Installs the handler that applies a new value on write.
handler(WriteValueHandler) - Invoked for each write; ownership is transferred to the node.
Returns: Success, or an ErrorDetail when the source rejects registration. Never throws.
void notify_value_changed(DataValue newValue)=0
Signals that the externally-managed value has changed.
newValue(DataValue) - The updated value to publish to subscribers.
ua::MethodCallSource
class
Optional capability seam for Method nodes that support runtime call-handler registration.
A namespace implementation whose Method nodes accept programmatic handler installation inherits from this interface and overrides Node::method_call_source() to return this. Implementations that do not support handler registration (e.g. proxies to remote servers) do not inherit it; callers detect support via Node::method_call_source(), which returns nullptr when unsupported.
Member types
std::function< void(const CallMethodRequest &methodToCall, shared_ptr< const MethodCallContext > context, std::function< void(CallResult)> callback)> CallHandler
Handler invoked to execute a method call.
Functions
MethodCallSource()=default
~MethodCallSource()=default
StatusCode set_call_handler(CallHandler handler)=0
Installs the handler invoked when the method is called.
handler(CallHandler) - Invoked for each call; ownership is transferred to the node.
Returns: Good, or a bad StatusCode when the source rejects registration.
ua::Node
class
A single node in the address space, exposing its attributes, references, value, and methods.
Node is the abstract extension contract implemented by namespace providers. Most operations are callback-canonical *_async: they may complete inline or post to the address space's strand, and the callback runs on an unspecified worker thread - do not block it. Attribute access (read_attribute / write_attribute) is synchronous and operates on the OPC UA wire form. Instances are managed via std::shared_ptr; the type derives from std::enable_shared_from_this.
Member types
Result< References > ReferencesResult
Result holding this node's full reference set.
std::function< void(ReferencesResult)> GetReferencesCallback
Completion callback for get_references; carries the references or an ErrorDetail.
Result< ReferencePage > ReferencesPageResult
Result holding a single ReferencePage.
std::function< void(ReferencesPageResult)> GetReferencesPageCallback
Completion callback for the paged get_references; carries a page or an ErrorDetail.
std::function< void(VoidResult)> ReferenceModifyCallback
Completion callback for reference add/remove operations; signals success or an ErrorDetail.
std::function< void(VoidResult)> WriteAttributeCompleteCallback
Completion callback for write_attribute_async; signals success or an ErrorDetail.
std::function< void(CallResult)> CallMethodCompleteCallback
Completion callback for call; carries the CallResult.
std::function< void(DataValueResult)> ReadValueCompleteCallback
Completion callback for read_value; carries the value or an ErrorDetail.
std::function< void(VoidResult)> WriteValueCompleteCallback
Completion callback for write_value_async; signals success or an ErrorDetail.
std::function< void(BoolResult)> IsNodeInViewCallback
Completion callback for is_node_in_view_async; carries the boolean answer or an ErrorDetail.
std::function< void(VoidResult)> ViewModifyCallback
Completion callback for add_node_to_view_async; signals success or an ErrorDetail.
Functions
Node()=default
~Node()
void get_references_async(GetReferencesCallback callback) const noexcept=0
Retrieves all references of this node.
callback(GetReferencesCallback) - Receives every reference on success, or an ErrorDetail on failure. Runs on an unspecified worker thread; never throws.
void get_references_async(uint32_t max_references, ByteString continuation_token, GetReferencesPageCallback callback) const noexcept
Retrieves a bounded page of references, supporting continuation.
max_references(uint32_t) - Maximum number of references to return in this page; 0 imposes no caller limit.continuation_token(ByteString) - Token from a prior page, or empty to start from the beginning.callback(GetReferencesPageCallback) - Receives the page and a continuation token (empty when exhausted), or an ErrorDetail on failure. Never throws.
void add_reference_async(NodeId type, ExpandedNodeId target, bool isForward, ReferenceModifyCallback callback) noexcept=0
Adds a single reference from this node.
type(NodeId) - ReferenceType NodeId of the new reference.target(ExpandedNodeId) - ExpandedNodeId of the referenced node.isForward(bool) - true for a forward reference, false for an inverse reference.callback(ReferenceModifyCallback) - Signals success or an ErrorDetail on failure. Never throws.
void add_reference_async(const Reference &reference, ReferenceModifyCallback callback) noexcept
Adds a single reference described by a Reference value.
reference(const Reference &) - Reference to add (type, target, and direction).callback(ReferenceModifyCallback) - Signals success or an ErrorDetail on failure. Never throws.
void add_references_async(std::vector< Reference > references, ReferenceModifyCallback callback) noexcept=0
Adds several references in one operation.
references(std::vector< Reference >) - References to add; the vector is consumed.callback(ReferenceModifyCallback) - Signals success or an ErrorDetail on failure. Never throws.
void remove_reference_async(NodeId type, ExpandedNodeId target, bool isForward, ReferenceModifyCallback callback) noexcept=0
Removes a single reference from this node.
type(NodeId) - ReferenceType NodeId of the reference to remove.target(ExpandedNodeId) - ExpandedNodeId of the referenced node.isForward(bool) - true to match a forward reference, false to match an inverse one.callback(ReferenceModifyCallback) - Signals success or an ErrorDetail on failure. Never throws.
void remove_reference_async(const Reference &reference, ReferenceModifyCallback callback) noexcept
Removes a single reference described by a Reference value.
reference(const Reference &) - Reference to remove (type, target, and direction).callback(ReferenceModifyCallback) - Signals success or an ErrorDetail on failure. Never throws.
void remove_references_async(std::vector< Reference > references, ReferenceModifyCallback callback) noexcept=0
Removes several references in one operation.
references(std::vector< Reference >) - References to remove; the vector is consumed.callback(ReferenceModifyCallback) - Signals success or an ErrorDetail on failure. Never throws.
Variant read_attribute(AttributeId attributeId) const =0
Reads an attribute as a Variant in its OPC UA wire form.
attributeId(AttributeId) - Attribute to read.
Returns: The attribute value in wire form, or an empty Variant when unset/inapplicable.
void write_attribute_async(AttributeId attributeId, Variant attributeValue, WriteAttributeCompleteCallback callback)=0
Writes an attribute in its OPC UA wire form, completing asynchronously.
attributeId(AttributeId) - Attribute to write.attributeValue(Variant) - New value in wire form; consumed by the call.callback(WriteAttributeCompleteCallback) - Signals success, or a bad StatusCode carrying any ErrorDetail on failure. Runs on an unspecified worker thread (inline for in-memory); never throws.
void call(const CallMethodRequest &methodToCall, shared_ptr< const MethodCallContext > context, CallMethodCompleteCallback callback) const =0
Invokes a method on this node.
methodToCall(const CallMethodRequest &) - Method NodeId and input arguments.context(shared_ptr< const MethodCallContext >) - Calling session context, or null for direct/internal calls. Held by shared ownership so a handler that completes asynchronously may safely retain it past the synchronous portion of the call.callback(CallMethodCompleteCallback) - Receives the CallResult (output arguments and per-call status). Runs on an unspecified worker thread; never throws.
void read_value(Duration maxAge, bool setSourceTimestamp, const ReadValueId &nodeToRead, ReadValueCompleteCallback callback) const =0
Reads a Variable's live value as a full DataValue (value, status, timestamps).
maxAge(Duration) - Maximum acceptable age of a cached value, in milliseconds; 0 requests the freshest value from the source.setSourceTimestamp(bool) - true to populate the source timestamp on the returned value.nodeToRead(const ReadValueId &) - Identifies the node, attribute, and value range/encoding to read.callback(ReadValueCompleteCallback) - Receives the DataValue on success or an ErrorDetail on failure. Runs on an unspecified worker thread; never throws.
void write_value_async(const WriteValue &nodeToWrite, WriteValueCompleteCallback callback)=0
Writes a Variable's live value.
nodeToWrite(const WriteValue &) - Identifies the node, attribute, and value to write.callback(WriteValueCompleteCallback) - Signals success or an ErrorDetail on failure. Runs on an unspecified worker thread; never throws.
void is_node_in_view_async(NodeId nodeId, IsNodeInViewCallback callback) const noexcept=0
Tests whether a node is a member of this View.
nodeId(NodeId) - Candidate member node.callback(IsNodeInViewCallback) - Receives true/false, or an ErrorDetail on failure. Never throws.
void add_node_to_view_async(NodeId nodeId, ViewModifyCallback callback) noexcept=0
Adds a node to this View's membership.
nodeId(NodeId) - Node to include in the View.callback(ViewModifyCallback) - Signals success or an ErrorDetail on failure. Never throws.
ExternalValueSource * external_value_source() noexcept
Returns this node's external value-source capability, or nullptr when unsupported.
Returns: The ExternalValueSource seam, or nullptr if the implementation does not support runtime value-handler registration.
MethodCallSource * method_call_source() noexcept
Returns this node's method call-source capability, or nullptr when unsupported.
Returns: The MethodCallSource seam, or nullptr if the implementation does not support runtime call-handler registration.
ua::NodeAccessor
class
A typed handle over a single address-space Node.
Wraps a shared owning pointer to the underlying node and exposes its base attributes (NodeId, NodeClass, BrowseName, DisplayName, Description, WriteMask, RolePermissions, AccessRestrictions) plus its reference graph. Derived accessors (VariableAccessor, ObjectAccessor, ...) add the attributes and operations specific to each NodeClass; downcast to one with as.
Attribute getters/setters read and write the held node synchronously on the calling thread. Reference, value, method-call and view operations follow the callback-canonical async pattern and are also offered as blocking sync and try*_sync convenience wrappers (external consumers only - never call the blocking variants from inside the SDK).
Copyable and movable (value-handle semantics): copies share ownership of the same underlying node.
Functions
NodeAccessor(const NodeAccessor &)=default
Copies the handle, sharing ownership of the same underlying node.
NodeAccessor(NodeAccessor &&) noexcept=default
Moves the handle; the source is left wrapping no node.
NodeAccessor & operator=(const NodeAccessor &)=default
Rebinds this handle to share ownership of other's node.
Returns: A reference to this handle.
NodeAccessor & operator=(NodeAccessor &&) noexcept=default
Rebinds this handle to other's node; other is left wrapping no node.
Returns: A reference to this handle.
NodeAccessor(shared_ptr< Node > node)
Constructs an accessor that shares ownership of node.
node(shared_ptr< Node >) - The node to wrap. Must not be null.
~NodeAccessor()=default
Node * operator->() const
Accesses the underlying node's members.
Returns: A non-owning pointer to the wrapped node; never null.
Node & operator*() const
Accesses the underlying node by reference.
Returns: A reference to the wrapped node.
optional< T > as() const
Attempts to view this node through a more specific accessor type.
Returns: The typed accessor, or std::nullopt if the node's class does not match T.
void get_references_async(Node::GetReferencesCallback callback) const noexcept
Retrieves all of the node's references.
callback(Node::GetReferencesCallback) - Receives the outcome: on success the Result holds the References; on failure it carries an ErrorDetail. This overload never throws.
References get_references_sync() const
Retrieves all of the node's references, blocking until complete.
Returns: The node's references.
Result< References > try_get_references_sync() const noexcept
Retrieves all of the node's references, blocking until complete.
Returns: The node's references, or an ErrorDetail on failure. Never throws.
void get_references_async(uint32_t maxReferences, ByteString continuationToken, Node::GetReferencesPageCallback callback) const noexcept
Retrieves a page of the node's references, supporting continuation.
maxReferences(uint32_t) - Maximum number of references to return in this page; 0 means no per-page limit.continuationToken(ByteString) - Token from a prior page's result, or empty to start from the first page.callback(Node::GetReferencesPageCallback) - Receives the outcome: on success the Result holds a Node::ReferencePage (whose continuation token is empty when no further pages remain); on failure it carries an ErrorDetail. This overload never throws.
Node::ReferencePage get_references_sync(uint32_t maxReferences, ByteString continuationToken) const
Retrieves a page of the node's references, blocking until complete.
maxReferences(uint32_t) - Maximum number of references in this page; 0 = no limit.continuationToken(ByteString) - Token from a prior page, or empty to start.
Returns: The reference page.
Node::ReferencesPageResult try_get_references_sync(uint32_t maxReferences, ByteString continuationToken) const noexcept
Retrieves a page of the node's references, blocking until complete.
maxReferences(uint32_t) - Maximum number of references in this page; 0 = no limit.continuationToken(ByteString) - Token from a prior page, or empty to start.
Returns: The reference page, or an ErrorDetail on failure. Never throws.
void get_components_async(Node::GetReferencesCallback callback) const noexcept
Retrieves the node's HasComponent-referenced child nodes.
callback(Node::GetReferencesCallback) - Receives the outcome: on success the Result holds the component References; on failure it carries an ErrorDetail. This overload never throws.
References get_components_sync() const
Retrieves the node's components, blocking until complete.
Returns: The component references.
Result< References > try_get_components_sync() const noexcept
Retrieves the node's components, blocking until complete.
Returns: The component references, or an ErrorDetail on failure. Never throws.
void get_properties_async(Node::GetReferencesCallback callback) const noexcept
Retrieves the node's HasProperty-referenced property nodes.
callback(Node::GetReferencesCallback) - Receives the outcome: on success the Result holds the property References; on failure it carries an ErrorDetail. This overload never throws.
References get_properties_sync() const
Retrieves the node's properties, blocking until complete.
Returns: The property references.
Result< References > try_get_properties_sync() const noexcept
Retrieves the node's properties, blocking until complete.
Returns: The property references, or an ErrorDetail on failure. Never throws.
void add_reference_async(NodeId type, ExpandedNodeId target, bool isForward, Node::ReferenceModifyCallback callback) noexcept
Adds a reference of type type from this node to target.
type(NodeId) - ReferenceType of the new reference.target(ExpandedNodeId) - The reference's target node, possibly in another namespace/server.isForward(bool) - true to add a forward reference, false for an inverse one.callback(Node::ReferenceModifyCallback) - Receives a VoidResult; on failure it carries an ErrorDetail. This overload never throws.
void add_reference_sync(const NodeId &type, const ExpandedNodeId &target, bool isForward=true)
Adds a reference from this node to target, blocking until complete.
type(const NodeId &) - ReferenceType of the new reference.target(const ExpandedNodeId &) - The reference's target node, possibly in another namespace/server.isForward(bool) - true for a forward reference, false for an inverse one.
VoidResult try_add_reference_sync(const NodeId &type, const ExpandedNodeId &target, bool isForward=true) noexcept
Adds a reference from this node to target, blocking until complete.
type(const NodeId &) - ReferenceType of the new reference.target(const ExpandedNodeId &) - The reference's target node, possibly in another namespace/server.isForward(bool) - true for a forward reference, false for an inverse one.
Returns: A VoidResult that carries an ErrorDetail on failure. Never throws.
Adds a reference from this node to a local target, blocking until complete.
type(const NodeId &) - ReferenceType of the new reference.target(const NodeId &) - The reference's local target node.isForward(bool) - true for a forward reference, false for an inverse one.
Adds a reference from this node to a local target, blocking until complete.
type(const NodeId &) - ReferenceType of the new reference.target(const NodeId &) - The reference's local target node.isForward(bool) - true for a forward reference, false for an inverse one.
Returns: A VoidResult that carries an ErrorDetail on failure. Never throws.
Adds a fully specified reference originating from this node.
reference(const Reference &) - The reference (type, target, direction) to add.callback(Node::ReferenceModifyCallback) - Receives a VoidResult; on failure it carries an ErrorDetail. This overload never throws.
void add_reference_sync(const Reference &reference)
Adds a fully specified reference, blocking until complete.
reference(const Reference &) - The reference (type, target, direction) to add.
VoidResult try_add_reference_sync(const Reference &reference) noexcept
Adds a fully specified reference, blocking until complete.
reference(const Reference &) - The reference (type, target, direction) to add.
Returns: A VoidResult that carries an ErrorDetail on failure. Never throws.
Adds multiple references originating from this node in one operation.
references(std::vector< Reference >) - The references to add.callback(Node::ReferenceModifyCallback) - Receives a VoidResult; on failure it carries an ErrorDetail. This overload never throws.
void add_references_sync(std::vector< Reference > references)
Adds multiple references, blocking until complete.
references(std::vector< Reference >) - The references to add.
VoidResult try_add_references_sync(std::vector< Reference > references) noexcept
Adds multiple references, blocking until complete.
references(std::vector< Reference >) - The references to add.
Returns: A VoidResult that carries an ErrorDetail on failure. Never throws.
Adds a reference only if an equivalent one does not already exist.
type(NodeId) - ReferenceType of the reference to add if absent.target(NodeId) - The reference's local target node.isForward(bool) - true for a forward reference, false for an inverse one.callback(Node::ReferenceModifyCallback) - Receives a VoidResult; on failure it carries an ErrorDetail. This overload never throws.
Adds multiple references in one operation, skipping any that already exist.
references(std::vector< Reference >) - The references to add if absent.callback(Node::ReferenceModifyCallback) - Receives a VoidResult; on failure it carries an ErrorDetail. This overload never throws.
Adds a reference if absent, blocking until complete.
type(const NodeId &) - ReferenceType of the reference to add if absent.target(const NodeId &) - The reference's local target node.isForward(bool) - true for a forward reference, false for an inverse one.
Adds a reference if absent, blocking until complete.
type(const NodeId &) - ReferenceType of the reference to add if absent.target(const NodeId &) - The reference's local target node.isForward(bool) - true for a forward reference, false for an inverse one.
Returns: A VoidResult that carries an ErrorDetail on failure. Never throws.
void remove_reference_async(NodeId type, ExpandedNodeId target, bool isForward, Node::ReferenceModifyCallback callback) noexcept
Removes the reference of type type from this node to target.
type(NodeId) - ReferenceType of the reference to remove.target(ExpandedNodeId) - The reference's target node, possibly in another namespace/server.isForward(bool) - true to remove a forward reference, false for an inverse one.callback(Node::ReferenceModifyCallback) - Receives a VoidResult; on failure it carries an ErrorDetail. This overload never throws.
void remove_reference_sync(const NodeId &type, const ExpandedNodeId &target, bool isForward=true)
Removes a reference from this node to target, blocking until complete.
type(const NodeId &) - ReferenceType of the reference to remove.target(const ExpandedNodeId &) - The reference's target node, possibly in another namespace/server.isForward(bool) - true for a forward reference, false for an inverse one.
VoidResult try_remove_reference_sync(const NodeId &type, const ExpandedNodeId &target, bool isForward=true) noexcept
Removes a reference from this node to target, blocking until complete.
type(const NodeId &) - ReferenceType of the reference to remove.target(const ExpandedNodeId &) - The reference's target node, possibly in another namespace/server.isForward(bool) - true for a forward reference, false for an inverse one.
Returns: A VoidResult that carries an ErrorDetail on failure. Never throws.
Removes a reference from this node to a local target, blocking until complete.
type(const NodeId &) - ReferenceType of the reference to remove.target(const NodeId &) - The reference's local target node.isForward(bool) - true for a forward reference, false for an inverse one.
Removes a reference from this node to a local target, blocking until complete.
type(const NodeId &) - ReferenceType of the reference to remove.target(const NodeId &) - The reference's local target node.isForward(bool) - true for a forward reference, false for an inverse one.
Returns: A VoidResult that carries an ErrorDetail on failure. Never throws.
Removes a fully specified reference originating from this node.
reference(const Reference &) - The reference (type, target, direction) to remove.callback(Node::ReferenceModifyCallback) - Receives a VoidResult; on failure it carries an ErrorDetail. This overload never throws.
void remove_reference_sync(const Reference &reference)
Removes a fully specified reference, blocking until complete.
reference(const Reference &) - The reference (type, target, direction) to remove.
VoidResult try_remove_reference_sync(const Reference &reference) noexcept
Removes a fully specified reference, blocking until complete.
reference(const Reference &) - The reference (type, target, direction) to remove.
Returns: A VoidResult that carries an ErrorDetail on failure. Never throws.
Removes multiple references originating from this node in one operation.
references(std::vector< Reference >) - The references to remove.callback(Node::ReferenceModifyCallback) - Receives a VoidResult; on failure it carries an ErrorDetail. This overload never throws.
void remove_references_sync(std::vector< Reference > references)
Removes multiple references, blocking until complete.
references(std::vector< Reference >) - The references to remove.
VoidResult try_remove_references_sync(std::vector< Reference > references) noexcept
Removes multiple references, blocking until complete.
references(std::vector< Reference >) - The references to remove.
Returns: A VoidResult that carries an ErrorDetail on failure. Never throws.
bool is_object() const
Returns true if the node's class is Object.
Returns: true if the node's class is Object.
bool is_object_type() const
Returns true if the node's class is ObjectType.
Returns: true if the node's class is ObjectType.
bool is_data_type() const
Returns true if the node's class is DataType.
Returns: true if the node's class is DataType.
bool is_variable() const
Returns true if the node's class is Variable.
Returns: true if the node's class is Variable.
bool is_variable_type() const
Returns true if the node's class is VariableType.
Returns: true if the node's class is VariableType.
bool is_reference_type() const
Returns true if the node's class is ReferenceType.
Returns: true if the node's class is ReferenceType.
bool is_view() const
Returns true if the node's class is View.
Returns: true if the node's class is View.
bool is_method() const
Returns true if the node's class is Method.
Returns: true if the node's class is Method.
bool is_type() const
Returns true if the node is a type node (DataType, ObjectType, VariableType or ReferenceType).
Returns: true if the node is a DataType, ObjectType, VariableType or ReferenceType.
NodeId get_node_id() const
Returns the node's NodeId.
Returns: The node's NodeId.
NodeClass get_node_class() const
Returns the node's NodeClass.
Returns: The node's NodeClass.
QualifiedName get_browse_name() const
Returns the node's BrowseName.
Returns: The node's BrowseName.
optional< AttributeWriteMask > get_write_mask() const
Returns the node's WriteMask, or std::nullopt if the attribute is not set.
Returns: The node's WriteMask, or std::nullopt when the attribute is not set.
optional< std::vector< RolePermissionType > > get_role_permissions() const
Returns the node's RolePermissions, or std::nullopt if the attribute is not set.
Returns: The node's RolePermissions, or std::nullopt when the attribute is not set.
optional< AccessRestrictionType > get_access_restrictions() const
Returns the node's AccessRestrictions, or std::nullopt if the attribute is not set.
Returns: The node's AccessRestrictions, or std::nullopt when the attribute is not set.
Variant read_attribute(AttributeId attributeId) const
Reads an attribute in its OPC UA wire form (an empty Variant when unset / inapplicable).
attributeId(AttributeId) - Attribute to read.
Returns: The attribute value in wire form, or an empty Variant when unset/inapplicable.
void write_attribute_sync(AttributeId attributeId, Variant attributeValue)
Writes an attribute in its OPC UA wire form, blocking until complete.
attributeId(AttributeId) - Attribute to write.attributeValue(Variant) - New value in wire form; consumed by the call.
VoidResult try_write_attribute_sync(AttributeId attributeId, Variant attributeValue) noexcept
Writes an attribute in its OPC UA wire form, blocking until complete (non-throwing).
attributeId(AttributeId) - Attribute to write.attributeValue(Variant) - New value in wire form; consumed by the call.
Returns: The write outcome; a bad StatusCode (carrying any ErrorDetail) on failure.
void set_browse_name(QualifiedName browseName)
Sets the node's BrowseName.
browseName(QualifiedName) - The BrowseName to set.
void set_display_name(LocalizedText displayName)
Sets the node's DisplayName.
displayName(LocalizedText) - The DisplayName to set.
void set_description(LocalizedText description)
Sets the node's Description.
description(LocalizedText) - The Description to set.
void set_write_mask(optional< AttributeWriteMask > writeMask)
Sets (or clears, with std::nullopt) the node's WriteMask.
writeMask(optional< AttributeWriteMask >) - The WriteMask to set, or std::nullopt to clear the attribute.
void set_role_permissions(optional< std::vector< RolePermissionType > > rolePermissions)
Sets (or clears, with std::nullopt) the node's RolePermissions.
rolePermissions(optional< std::vector< RolePermissionType > >) - The RolePermissions to set, or std::nullopt to clear the attribute.
void set_access_restrictions(optional< AccessRestrictionType > accessRestrictions)
Sets (or clears, with std::nullopt) the node's AccessRestrictions.
accessRestrictions(optional< AccessRestrictionType >) - The AccessRestrictions to set, or std::nullopt to clear the attribute.
bool is_matching_class() const
Returns true if the wrapped node's class matches this accessor type.
Returns: true for NodeAccessor; the derived contract narrows it.
ua::VariableAccessor
class
Accessor for Variable nodes.
A Variable's value is dynamic and possibly externally sourced; it is never a stored attribute. The value is accessed only through the async read_value / write_value family below (each carrying a full DataValue - value, status and timestamps). There is intentionally no get_value() / set_value() here - contrast VariableTypeAccessor, which stores a static default Value.
Functions
bool is_matching_class() const
Returns true if the wrapped node's class is Variable.
Returns: true if the wrapped node's class is Variable.
NodeId get_data_type() const
Returns the variable's DataType NodeId.
Returns: The variable's DataType NodeId.
ValueRank get_value_rank() const
Returns the variable's ValueRank.
Returns: The variable's ValueRank.
optional< std::vector< uint32_t > > get_array_dimensions() const
Returns the variable's ArrayDimensions, or std::nullopt if the attribute is not set.
Returns: The variable's ArrayDimensions, or std::nullopt when the attribute is not set.
void set_data_type(NodeId dataType)
Sets the variable's DataType.
dataType(NodeId) - The DataType NodeId to set.
void set_value_rank(ValueRank valueRank)
Sets the variable's ValueRank.
valueRank(ValueRank) - The ValueRank to set.
void set_array_dimensions(optional< std::vector< uint32_t > > arrayDimensions)
Sets (or clears, with std::nullopt) the variable's ArrayDimensions.
arrayDimensions(optional< std::vector< uint32_t > >) - The ArrayDimensions to set, or std::nullopt to clear the attribute.
AccessLevelType get_access_level() const
Returns the variable's AccessLevel.
Returns: The variable's AccessLevel.
bool get_historizing() const
Returns the variable's Historizing flag.
Returns: The variable's Historizing flag.
optional< Duration > get_minimum_sampling_interval() const
Returns the variable's MinimumSamplingInterval in milliseconds, or std::nullopt if the attribute is not set.
Returns: The MinimumSamplingInterval in milliseconds, or std::nullopt when the attribute is not set.
optional< AccessLevelExType > get_access_level_ex() const
Returns the variable's AccessLevelEx, or std::nullopt if the attribute is not set.
Returns: The variable's AccessLevelEx, or std::nullopt when the attribute is not set.
void set_access_level(const AccessLevelType &accessLevel)
Sets the variable's AccessLevel.
accessLevel(const AccessLevelType &) - The AccessLevel to set.
void set_historizing(bool historizing)
Sets the variable's Historizing flag.
historizing(bool) - The Historizing flag to set.
void set_minimum_sampling_interval(optional< Duration > minimumSamplingInterval)
Sets (or clears, with std::nullopt) the variable's MinimumSamplingInterval (milliseconds).
minimumSamplingInterval(optional< Duration >) - The MinimumSamplingInterval in milliseconds, or std::nullopt to clear the attribute.
void set_access_level_ex(optional< AccessLevelExType > accessLevelEx)
Sets (or clears, with std::nullopt) the variable's AccessLevelEx.
accessLevelEx(optional< AccessLevelExType >) - The AccessLevelEx to set, or std::nullopt to clear the attribute.
void read_value_async(Duration maxAge, bool setSourceTimestamp, const ReadValueId &nodeToRead, Node::ReadValueCompleteCallback callback) const noexcept
Reads the variable's Value attribute.
maxAge(Duration) - Maximum acceptable age of a cached value, in milliseconds; 0 requests the freshest value.setSourceTimestamp(bool) - true to request the source timestamp be populated.nodeToRead(const ReadValueId &) - Identifies the attribute and index range to read.callback(Node::ReadValueCompleteCallback) - Receives the outcome: on success the Result holds the DataValue; on failure it carries an ErrorDetail. This overload never throws.
DataValueResult try_read_value_sync() const noexcept
Reads the variable's Value attribute, blocking until complete.
Returns: The value, or an ErrorDetail on failure. Never throws.
DataValue read_value_sync() const
Reads the variable's Value attribute, blocking until complete.
Returns: The value.
void write_value_async(const WriteValue &nodeToWrite, Node::WriteValueCompleteCallback callback) noexcept
Writes the variable's value from a service-level WriteValue.
nodeToWrite(const WriteValue &) - Identifies the attribute, index range and value to write.callback(Node::WriteValueCompleteCallback) - Receives a VoidResult; on failure it carries an ErrorDetail. This overload never throws.
VoidResult try_write_value_sync(WriteValue writeValue) noexcept
Writes the variable's value from a WriteValue, blocking until complete.
writeValue(WriteValue) - Identifies the attribute, index range and value to write.
Returns: A VoidResult that carries an ErrorDetail on failure. Never throws.
void write_value_sync(WriteValue writeValue)
Writes the variable's value from a WriteValue, blocking until complete.
writeValue(WriteValue) - Identifies the attribute, index range and value to write.
Writes the variable's Value attribute from a DataValue.
value(DataValue) - The value, status and timestamps to write.callback(Node::WriteValueCompleteCallback) - Receives a VoidResult; on failure it carries an ErrorDetail. This overload never throws.
VoidResult try_write_value_sync(DataValue value) noexcept
Writes the variable's Value from a DataValue, blocking until complete.
value(DataValue) - The value, status and timestamps to write.
Returns: A VoidResult that carries an ErrorDetail on failure. Never throws.
void write_value_sync(DataValue value)
Writes the variable's Value from a DataValue, blocking until complete.
value(DataValue) - The value, status and timestamps to write.
Writes the variable's Value from a plain payload, blocking until complete.
value(T) - The value to write.sourceTimestamp(optional< DateTime >) - Optional source timestamp.
Returns: A VoidResult that carries an ErrorDetail on failure. Never throws.
Writes the variable's Value from a plain payload, blocking until complete.
value(T) - The value to write.sourceTimestamp(optional< DateTime >) - Optional source timestamp.
NodeAccessor(const NodeAccessor &)=default
Copies the handle, sharing ownership of the same underlying node.
NodeAccessor(NodeAccessor &&) noexcept=default
Moves the handle; the source is left wrapping no node.
NodeAccessor(shared_ptr< Node > node)
Constructs an accessor that shares ownership of node.
node(shared_ptr< Node >) - The node to wrap. Must not be null.
ua::VariableTypeAccessor
class
Accessor for VariableType nodes.
Unlike a Variable, a VariableType stores a static default DataValue as a plain attribute. This is the only node class for which Value is a stored attribute, so get_value / set_value are synchronous attribute access (distinct from a Variable's live, async value).
Functions
bool is_matching_class() const
Returns true if the wrapped node's class is VariableType.
Returns: true if the wrapped node's class is VariableType.
NodeId get_data_type() const
Returns the variable type's DataType NodeId.
Returns: The variable type's DataType NodeId.
ValueRank get_value_rank() const
Returns the variable type's ValueRank.
Returns: The variable type's ValueRank.
optional< std::vector< uint32_t > > get_array_dimensions() const
Returns the variable type's ArrayDimensions, or std::nullopt if the attribute is not set.
Returns: The variable type's ArrayDimensions, or std::nullopt when the attribute is not set.
void set_data_type(NodeId dataType)
Sets the variable type's DataType.
dataType(NodeId) - The DataType NodeId to set.
void set_value_rank(ValueRank valueRank)
Sets the variable type's ValueRank.
valueRank(ValueRank) - The ValueRank to set.
void set_array_dimensions(optional< std::vector< uint32_t > > arrayDimensions)
Sets (or clears, with std::nullopt) the variable type's ArrayDimensions.
arrayDimensions(optional< std::vector< uint32_t > >) - The ArrayDimensions to set, or std::nullopt to clear the attribute.
bool get_is_abstract() const
Returns the variable type's IsAbstract flag.
Returns: The variable type's IsAbstract flag.
void set_is_abstract(bool isAbstract)
Sets the variable type's IsAbstract flag.
isAbstract(bool) - The IsAbstract flag to set.
optional< DataValue > get_value() const
Returns the variable type's stored default Value, or std::nullopt if unset.
Returns: The stored default Value, or std::nullopt when unset.
void set_value(optional< DataValue > value)
Sets (or clears, with std::nullopt) the variable type's stored default Value.
value(optional< DataValue >) - The default Value to store, or std::nullopt to clear it.
void set_value(T value, optional< DateTime > sourceTimestamp)
Sets the variable type's stored default Value from a plain payload.
value(T) - The value to store.sourceTimestamp(optional< DateTime >) - Optional source timestamp.
Sets the variable type's stored default Value directly from a DataValue.
value(DataValue) - The value to store; its own timestamps are preserved.sourceTimestamp(optional< DateTime >) - Optional source timestamp applied when set.
Sets the variable type's stored default Value from a Variant.
value(Variant) - The value to store.sourceTimestamp(optional< DateTime >) - Optional source timestamp applied when set.
NodeAccessor(const NodeAccessor &)=default
Copies the handle, sharing ownership of the same underlying node.
NodeAccessor(NodeAccessor &&) noexcept=default
Moves the handle; the source is left wrapping no node.
NodeAccessor(shared_ptr< Node > node)
Constructs an accessor that shares ownership of node.
node(shared_ptr< Node >) - The node to wrap. Must not be null.
ua::MethodAccessor
class
Accessor for Method nodes.
Functions
bool is_matching_class() const
Returns true if the wrapped node's class is Method.
Returns: true if the wrapped node's class is Method.
bool get_executable() const
Returns the method's Executable flag.
Returns: The method's Executable flag.
void set_executable(bool executable)
Sets the method's Executable flag.
executable(bool) - The Executable flag to set.
void call_async(const CallMethodRequest &methodToCall, shared_ptr< const MethodCallContext > context, Node::CallMethodCompleteCallback callback) const noexcept
Invokes the method.
methodToCall(const CallMethodRequest &) - The method's object, method NodeId and input arguments.context(shared_ptr< const MethodCallContext >) - Optional invocation context (session, locale, ...); may be null. Held by shared ownership for the (possibly asynchronous) duration of the call.callback(Node::CallMethodCompleteCallback) - Receives the outcome: on success the Result holds the CallMethodResult; on failure it carries an ErrorDetail. This overload never throws.
CallResult try_call_sync(const CallMethodRequest &methodToCall) const noexcept
Invokes the method, blocking until complete.
methodToCall(const CallMethodRequest &) - The method's object, method NodeId and input arguments.
Returns: The call result, or an ErrorDetail on failure. Never throws.
CallMethodResult call_sync(const CallMethodRequest &methodToCall) const
Invokes the method, blocking until complete.
methodToCall(const CallMethodRequest &) - The method's object, method NodeId and input arguments.
Returns: The call result.
NodeAccessor(const NodeAccessor &)=default
Copies the handle, sharing ownership of the same underlying node.
NodeAccessor(NodeAccessor &&) noexcept=default
Moves the handle; the source is left wrapping no node.
NodeAccessor(shared_ptr< Node > node)
Constructs an accessor that shares ownership of node.
node(shared_ptr< Node >) - The node to wrap. Must not be null.
ua::ObjectAccessor
class
Accessor for Object nodes.
Functions
bool is_matching_class() const
Returns true if the wrapped node's class is Object.
Returns: true if the wrapped node's class is Object.
EventNotifierType get_event_notifier() const
Returns the object's EventNotifier bit mask.
Returns: The object's EventNotifier bit mask.
void set_event_notifier(const EventNotifierType &eventNotifier)
Sets the object's EventNotifier bit mask.
eventNotifier(const EventNotifierType &) - The EventNotifier bit mask to set.
NodeAccessor(const NodeAccessor &)=default
Copies the handle, sharing ownership of the same underlying node.
NodeAccessor(NodeAccessor &&) noexcept=default
Moves the handle; the source is left wrapping no node.
NodeAccessor(shared_ptr< Node > node)
Constructs an accessor that shares ownership of node.
node(shared_ptr< Node >) - The node to wrap. Must not be null.
ua::DataTypeAccessor
class
Accessor for DataType nodes.
Functions
bool is_matching_class() const
Returns true if the wrapped node's class is DataType.
Returns: true if the wrapped node's class is DataType.
bool get_is_abstract() const
Returns the data type's IsAbstract flag.
Returns: The data type's IsAbstract flag.
void set_is_abstract(bool isAbstract)
Sets the data type's IsAbstract flag.
isAbstract(bool) - The IsAbstract flag to set.
shared_ptr< const DataTypeDefinition > get_data_type_definition() const
Returns the data type's structure/enum definition, or null if none is set.
Returns: The data type's structure/enum definition, or null when none is set.
void set_data_type_definition(shared_ptr< const DataTypeDefinition > dataTypeDefinition)
Sets (or clears, with null) the data type's structure/enum definition.
dataTypeDefinition(shared_ptr< const DataTypeDefinition >) - The structure/enum definition to set, or null to clear it.
NodeAccessor(const NodeAccessor &)=default
Copies the handle, sharing ownership of the same underlying node.
NodeAccessor(NodeAccessor &&) noexcept=default
Moves the handle; the source is left wrapping no node.
NodeAccessor(shared_ptr< Node > node)
Constructs an accessor that shares ownership of node.
node(shared_ptr< Node >) - The node to wrap. Must not be null.
ua::ObjectTypeAccessor
class
Accessor for ObjectType nodes.
Functions
bool is_matching_class() const
Returns true if the wrapped node's class is ObjectType.
Returns: true if the wrapped node's class is ObjectType.
bool get_is_abstract() const
Returns the object type's IsAbstract flag.
Returns: The object type's IsAbstract flag.
void set_is_abstract(bool isAbstract)
Sets the object type's IsAbstract flag.
isAbstract(bool) - The IsAbstract flag to set.
NodeAccessor(const NodeAccessor &)=default
Copies the handle, sharing ownership of the same underlying node.
NodeAccessor(NodeAccessor &&) noexcept=default
Moves the handle; the source is left wrapping no node.
NodeAccessor(shared_ptr< Node > node)
Constructs an accessor that shares ownership of node.
node(shared_ptr< Node >) - The node to wrap. Must not be null.
ua::ReferenceTypeAccessor
class
Accessor for ReferenceType nodes.
Functions
bool is_matching_class() const
Returns true if the wrapped node's class is ReferenceType.
Returns: true if the wrapped node's class is ReferenceType.
bool get_is_abstract() const
Returns the reference type's IsAbstract flag.
Returns: The reference type's IsAbstract flag.
void set_is_abstract(bool isAbstract)
Sets the reference type's IsAbstract flag.
isAbstract(bool) - The IsAbstract flag to set.
bool get_symmetric() const
Returns the reference type's Symmetric flag.
Returns: The reference type's Symmetric flag.
void set_symmetric(bool isSymmetric)
Sets the reference type's Symmetric flag.
isSymmetric(bool) - The Symmetric flag to set.
void set_inverse_name(LocalizedText inverseName)
Sets the reference type's InverseName.
inverseName(LocalizedText) - The InverseName to set.
NodeAccessor(const NodeAccessor &)=default
Copies the handle, sharing ownership of the same underlying node.
NodeAccessor(NodeAccessor &&) noexcept=default
Moves the handle; the source is left wrapping no node.
NodeAccessor(shared_ptr< Node > node)
Constructs an accessor that shares ownership of node.
node(shared_ptr< Node >) - The node to wrap. Must not be null.
ua::ViewAccessor
class
Accessor for View nodes.
Functions
bool is_matching_class() const
Returns true if the wrapped node's class is View.
Returns: true if the wrapped node's class is View.
EventNotifierType get_event_notifier() const
Returns the view's EventNotifier bit mask.
Returns: The view's EventNotifier bit mask.
void set_event_notifier(const EventNotifierType &eventNotifier)
Sets the view's EventNotifier bit mask.
eventNotifier(const EventNotifierType &) - The EventNotifier bit mask to set.
bool get_contains_no_loops() const
Returns the view's ContainsNoLoops flag.
Returns: The view's ContainsNoLoops flag.
void set_contains_no_loops(bool containsNoLoops)
Sets the view's ContainsNoLoops flag.
containsNoLoops(bool) - The ContainsNoLoops flag to set.
Tests whether nodeId is a member of this view.
nodeId(NodeId) - The node to test for membership.callback(Node::IsNodeInViewCallback) - Receives the outcome: on success the Result holds the membership boolean; on failure it carries an ErrorDetail. This overload never throws.
bool is_node_in_view_sync(const NodeId &nodeId) const
Tests view membership of nodeId, blocking until complete.
nodeId(const NodeId &) - The node to test for membership.
Returns: true if the node is in the view.
BoolResult try_is_node_in_view_sync(const NodeId &nodeId) const noexcept
Tests view membership of nodeId, blocking until complete.
nodeId(const NodeId &) - The node to test for membership.
Returns: true if the node is in the view, or an ErrorDetail on failure. Never throws.
Adds nodeId as a member of this view.
nodeId(NodeId) - The node to add to the view.callback(Node::ViewModifyCallback) - Receives a VoidResult; on failure it carries an ErrorDetail. This overload never throws.
void add_node_to_view_sync(const NodeId &nodeId)
Adds nodeId to this view, blocking until complete.
nodeId(const NodeId &) - The node to add to the view.
VoidResult try_add_node_to_view_sync(const NodeId &nodeId) noexcept
Adds nodeId to this view, blocking until complete.
nodeId(const NodeId &) - The node to add to the view.
Returns: A VoidResult that carries an ErrorDetail on failure. Never throws.
NodeAccessor(const NodeAccessor &)=default
Copies the handle, sharing ownership of the same underlying node.
NodeAccessor(NodeAccessor &&) noexcept=default
Moves the handle; the source is left wrapping no node.
NodeAccessor(shared_ptr< Node > node)
Constructs an accessor that shares ownership of node.
node(shared_ptr< Node >) - The node to wrap. Must not be null.
ua::node_utils::NodeIdPairHash
struct
Hash functor for an ordered pair of NodeId values.
Combines the two element hashes into a single bucket index so that (refTypeId, typeId) keys can be stored in an unordered container.
Functions
Returns a combined hash of the pair's two NodeId elements.
pair(const std::pair< NodeId, NodeId > &) - The (first, second) NodeId pair to hash; order is significant.
Returns: A bucket-index hash mixing both element hashes.
ua::node_utils::RefTypeCache
class
Internally-synchronised memoisation cache for reference-type subtype checks.
Keyed on (refTypeId, typeId) with the cached is-subtype-of result. is_ref_of_type_cached_async looks the key up on the caller's executor but, on a miss, stores the walk's result from the walk's completion which runs on a DIFFERENT executor (the address-space pool, not the caller's strand). With concurrent operations sharing one cache, a find on one executor races an emplace on another, so the map must be synchronised (concurrent std::unordered_map access is UB - rehash/iterator corruption). Held via std::shared_ptr and captured BY VALUE into the async walk so the cache outlives any in-flight walk even if the owning service/AddressSpace is destroyed mid-walk (otherwise a use-after-free). lookup/store release the lock before returning so callers never invoke a continuation under it.
Functions
Returns the cached result for key, or nullopt if not yet memoised.
key(const std::pair< NodeId, NodeId > &) - The (refTypeId, typeId) pair to look up.
Returns: The memoised is-subtype-of result, or std::nullopt when the key is not cached.
Memoises value for key (first writer wins; concurrent stores of the same key are idempotent).
key(const std::pair< NodeId, NodeId > &) - The (refTypeId, typeId) pair to memoise.value(bool) - The is-subtype-of result to cache for key.
ua::Reference
class
A directed, typed edge between two nodes in the address space.
A reference connects a source node to a target node via a reference type (e.g. HasComponent, Organizes) and records the direction in which the edge is traversed. The source node is implied by the context that owns the reference; only the reference type, the target, and the direction are stored.
Functions
Reference()=default
Constructs an empty reference with default type and target and a forward direction.
Reference(NodeId type, ExpandedNodeId target, bool isForward, std::optional< LocalizedText > targetDisplayName=std::nullopt)
Constructs a reference of the given type to the given target.
type(NodeId) - Reference-type node id (e.g. HasComponent).target(ExpandedNodeId) - Target node, which may be local or remote.isForward(bool) - true for a forward edge from source to target; false for the inverse edge.targetDisplayName(std::optional< LocalizedText >) - DisplayName supplied by the authority for a remote target. Local targets normally omit it because Browse resolves their attributes.
bool operator==(const Reference &other) const
Compares two references for equality of type, target, and direction.
other(const Reference &) - The reference to compare against.
Returns: true if both references have the same type, target, and direction.
bool is_forward() const
Returns true if this is a forward edge, false if it is the inverse edge.
Returns: true for a forward edge from source to target; false for the inverse edge.
bool is_remote() const
Returns true if the target lives in a remote server or namespace.
Returns: true if the target has a non-zero server index (a remote server/namespace).
const NodeId & type_id() const
Returns the reference-type node id (e.g.
Returns: The reference-type node id.
const ExpandedNodeId & target_id() const
Returns the target the reference points to.
Returns: The reference's target node.
const std::optional< LocalizedText > & target_display_name() const
Returns authority-supplied DisplayName metadata for the target, when available.
Returns: The target DisplayName, or std::nullopt when none was supplied.
ua::References
class
A zero-copy, immutable collection of references over shared storage.
The references are held in a shared_ptr<const std::vector<Reference>>, so copying a References shares ownership of the underlying storage rather than duplicating it. For in-memory namespaces this points directly at the copy-on-write node storage, so iterating involves no copy. For database/remote namespaces the vector is materialized from query results and owned by the collection. Instances are lightweight value handles and are safe to copy and pass across threads.
Functions
References()=default
Constructs an empty collection backed by no storage.
References(std::shared_ptr< const std::vector< Reference > > storage)
Constructs a view that shares ownership of existing reference storage.
storage(std::shared_ptr< const std::vector< Reference > >) - Shared, immutable reference storage to view.
References(std::vector< Reference > owned)
Constructs a collection that takes ownership of a newly-built vector.
owned(std::vector< Reference >) - Reference vector to adopt as the backing storage.
References slice(uint32_t offset, uint32_t count) const
Returns a sub-range view that shares the same backing storage.
offset(uint32_t) - Index of the first reference to include, from the start of this collection's window.count(uint32_t) - Number of references to include.
Returns: A collection viewing references in [offset, offset + count).
std::span< const Reference > span() const
Returns a contiguous, non-owning view of the references in this collection.
Returns: A span over the references in this collection's window.
auto begin() const
Returns an iterator to the first reference.
Returns: An iterator to the first reference, or the end iterator when empty.
auto end() const
Returns an iterator one past the last reference.
Returns: An iterator one past the last reference.
bool empty() const
Returns true if the collection holds no references.
Returns: true when the collection has no backing storage or an empty window.
size_t size() const
Returns the number of references in the collection.
Returns: The number of references in this collection's window.
ua::role_permissions::MergedPermissions
struct
Outcome of merging a node's RolePermissions against the Roles an identity holds.
The flag is what separates "the node grants these Roles nothing" from "the node carries no RolePermissions at all", which take different fallback paths.
Public attributes
PermissionType mPermissions
Every PermissionType bit OR-merged across the entries whose Role the identity holds.
bool mHadAny
true iff at least one RolePermissions entry was present; false distinguishes "nothing granted" from "no RolePermissions present".
ua::SemanticChangeSource
class
Optional namespace capability for SemanticsChanged delivery (CTT Data Access Analog 008).
When a semantic property of a data item changes - e.g. an AnalogItem's EURange, which changes what the value means without changing the value itself - every client subscribed to the data item's Value must receive one data-change whose StatusCode carries the SemanticsChanged bit, even through a deadband. A namespace that owns such values implements this capability to observe the property write and signal the value's monitors.
This is queried via Namespace::semantic_change_source() and may be null: a namespace whose upstream already sets the bit (remote/gateway proxies) or that does not track semantics simply returns nullptr, and the SDK does nothing - the bit, if any, rides the normal sample path.
The seam is identifier-based by design: callers (e.g. the generated instance-handle helpers via instance_utils) pass NodeIds and never touch a namespace's concrete node types. Resolving those identifiers to nodes and installing whatever write-observation mechanism the namespace uses is entirely the implementation's concern.
Functions
SemanticChangeSource()=default
~SemanticChangeSource()=default
Registers that writes to the semantic property propertyNodeId change the semantics of dataItemNodeId's Value.
propertyNodeId(const NodeId &) - Semantic property whose writes redefine the data item's Value meaning.dataItemNodeId(const NodeId &) - Data item whose Value monitors are signalled when the property is written.
void report_semantics_changed(const NodeId &dataItemNodeId)=0
Reports that the semantics of dataItemNodeId's Value changed now: every monitor of that Value receives one data-change carrying the SemanticsChanged bit.
dataItemNodeId(const NodeId &) - Data item whose Value monitors receive the SemanticsChanged data-change.
ua::ServerArray
class
Maps server indices to server application URIs for the address space.
Backs the standard Server.ServerArray variable: each entry is a server application URI, and its position is the server index used by ExpandedNodeId and AddReferencesItem.TargetServerUri to name a remote server. Index 0 is reserved for the local server's own URI, which is added when the address space is initialised.
URIs are unique within the array; a URI's index is assigned on insertion and never changes. Access is thread-safe - the array is internally synchronised and every method may be called concurrently from any thread.
Functions
uint32_t get_server_index(string_view uri) const
Returns the index of a registered server URI.
uri(string_view) - Server application URI to look up.
Returns: The index at which uri is registered.
String get_server_uri(uint32_t index) const
Returns the server URI registered at an index.
index(uint32_t) - Server index, in the range [0, size()).
Returns: The server application URI at index.
uint32_t add_server_uri(string_view uri)
Registers a server URI and returns its index.
uri(string_view) - Server application URI to register; must not already be present.
Returns: The index assigned to uri.
Returns a snapshot of all registered server URIs in index order.
Returns: An array whose element at position i is the URI for server index i; this is the value of the Server.ServerArray node.
ua::EventSink
class
Sink that accepts OPC UA events for routing into the server's event pipeline.
Implementations are thread-safe: an event may be submitted from any thread, and the implementation posts it to an internal strand for routing and dispatch to subscribers. A reference to a sink is handed to each namespace (via its namespace context) so that proxy namespaces can inject events originating in external systems.
Functions
EventSink()=default
void emit(BaseEvent &event)=0
Submits an event for delivery through the server's event pipeline.
event(BaseEvent &) - Event to emit. Borrowed for the duration of the call only and not retained; the implementation may mutate the auto-filled fields described above. The caller retains ownership.
~EventSink()=default
Destroys the sink. Virtual to allow destruction through this interface.
ua::SampleSink
class
Batch delivery interface through which a namespace pushes sampled values into a subscription.
One SampleSink exists per Subscription and is shared (via shared_ptr) across all monitored items of that subscription, regardless of which namespace owns the source nodes. The namespace accumulates samples internally and posts them in batches at whatever granularity it chooses (per sampling tick, per event cycle, etc.), rather than one call per sample.
All methods are thread-safe and callable from any thread; implementations must not block the caller. The sink is held by shared_ptr, so it remains alive for the duration of any in-flight call even if the subscription is concurrently torn down.
Functions
SampleSink()=default
~SampleSink()=default
Posts a batch of sampled values into the subscription.
samples(std::vector< std::pair< IntegerId, DataValue > >) - Sampled values to deliver, each as (monitoredItemId, DataValue).
void invalidate(IntegerId monitoredItemId, StatusCode reason)=0
Reports that a monitored item's source node was deleted or became unavailable.
monitoredItemId(IntegerId) - Item whose source is no longer sampleable.reason(StatusCode) - Status code describing why the source became unavailable.
void mark_semantics_changed(IntegerId monitoredItemId)
Reports that a semantic property of a monitored item's value changed.
monitoredItemId(IntegerId) - Item whose value semantics changed.
void detach()=0
Disconnects the namespace from this sink.
ua::FiniteStateVariableState
struct
Snapshot of a FiniteStateMachine's CurrentState for an event payload.
Carries the two fields a client selects via an EventFilter on a state-machine component (e.g. ExclusiveLimitAlarmType's LimitState): the CurrentState Value (the human-readable state name, a LocalizedText) and its Id property (the NodeId of the active state). Mirrors TwoStateVariableState but for a FiniteStateVariableType, whose Id is a NodeId rather than a boolean.
Public attributes
LocalizedText currentState
CurrentState Value: the active state's display name.
NodeId id
CurrentState.Id: the NodeId of the active state.
ua::ConditionVariableState
struct
Snapshot of a ConditionVariableType instance's state for event field resolution.
Used as a compound field in generated condition event structs. Holds the current value and the source timestamp of that value, mirroring the Value attribute and its SourceTimestamp on a ConditionVariableType instance.
Public attributes
Variant value
Current value of the condition variable.
DateTime sourceTimestamp
Source timestamp of value.
ua::TwoStateVariableState
struct
Snapshot of a TwoStateVariableType instance's state for event field resolution.
Used as a compound field in generated condition event structs. Mirrors the Id and EffectiveDisplayName (CurrentState) of a TwoStateVariableType instance together with the timestamp of the last state transition.
Public attributes
bool id
Current boolean state: the Id property of the TwoStateVariableType.
LocalizedText currentState
Display text for the active state, e.g. "Enabled"/"Disabled".
DateTime transitionTime
Timestamp of the most recent transition of id.
Enumerations
ua::NodeReleaseStatus
enum
A node's <ReleaseStatus> annotation.
Released- The node is released for production use.Draft- The node is provisional; skipped by the default import filter.Deprecated- The node is deprecated; skipped by the default import filter.
ua::instance_utils::ValueQualityPolicy
enum
Which layer reports a bad VALUE quality: the Result, or the DataValue inside it.
PreserveQuality- Two-layer, and the model the rest of the SDK and the documentation use: the read SUCCEEDS and the bad quality rides on DataValue::status().FlattenBadQuality- Single-layer: a Bad-severity DataValue::status() is surfaced AS a bad Result carrying a BadVariableStatus ErrorDetail, and no DataValue is handed back.
Type aliases
ua::EffectivePermissionsResult
type alias
using EffectivePermissionsResult = BatchResult< Result< PermissionType > >;
Result returned by Namespace::effective_permissions_async.
ua::EffectivePermissionsCallback
type alias
using EffectivePermissionsCallback = std::function< void(EffectivePermissionsResult)>;
Completion of Namespace::effective_permissions_async.
ua::MonitoringHandle
type alias
using MonitoringHandle = uint32_t;
Opaque handle that identifies one monitoring registration within a namespace.
ua::role_permissions::RoleGrantPredicate
type alias
using RoleGrantPredicate = std::function< bool(const NodeId &)>;
Tests whether a Role is one of those granted.

