xrootd
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
XrdSys::IOEvents::CallBack Class Referenceabstract

#include <XrdSysIOEvents.hh>

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

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)
 
 CallBack ()
 Constructor.
 
virtual ~CallBack ()
 Destructor.
 

Member Enumeration Documentation

◆ 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.

Constructor & Destructor Documentation

◆ CallBack()

XrdSys::IOEvents::CallBack::CallBack ( )
inline

Constructor.

◆ ~CallBack()

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

Destructor.

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
chPthe associated channel causing the callback.
cbArgthe callback argument specified for the channel.
evFlagsevents 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.

◆ Fatal()

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

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
chPthe associated channel causing the callback.
cbArgthe callback argument specified for the channel.
eNumthe errno associated with the error.
eTxtdescriptive name of the operation encountering the error.

◆ Stop()

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

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
chPthe associated channel causing the callback.
cbArgthe callback argument specified for the channel.

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