Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
DeviceClosedNotify Class Reference

Notification implementation that sets an external variable to -1 when notified. More...

#include <ClientConnection.hxx>

Inheritance diagram for DeviceClosedNotify:
Notifiable Destructable

Public Member Functions

 DeviceClosedNotify (int *fd, string name)
 Constructor.
 
void notify () override
 Callback from the application when an error is encountered.
 

Private Attributes

int * fd_
 pointer to file descriptor variable.
 
string name_
 info to print to stderr upon error.
 

Detailed Description

Notification implementation that sets an external variable to -1 when notified.

Supplied as an on-error callback to the gridconnect port creation method.

Definition at line 67 of file ClientConnection.hxx.

Constructor & Destructor Documentation

◆ DeviceClosedNotify()

DeviceClosedNotify::DeviceClosedNotify ( int *  fd,
string  name 
)
inline

Constructor.

Parameters
fdpointer to file descriptor variable that will be set to -1 upon error notification.
nameInfo string to print to stderr when the device error causes a close event.

Definition at line 76 of file ClientConnection.hxx.

Member Function Documentation

◆ notify()

void DeviceClosedNotify::notify ( )
inlineoverridevirtual

Callback from the application when an error is encountered.

Implements Notifiable.

Definition at line 82 of file ClientConnection.hxx.

Member Data Documentation

◆ fd_

int* DeviceClosedNotify::fd_
private

pointer to file descriptor variable.

Definition at line 89 of file ClientConnection.hxx.

◆ name_

string DeviceClosedNotify::name_
private

info to print to stderr upon error.

Definition at line 90 of file ClientConnection.hxx.


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