X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FIOEvent.cc;h=ea70efcddad888bc753130ee89459422b65b0f3e;hb=a1fdb7bb122f0b05be809a922d4b7ef5e125fa67;hp=b63ca240dc34211ec2accbf732c212accb947e1d;hpb=53a3d02e7fde841badf42555eba87ccef4566073;p=senf.git diff --git a/PPI/IOEvent.cc b/PPI/IOEvent.cc index b63ca24..ea70efc 100644 --- a/PPI/IOEvent.cc +++ b/PPI/IOEvent.cc @@ -1,8 +1,8 @@ // $Id$ // -// Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// 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,26 @@ prefix_ void senf::ppi::IOEvent::v_enable() { - Scheduler::instance().add(fd_, boost::bind(&IOEvent::cb,this,_1,_2), - 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(int, 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); } else { IOEventInfo info = { event }; callback(info);