X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FEvents.cti;h=1dca3da11b03294c2b4a1b0132a9321d1ca2c12d;hb=81f84badf27b66dbadec9890646ca1193e998505;hp=a7db87cbd02c41cb8d16fb2e53b1f46f5ba3e57d;hpb=81ffa1c459b96dd44472bcef37e1e373934ee138;p=senf.git diff --git a/PPI/Events.cti b/PPI/Events.cti index a7db87c..1dca3da 100644 --- a/PPI/Events.cti +++ b/PPI/Events.cti @@ -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 @@ -26,38 +26,99 @@ #include "Events.ih" // Custom includes +#include "../Utils/senfassert.hh" #include "detail/EventBinding.hh" #define prefix_ inline ///////////////////////////////cti.p/////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// -// senf::ppi::EventImplementation +// senf::ppi::EventImplementationHelper //////////////////////////////////////// // protected members -template -prefix_ senf::ppi::EventImplementation::EventImplementation() - : binding_(0) -{} +template +prefix_ void +senf::ppi::EventImplementationHelper::callback(EventArg event, + ClockService::clock_type time) +{ + binding().callback(event,time); +} + +template +prefix_ void senf::ppi::EventImplementationHelper::callback(EventArg event) +{ + binding().callback(event); +} + +//////////////////////////////////////// +// private members + +template +prefix_ senf::ppi::detail::EventBinding & +senf::ppi::EventImplementationHelper::binding() +{ + SENF_ASSERT( static_cast(this)->binding_ ); + return * static_cast(this)->binding_; +} + +/////////////////////////////////////////////////////////////////////////// +// senf::ppi::EventImplementationHelper + +//////////////////////////////////////// +// protected members + +template +prefix_ void +senf::ppi::EventImplementationHelper::callback(ClockService::clock_type time) +{ + binding().callback(time); +} + +template +prefix_ void senf::ppi::EventImplementationHelper::callback() +{ + binding().callback(); +} + +//////////////////////////////////////// +// private members + +template +prefix_ senf::ppi::detail::EventBinding & +senf::ppi::EventImplementationHelper::binding() +{ + SENF_ASSERT( static_cast(this)->binding_ ); + return * static_cast(this)->binding_; +} + +/////////////////////////////////////////////////////////////////////////// +// senf::ppi::EventImplementation template -prefix_ void senf::ppi::EventImplementation::callback(EventArg event, - boost::posix_time::ptime time) +prefix_ senf::ppi::module::Module & senf::ppi::EventImplementation::module() + const { - BOOST_ASSERT(binding_); - binding_->callback(event,time); + return binding_->module(); } template -prefix_ void senf::ppi::EventImplementation::callback(EventArg event) +prefix_ senf::ppi::EventManager & senf::ppi::EventImplementation::manager() + const { - BOOST_ASSERT(binding_); - binding_->callback(event); + return binding_->manager(); } //////////////////////////////////////// +// protected members + +template +prefix_ senf::ppi::EventImplementation::EventImplementation() + : binding_(0) +{} + +//////////////////////////////////////// // private members template