xentara-plugin v1.2.1
The Xentara Plugin Framework
Loading...
Searching...
No Matches
xentara::process::Event Class Referencefinal

An event provided by a plugin. More...

#include <process/Event.hpp>

+ Inheritance diagram for xentara::process::Event:

Public Member Functions

 Event ()=default
 Constructor for a regular event.
 
 Event (const model::Attribute &attribute)
 Constructor for an attribute change event.
 
 Event (const model::Attribute::Role &attributeRole)
 Constructor for an attribute change event.
 
 Event (io::Directions ioDirections)
 Constructor for an I/O event.
 
internal auto ioDirections () const -> io::Directions
 Gets the relevant I/O directions.
 
auto setIoDirections (io::Directions ioDirections) -> void
 Sets the relevant I/O directions.
 
auto fire (std::chrono::system_clock::time_point eventTime=std::chrono::system_clock::now()) const -> void
 You must call this function to fire the event.
 
- Public Member Functions inherited from xentara::utils::tools::DisableCopy
constexpr DisableCopy () noexcept=default
 
 DisableCopy (const DisableCopy &)=delete
 
DisableCopyoperator= (const DisableCopy &)=delete
 

Static Public Attributes

Standard Names
static const std::string_view kChanged
 The standard name for the change event of an I/O or data point.
 
static const std::string_view kConnected
 The standard name for the connection event of an I/O component.
 
static const std::string_view kDisconnected
 The standard name for the disconnection event of an I/O component.
 

Detailed Description

An event provided by a plugin.

See also
Publishing Tasks
Events in the Xentara user manual

Constructor & Destructor Documentation

◆ Event() [1/4]

xentara::process::Event::Event ( )
default

Constructor for a regular event.

◆ Event() [2/4]

xentara::process::Event::Event ( const model::Attribute attribute)

Constructor for an attribute change event.

This constructor marks this event as the change event for a particular attribute. If the attribute is an I/O attribute, then the event is automatically marked as an I/O event.

Attention
The event is not automatically fired when the attribute's value changes. You must fire the event manually when you change the attribute's value.
Parameters
attributeThe attribute whose change this event signals.

◆ Event() [3/4]

xentara::process::Event::Event ( const model::Attribute::Role attributeRole)

Constructor for an attribute change event.

This constructor marks this event as the change event for an attribute with a particular role. If the role is a role for an I/O attribute, then the event is automatically marked as an I/O event.

Attention
The event is not automatically fired when the value of the attribute with the given role changes. You must fire the event manually when you change the attribute's value.
Parameters
attributeRoleThe attribute whose change this event signals.

◆ Event() [4/4]

xentara::process::Event::Event ( io::Directions  ioDirections)

Constructor for an I/O event.

Parameters
ioDirectionsThe relevant I/O directions.

The I/O directions are used for I/O events to specify whether a data point should inherit this event from its I/O points. If the directions contain the flag io::Direction::Input, then the data point will inherit this event from its input I/O point. If the directions contain the flag io::Direction::Output, then the data point will inherit this event from its output I/O point. If you do not set either flag (the default), then the event will not be considered an I/O event and will not be inherited. This is equivalent to calling the default constructor.

Member Function Documentation

◆ fire()

auto xentara::process::Event::fire ( std::chrono::system_clock::time_point  eventTime = std::chrono::system_clock::now()) const -> void

You must call this function to fire the event.

This function fires the event asynchronously and returns immediately.

Parameters
eventTimeThe (canonical) time the event occurred

◆ ioDirections()

internal auto xentara::process::Event::ioDirections ( ) const -> io::Directions

Gets the relevant I/O directions.

Returns
The I/O directions. The I/O directions are used for I/O events to specify whether a data point should inherit this event from its I/O points.

◆ setIoDirections()

auto xentara::process::Event::setIoDirections ( io::Directions  ioDirections) -> void

Sets the relevant I/O directions.

Parameters
ioDirectionsThe desired I/O directions. The I/O directions are used for I/O events to specify whether a data point should inherit this event from its I/O points.

Member Data Documentation

◆ kChanged

const std::string_view xentara::process::Event::kChanged
static

The standard name for the change event of an I/O or data point.

◆ kConnected

const std::string_view xentara::process::Event::kConnected
static

The standard name for the connection event of an I/O component.

◆ kDisconnected

const std::string_view xentara::process::Event::kDisconnected
static

The standard name for the disconnection event of an I/O component.