XrdSys::IOEvents::CallBack Class Reference

#include <XrdSysIOEvents.hh>

List of all members.

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

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

XrdSys::IOEvents::CallBack::CallBack (  )  [inline]

Constructor.

virtual XrdSys::IOEvents::CallBack::~CallBack (  )  [inline, virtual]

Destructor.


Member Function Documentation

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

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 15 Jul 2019 for xrootd by  doxygen 1.6.1