open62541pp 0.16.0
C++ wrapper of open62541
Loading...
Searching...
No Matches
opcua::Event Class Reference

#include <event.hpp>

Detailed Description

Public Member Functions

 Event (Server &connection, const NodeId &eventType=ObjectTypeId::BaseEventType)
 
 ~Event ()
 
 Event (const Event &)=default
 
 Event (Event &&) noexcept=default
 
Eventoperator= (const Event &)=delete
 
Eventoperator= (Event &&) noexcept=delete
 
Serverconnection () noexcept
 
const Serverconnection () const noexcept
 
const NodeIdid () const noexcept
 
EventwriteSourceName (std::string_view sourceName)
 
EventwriteTime (DateTime time)
 
EventwriteSeverity (uint16_t severity)
 
EventwriteMessage (const LocalizedText &message)
 
EventwriteProperty (const QualifiedName &propertyName, const Variant &value)
 
ByteString trigger (const NodeId &originId=ObjectId::Server)
 

Constructor & Destructor Documentation

◆ Event() [1/3]

opcua::Event::Event ( Server & connection,
const NodeId & eventType = ObjectTypeId::BaseEventType )
explicit

Create an event with the underlying (abstract) node representation.

◆ ~Event()

opcua::Event::~Event ( )

Delete the node representation of the event.

◆ Event() [2/3]

opcua::Event::Event ( const Event & )
default

◆ Event() [3/3]

opcua::Event::Event ( Event && )
defaultnoexcept

Member Function Documentation

◆ operator=() [1/2]

Event & opcua::Event::operator= ( const Event & )
delete

◆ operator=() [2/2]

Event & opcua::Event::operator= ( Event && )
deletenoexcept

◆ connection() [1/2]

Server & opcua::Event::connection ( )
inlinenoexcept

Get the server instance.

Definition at line 34 of file event.hpp.

◆ connection() [2/2]

const Server & opcua::Event::connection ( ) const
inlinenoexcept

Get the server instance.

Definition at line 39 of file event.hpp.

◆ id()

const NodeId & opcua::Event::id ( ) const
inlinenoexcept

Get the NodeId of the underlying node representation.

Definition at line 44 of file event.hpp.

◆ writeSourceName()

Event & opcua::Event::writeSourceName ( std::string_view sourceName)

Set the source name (optional).

◆ writeTime()

Event & opcua::Event::writeTime ( DateTime time)

Set the time of the event (UTC).

◆ writeSeverity()

Event & opcua::Event::writeSeverity ( uint16_t severity)

Set the urgency/priority of the event from 1 (lowest) to 1000 (highest).

◆ writeMessage()

Event & opcua::Event::writeMessage ( const LocalizedText & message)

Set a human-readable and localizable text description of the event.

◆ writeProperty()

Event & opcua::Event::writeProperty ( const QualifiedName & propertyName,
const Variant & value )

Set arbitrary properties of the event (for custom event types).

◆ trigger()

ByteString opcua::Event::trigger ( const NodeId & originId = ObjectId::Server)

Trigger the event.

Parameters
originIdOrigin node of the event (requires EventNotifier attribute)
Returns
Unique EventId generated by server