Class OpcuaPoller

Class Documentation

class OpcuaPoller

Manages OPC-UA data collection via subscriptions (preferred) or polling.

Public Functions

OpcuaPoller(OpcuaClient &client, const NodeMap &node_map)
~OpcuaPoller()
OpcuaPoller(const OpcuaPoller&) = delete
OpcuaPoller &operator=(const OpcuaPoller&) = delete
void start(const PollerConfig &config)

Start the poller thread.

void stop()

Stop the poller thread.

PollSnapshot snapshot() const

Get current snapshot (thread-safe copy)

std::optional<OpcuaValue> get_value(const std::string &node_id_str) const

Get value for a specific node (thread-safe)

void set_alarm_callback(AlarmChangeCallback callback)

Set callback for alarm state changes.

void set_event_alarm_callback(EventAlarmCallback callback)

Set callback for native AlarmCondition event lifecycle transitions (issue #386). Must be called before start().

void set_poll_callback(PollCallback callback)

Set callback fired after each poll cycle (for value bridging)

inline bool using_subscriptions() const

Check if using subscriptions (vs polling)

std::optional<ConditionRuntime> lookup_condition(const std::string &entity_id, const std::string &fault_code) const

Look up a live condition by (entity_id, fault_code). Used by the SOVD acknowledge_fault / confirm_fault operation handlers to resolve which OPC-UA ConditionId should receive the Method call. The returned snapshot is a copy, so the caller can release any locks before performing the OPC-UA round-trip.

Returns std::nullopt if no condition with that fault_code is currently active for the entity.