X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FIOEvent.hh;h=0d19eb33b17ae24a213b46b5448e591dc9bf26a1;hb=f2f5d59e83863f3b513950173baee1b6da2aee3c;hp=d2f952819a3fb89806b3ddecef3663066e5b47c7;hpb=1d247d12d1759ffd77f456efe3a52f03dd289994;p=senf.git diff --git a/PPI/IOEvent.hh b/PPI/IOEvent.hh index d2f9528..0d19eb3 100644 --- a/PPI/IOEvent.hh +++ b/PPI/IOEvent.hh @@ -23,8 +23,8 @@ /** \file \brief IOEvent public header */ -#ifndef HH_IOEvent_ -#define HH_IOEvent_ 1 +#ifndef HH_SENF_PPI_IOEvent_ +#define HH_SENF_PPI_IOEvent_ 1 // Custom includes #include "../Scheduler/Scheduler.hh" @@ -77,23 +77,28 @@ namespace ppi { // with the enumeration symbols enum EventFlags { - Read = Scheduler::EV_READ /**< FileHandle is readable */ - , Prio = Scheduler::EV_PRIO /**< FileHandle priority data is readable */ - , Write = Scheduler::EV_WRITE /**< FileHandle is writable */ - , Hup = Scheduler::EV_HUP /**< Hangup condition on FileHandle */ - , Err = Scheduler::EV_ERR /**< Some other error condition on FileHandle */ + Read = scheduler::FdEvent::EV_READ /**< FileHandle is readable */ + , Prio = scheduler::FdEvent::EV_PRIO /**< FileHandle priority data is readable */ + , Write = scheduler::FdEvent::EV_WRITE /**< FileHandle is writable */ + , Hup = scheduler::FdEvent::EV_HUP /**< Hangup condition on FileHandle */ + , Err = scheduler::FdEvent::EV_ERR /**< Some other error condition on FileHandle */ }; /////////////////////////////////////////////////////////////////////////// ///\name Structors and default members ///@{ + IOEvent(); + template IOEvent(Handle handle, unsigned events); ///@} /////////////////////////////////////////////////////////////////////////// + template + void set(Handle handle, unsigned events); + /** \brief Unhandled error condition */ struct ErrorException : public senf::Exception { ErrorException() : senf::Exception("senf::ppi::IOEvent::ErrorException"){} }; @@ -106,20 +111,20 @@ namespace ppi { private: virtual void v_enable(); - virtual void v_disable(); + virtual void v_disable(); - void cb(Scheduler::EventId event); + void cb(int event); int fd_; - unsigned events_; + scheduler::FdEvent event_; }; }} ///////////////////////////////hh.e//////////////////////////////////////// -//#include "IOEvent.cci" -//#include "IOEvent.ct" +#include "IOEvent.cci" +#include "IOEvent.ct" #include "IOEvent.cti" #endif