2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
15 \brief EventBinding inline template implementation */
17 //#include "EventBinding.ih"
20 #include <senf/PPI/EventManager.hh>
22 #define prefix_ inline
23 //-/////////////////////////////////////////////////////////////////////////////////////////////////
25 //-/////////////////////////////////////////////////////////////////////////////////////////////////
26 // senf::ppi::detail::EventBindingHelper<EventType,Self>
28 template <class EventType, class Self>
30 senf::ppi::detail::EventBindingHelper<EventType,Self>::callback(EventArg event,
31 ClockService::clock_type time)
33 self().eventTime(time);
34 self().callback_(event);
37 template <class EventType, class Self>
38 prefix_ void senf::ppi::detail::EventBindingHelper<EventType,Self>::callback(EventArg event)
40 callback(event, self().manager().now());
43 //-/////////////////////////////////////////////////////////////////////////////////////////////////
46 template <class EventType, class Self>
47 prefix_ Self & senf::ppi::detail::EventBindingHelper<EventType,Self>::self()
49 return * static_cast<Self*>(this);
52 //-/////////////////////////////////////////////////////////////////////////////////////////////////
53 // senf::ppi::detail::EventBindingHelper<void,Self>
57 senf::ppi::detail::EventBindingHelper<void,Self>::callback(ClockService::clock_type time)
59 self().eventTime(time);
64 prefix_ void senf::ppi::detail::EventBindingHelper<void,Self>::callback()
66 callback(self().manager().now());
69 //-/////////////////////////////////////////////////////////////////////////////////////////////////
73 prefix_ Self & senf::ppi::detail::EventBindingHelper<void,Self>::self()
75 return * static_cast<Self*>(this);
78 //-/////////////////////////////////////////////////////////////////////////////////////////////////
79 // senf::ppi::detail::EventBinding<EvImpl>
81 template <class EventType>
82 prefix_ senf::ppi::detail::EventBinding<EventType>::EventBinding(EventManager & manager,
83 module::Module & module,
85 EventDescriptor & descriptor)
86 : EventBindingBase(manager, module, descriptor), callback_(callback)
89 //-/////////////////////////////////////////////////////////////////////////////////////////////////
97 // c-file-style: "senf"
98 // indent-tabs-mode: nil
99 // ispell-local-dictionary: "american"
100 // compile-command: "scons -u ../test"