Loading...
Searching...
No Matches
XrdSys::IOEvents::CallBack Class Referenceabstract

`#include <XrdSysIOEvents.hh>`

Collaboration diagram for XrdSys::IOEvents::CallBack:

## Public Types

enum | EventType { ReadyToRead = 0x01 , ReadTimeOut = 0x02 , ReadyToWrite = 0x04 , WriteTimeOut = 0x08 , ValidEvents = 0x0f }
| Events that may cause a callback object to be activated. More...

## Public Member Functions

| CallBack ()
| Constructor.
virtual | ~CallBack ()
| Destructor.
virtual bool | Event (Channel *chP, void *cbArg, int evFlags)=0
virtual void | Fatal (Channel *chP, void *cbArg, int eNum, const char *eTxt)
virtual void | Stop (Channel *chP, void *cbArg)

## Detailed Description

Definition at line 78 of file XrdSysIOEvents.hh.

## Member Enumeration Documentation

## EventType

enum XrdSys::IOEvents::CallBack::EventType

Events that may cause a callback object to be activated.

Enumerator
ReadyToRead | New data has arrived.
ReadTimeOut | Read timeout.
ReadyToWrite | Writing won't block.
WriteTimeOut | Write timeout.
ValidEvents | Mask to test for valid events.

Definition at line 86 of file XrdSysIOEvents.hh.

{
ReadyToRead = 0x01,
ReadTimeOut = 0x02,
ReadyToWrite = 0x04,
WriteTimeOut = 0x08,
ValidEvents = 0x0f
};
XrdSys::IOEvents::CallBack::ReadyToWrite
@ ReadyToWrite
Writing won't block.
Definition XrdSysIOEvents.hh:90
XrdSys::IOEvents::CallBack::ReadyToRead
@ ReadyToRead
New data has arrived.
Definition XrdSysIOEvents.hh:88
XrdSys::IOEvents::CallBack::ReadTimeOut
@ ReadTimeOut
Read timeout.
Definition XrdSysIOEvents.hh:89
XrdSys::IOEvents::CallBack::WriteTimeOut
@ WriteTimeOut
Write timeout.
Definition XrdSysIOEvents.hh:91
XrdSys::IOEvents::CallBack::ValidEvents
@ ValidEvents
Mask to test for valid events.
Definition XrdSysIOEvents.hh:92

## Constructor & Destructor Documentation

## CallBack()

XrdSys::IOEvents::CallBack::CallBack | ( |  | ) |

inline

Constructor.

Definition at line 152 of file XrdSysIOEvents.hh.

{}

## ~CallBack()

virtual XrdSys::IOEvents::CallBack::~CallBack | ( |  | ) |

inline virtual

Destructor.

Definition at line 158 of file XrdSysIOEvents.hh.

{}

## Member Function Documentation

## Event()

virtual bool XrdSys::IOEvents::CallBack::Event | ( | Channel * | chP,
|  | void * | cbArg,
|  | int | evFlags )

pure virtual

Handle event notification. A method must be supplied. The enable/disable status of the channel is not modified. To change the status, use the channel's Enable() and Disable() method prior to returning. After return, the current channel's status is used to determine how it will behave. If the event is a timeout, the timeout becomes infinite for that event unless Enable() is called for the event. This is to prevent timeout loops on channels that remain enabled even after a timeout. Event loop callbacks define a hazardous programming model. If you do not have a well defined threading model, you should restrict yourself to dealing only with the passed channel object in the callback so as to avoid deadlocks.

Parameters

  chP | the associated channel causing the callback.
  cbArg | the callback argument specified for the channel.
  evFlags | events that caused this callback to be invoked. More than one event may be indicated (see EventType above).

Returns
  true Resume handling the channel with current status. false Disable the channel and remove it from associated poller.

Referenced by XrdSys::IOEvents::Poller::CbkXeq().

Here is the caller graph for this function:

## Fatal()

virtual void XrdSys::IOEvents::CallBack::Fatal | ( | Channel * | chP,
|  | void * | cbArg,
|  | int | eNum,
|  | const char * | eTxt )

inline virtual

Handle fatal error notification. This method is called only when error events are specifically enabled (see Enable() for admonitions). It is passed the reason for the error. Upon return, the channel is disabled but stays attached to the poller so that it can be revitalized with SetFD(). You should replace this method if you specifically enable error events.

Parameters

  chP | the associated channel causing the callback.
  cbArg | the callback argument specified for the channel.
  eNum | the errno associated with the error.
  eTxt | descriptive name of the operation encountering the error.

Definition at line 131 of file XrdSysIOEvents.hh.

{
(void)chP; (void)cbArg; (void)eNum; (void)eTxt;
};

Referenced by XrdSys::IOEvents::Poller::CbkXeq().

Here is the caller graph for this function:

## Stop()

virtual void XrdSys::IOEvents::CallBack::Stop | ( | Channel * | chP,
|  | void * | cbArg )

inline virtual

Handle poller stop notification. This method is called only when the poller is stopped and the channel enabled the stop event. You should should replace this method if you specifically enable the stop event. You must not invoke channel methods in this callback, otherwise the results are unpredictable.

Parameters

  chP | the associated channel causing the callback.
  cbArg | the callback argument specified for the channel.

Definition at line 146 of file XrdSysIOEvents.hh.

{ (void)chP; (void)cbArg;}

Referenced by XrdSys::IOEvents::Poller::Stop().

Here is the caller graph for this function:

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

- XrdSysIOEvents.hh