X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FIOEvent.cc;h=7517e41b3a813667eb642976bb5839e810f91954;hb=b89e3166f7680755683dccee5e48cb3a820185c0;hp=abb197496ffb50a6d856b5a5a30c1a45ee3e47ef;hpb=f73fa16ed5abdce272ac77f8b8b9ef2b9922c266;p=senf.git diff --git a/PPI/IOEvent.cc b/PPI/IOEvent.cc index abb1974..7517e41 100644 --- a/PPI/IOEvent.cc +++ b/PPI/IOEvent.cc @@ -1,8 +1,8 @@ // $Id$ // -// Copyright (C) 2007 -// Fraunhofer Institute for Open Communication Systems (FOKUS) -// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Copyright (C) 2007 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY // Stefan Bund // // This program is free software; you can redistribute it and/or modify @@ -27,7 +27,7 @@ //#include "IOEvent.ih" // Custom includes -#include +#include "../Utils/senfassert.hh" //#include "IOEvent.mpp" #define prefix_ @@ -41,25 +41,25 @@ prefix_ void senf::ppi::IOEvent::v_enable() { - Scheduler::instance().add(fd_, boost::bind(&IOEvent::cb,this,_1), - Scheduler::EventId(events_)); + if (fd_ != -1) + event_.enable(); } prefix_ void senf::ppi::IOEvent::v_disable() { - Scheduler::instance().remove(fd_, Scheduler::EventId(events_)); + if (fd_ != -1) + event_.disable(); } -prefix_ void senf::ppi::IOEvent::cb(Scheduler::EventId event) +prefix_ void senf::ppi::IOEvent::cb(int event) { - if ((event & ~events_) != 0) { + if ((event & ~event_.events()) != 0) { if (event & Err) throw ErrorException(); else if (event & Hup) throw HangupException(); else - // This cannot happen. - BOOST_ASSERT(false); + SENF_ASSERT(false && "Internal failure in senf::ppi::IOEvent::cb(int)"); } else { IOEventInfo info = { event }; callback(info);