X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2Fdetail%2FEventBinding.cti;h=09fc719314297ead27270fbdef8544accec049ca;hb=92f8630b75f3ef50e73c48cde58645dcd1534e27;hp=aeb0555b92664107ef513cf1193a3cf3322ea827;hpb=81ffa1c459b96dd44472bcef37e1e373934ee138;p=senf.git diff --git a/PPI/detail/EventBinding.cti b/PPI/detail/EventBinding.cti index aeb0555..09fc719 100644 --- a/PPI/detail/EventBinding.cti +++ b/PPI/detail/EventBinding.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,11 +26,65 @@ //#include "EventBinding.ih" // Custom includes +#include "../EventManager.hh" #define prefix_ inline ///////////////////////////////cti.p/////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// +// senf::ppi::detail::EventBindingHelper + +template +prefix_ void +senf::ppi::detail::EventBindingHelper::callback(EventArg event, + ClockService::clock_type time) +{ + self().eventTime(time); + self().callback_(event); +} + +template +prefix_ void senf::ppi::detail::EventBindingHelper::callback(EventArg event) +{ + callback(event, self().manager().now()); +} + +//////////////////////////////////////// +// private members + +template +prefix_ Self & senf::ppi::detail::EventBindingHelper::self() +{ + return * static_cast(this); +} + +/////////////////////////////////////////////////////////////////////////// +// senf::ppi::detail::EventBindingHelper + +template +prefix_ void +senf::ppi::detail::EventBindingHelper::callback(ClockService::clock_type time) +{ + self().eventTime(time); + self().callback_(); +} + +template +prefix_ void senf::ppi::detail::EventBindingHelper::callback() +{ + callback(self().manager().now()); +} + +//////////////////////////////////////// +// private members + +template +prefix_ Self & senf::ppi::detail::EventBindingHelper::self() +{ + return * static_cast(this); +} + +/////////////////////////////////////////////////////////////////////////// // senf::ppi::detail::EventBinding template @@ -41,20 +95,6 @@ prefix_ senf::ppi::detail::EventBinding::EventBinding(EventManager & : EventBindingBase(manager, module, descriptor), callback_(callback) {} -template -prefix_ void senf::ppi::detail::EventBinding::callback(EventArg event, - boost::posix_time::ptime time) -{ - eventTime(time); - callback_(event); -} - -template -prefix_ void senf::ppi::detail::EventBinding::callback(EventArg event) -{ - callback(event, boost::posix_time::microsec_clock::universal_time()); -} - ///////////////////////////////cti.e/////////////////////////////////////// #undef prefix_