1 #ifndef __XRDSYSIOEVENTS_HH__
2 #define __XRDSYSIOEVENTS_HH__
35 #include <sys/types.h>
131 virtual void Fatal(
Channel *chP,
void *cbArg,
int eNum,
const char *eTxt)
133 (void)chP; (void)cbArg; (void)eNum; (void)eTxt;
146 virtual void Stop(
Channel *chP,
void *cbArg) { (void)chP; (void)cbArg;}
212 bool Disable(
int events,
const char **eText=0);
248 bool Enable(
int events,
int timeout=0,
const char **eText=0);
267 inline int GetEvents() {
return (chPoller ?
static_cast<int>(chEvents) : -1);}
350 enum Status {isClear = 0, isCBMode, isDead};
356 void Reset(
Poller *thePoller,
int fd,
int eNum=0);
400 static Poller *
Create(
int &eNum,
const char **eTxt=0,
int crOpts=0);
436 bool CbkXeq(
Channel *cP,
int events,
int eNum,
const char *eTxt);
440 bool Init(
Channel *cP,
int &eNum,
const char **eTxt,
bool &isLockd);
520 void Detach(
Channel *cP,
bool &isLocked,
bool keep=
true);
526 static Poller *newPoller(
int pFD[2],
int &eNum,
const char **eTxt);
virtual void Fatal(Channel *chP, void *cbArg, int eNum, const char *eTxt)
virtual bool Event(Channel *chP, void *cbArg, int evFlags)=0
virtual ~CallBack()
Destructor.
virtual void Stop(Channel *chP, void *cbArg)
EventType
Events that may cause a callback object to be activated.
@ ReadyToWrite
Writing won't block.
@ ReadyToRead
New data has arrived.
@ ReadTimeOut
Read timeout.
@ WriteTimeOut
Write timeout.
@ ValidEvents
Mask to test for valid events.
void SetCallBack(CallBack *cbP, void *cbArg=0)
void GetCallBack(CallBack **cbP, void **cbArg)
EventCode
Event bits used to feed Enable() and Disable(); can be or'd.
@ allEvents
All of the above.
@ errorEvents
Error event non-r/w specific.
@ stopEvent
Poller stop event.
@ writeEvents
Write and Write Timeouts.
@ rwEvents
Both of the above.
@ readEvents
Read and Read Timeouts.
bool Enable(int events, int timeout=0, const char **eText=0)
Channel(Poller *pollP, int fd, CallBack *cbP=0, void *cbArg=0)
bool Disable(int events, const char **eText=0)
virtual bool Modify(Channel *cP, int &eNum, const char **eTxt, bool &isLocked)=0
virtual bool Include(Channel *cP, int &eNum, const char **eTxt, bool &isLocked)=0
int GetFault(Channel *cP)
void LockChannel(Channel *cP)
int GetPollEnt(Channel *cP)
CPP_ATOMIC_TYPE(bool) wakePend
static Poller * Create(int &eNum, const char **eTxt=0, int crOpts=0)
virtual void Begin(XrdSysSemaphore *syncp, int &rc, const char **eTxt)=0
bool CbkXeq(Channel *cP, int events, int eNum, const char *eTxt)
virtual ~Poller()
Destructor. Stop() is effecively called when this object is deleted.
int SendCmd(PipeData &cmd)
void UnLockChannel(Channel *cP)
virtual void Shutdown()=0
int Poll2Enum(short events)
virtual void Exclude(Channel *cP, bool &isLocked, bool dover=1)=0
bool TmoAdd(Channel *cP, int tmoSet)
void SetPollEnt(Channel *cP, int ptEnt)
bool Init(Channel *cP, int &eNum, const char **eTxt, bool &isLockd)
PipeData(char reQ=0, char evT=0, short enT=0, int fD=0, XrdSysSemaphore *sP=0)