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

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.

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

Constructor & Destructor Documentation

◆ CallBack()

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

Constructor.

Definition at line 152 of file XrdSysIOEvents.hh.

152 {}

◆ ~CallBack()

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

Destructor.

Definition at line 158 of file XrdSysIOEvents.hh.

158 {}

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.

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

Definition at line 131 of file XrdSysIOEvents.hh.

132 {
133  (void)chP; (void)cbArg; (void)eNum; (void)eTxt;
134 };

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

Definition at line 146 of file XrdSysIOEvents.hh.

146 { (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: