PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
Loading...
Searching...
No Matches
profinet::IAlarmListener Class Referenceabstract

Abstract interface for receiving PROFINET alarm notifications. More...

#include <IAlarmListener.h>

+ Inheritance diagram for profinet::IAlarmListener:
+ Collaboration diagram for profinet::IAlarmListener:

Public Member Functions

virtual ~IAlarmListener ()=default
 Virtual destructor.
 
virtual void AddCallback (std::function< void(const AlarmNotification &)> callback)=0
 Registers a callback for received alarm notifications.
 
virtual void RemoveCallback (std::function< void(const AlarmNotification &)> callback)=0
 Remove a registered callback for received alarm notifications.
 
virtual void Start ()=0
 Starts alarm reception.
 
virtual void Stop ()=0
 Stops alarm reception.
 
virtual bool IsRunning () const =0
 Indicates whether the listener is currently running.
 

Detailed Description

Abstract interface for receiving PROFINET alarm notifications.

Provides the minimal interface required by higher-level components such as ProfinetDevice. Implementations are responsible for receiving alarm notifications and invoking registered callbacks.

The interface deliberately does not expose transport-specific details such as Ethernet sockets, UDP sockets, frame parsing, or acknowledgement handling. Those responsibilities remain within the concrete listener.

Note
Implementations must be safe to destroy after Stop() has been called.

Definition at line 30 of file IAlarmListener.h.

Constructor & Destructor Documentation

◆ ~IAlarmListener()

virtual profinet::IAlarmListener::~IAlarmListener ( )
virtualdefault

Virtual destructor.

Allows derived alarm listener implementations to be destroyed safely through an IAlarmListener pointer.

Member Function Documentation

◆ AddCallback()

virtual void profinet::IAlarmListener::AddCallback ( std::function< void(const AlarmNotification &)>  callback)
pure virtual

Registers a callback for received alarm notifications.

Parameters
callbackFunction invoked when an alarm notification is received.

Implemented in profinet::AlarmListener.

◆ IsRunning()

virtual bool profinet::IAlarmListener::IsRunning ( ) const
pure virtual

Indicates whether the listener is currently running.

Returns
True when alarm reception is active; otherwise false.

Implemented in profinet::AlarmListener.

◆ RemoveCallback()

virtual void profinet::IAlarmListener::RemoveCallback ( std::function< void(const AlarmNotification &)>  callback)
pure virtual

Remove a registered callback for received alarm notifications.

Parameters
callbackFunction invoked when an alarm notification is received which needs to be removed.

Implemented in profinet::AlarmListener.

◆ Start()

virtual void profinet::IAlarmListener::Start ( )
pure virtual

Starts alarm reception.

Starts the underlying alarm transport and begins receiving alarm notifications.

Exceptions
std::exceptionDerived implementations may throw when the alarm listener cannot be started.

Implemented in profinet::AlarmListener.

◆ Stop()

virtual void profinet::IAlarmListener::Stop ( )
pure virtual

Stops alarm reception.

Stops receiving alarms and releases the resources associated with the listener.

Implemented in profinet::AlarmListener.


The documentation for this class was generated from the following file: