X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FIOEvent.hh;h=7b3bf481885fe9f9248abd8c1611932c5695ced6;hb=92f8630b75f3ef50e73c48cde58645dcd1534e27;hp=5a3e18881c0abbb8b5913660c5dafbc4642045f7;hpb=a1a6c76a214ad1935032826713cabaf9ac57bf07;p=senf.git diff --git a/PPI/IOEvent.hh b/PPI/IOEvent.hh index 5a3e188..7b3bf48 100644 --- a/PPI/IOEvent.hh +++ b/PPI/IOEvent.hh @@ -23,12 +23,13 @@ /** \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" #include "Events.hh" +#include "../Utils/Exception.hh" //#include "IOEvent.mpp" ///////////////////////////////hh.p//////////////////////////////////////// @@ -76,11 +77,11 @@ 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 */ }; /////////////////////////////////////////////////////////////////////////// @@ -94,25 +95,23 @@ namespace ppi { /////////////////////////////////////////////////////////////////////////// /** \brief Unhandled error condition */ - struct ErrorException : public std::exception - { virtual char const * what() const throw() - { return "senf::ppi::IOEvent::ErrorException"; } }; + struct ErrorException : public senf::Exception + { ErrorException() : senf::Exception("senf::ppi::IOEvent::ErrorException"){} }; /** \brief Unhandled hangup condition */ - struct HangupException : public std::exception - { virtual char const * what() const throw() - { return "senf::ppi::IOEvent::HangupException"; } }; + struct HangupException : public senf::Exception + { HangupException() : senf::Exception("senf::ppi::IOEvent::HangupException"){} }; protected: 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_; };