// $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 <g0dil@berlios.de>
//
// This program is free software; you can redistribute it and/or modify
//#include "EventBinding.ih"
// Custom includes
+#include "../EventManager.hh"
#define prefix_ inline
///////////////////////////////cti.p///////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
+// senf::ppi::detail::EventBindingHelper<EventType,Self>
+
+template <class EventType, class Self>
+prefix_ void
+senf::ppi::detail::EventBindingHelper<EventType,Self>::callback(EventArg event,
+ ClockService::clock_type time)
+{
+ self().eventTime(time);
+ self().callback_(event);
+}
+
+template <class EventType, class Self>
+prefix_ void senf::ppi::detail::EventBindingHelper<EventType,Self>::callback(EventArg event)
+{
+ callback(event, self().manager().now());
+}
+
+////////////////////////////////////////
+// private members
+
+template <class EventType, class Self>
+prefix_ Self & senf::ppi::detail::EventBindingHelper<EventType,Self>::self()
+{
+ return * static_cast<Self*>(this);
+}
+
+///////////////////////////////////////////////////////////////////////////
+// senf::ppi::detail::EventBindingHelper<void,Self>
+
+template <class Self>
+prefix_ void
+senf::ppi::detail::EventBindingHelper<void,Self>::callback(ClockService::clock_type time)
+{
+ self().eventTime(time);
+ self().callback_();
+}
+
+template <class Self>
+prefix_ void senf::ppi::detail::EventBindingHelper<void,Self>::callback()
+{
+ callback(self().manager().now());
+}
+
+////////////////////////////////////////
+// private members
+
+template <class Self>
+prefix_ Self & senf::ppi::detail::EventBindingHelper<void,Self>::self()
+{
+ return * static_cast<Self*>(this);
+}
+
+///////////////////////////////////////////////////////////////////////////
// senf::ppi::detail::EventBinding<EvImpl>
template <class EventType>
: EventBindingBase(manager, module, descriptor), callback_(callback)
{}
-template <class EvImpl>
-prefix_ void senf::ppi::detail::EventBinding<EvImpl>::callback(EventArg event,
- boost::posix_time::ptime time)
-{
- eventTime(time);
- callback_(event);
-}
-
-template <class EvImpl>
-prefix_ void senf::ppi::detail::EventBinding<EvImpl>::callback(EventArg event)
-{
- callback(event, boost::posix_time::microsec_clock::universal_time());
-}
-
///////////////////////////////cti.e///////////////////////////////////////
#undef prefix_