00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00026 #include "Events.ih"
00027
00028
00029 #include <senf/Utils/senfassert.hh>
00030 #include "detail/EventBinding.hh"
00031
00032 #define prefix_ inline
00033
00034
00035
00036
00037
00038
00039
00040
00041 template <class EventType, class Self>
00042 prefix_ void
00043 senf::ppi::EventImplementationHelper<EventType,Self>::callback(EventArg event,
00044 ClockService::clock_type time)
00045 {
00046 binding().callback(event,time);
00047 }
00048
00049 template <class EventType, class Self>
00050 prefix_ void senf::ppi::EventImplementationHelper<EventType,Self>::callback(EventArg event)
00051 {
00052 binding().callback(event);
00053 }
00054
00055
00056
00057
00058 template <class EventType, class Self>
00059 prefix_ senf::ppi::detail::EventBinding<EventType> &
00060 senf::ppi::EventImplementationHelper<EventType,Self>::binding()
00061 {
00062 SENF_ASSERT( static_cast<Self*>(this)->binding_,
00063 "senf::ppi::EventImplementationHelper::binding(): Missing registerEvent()" );
00064 return * static_cast<Self*>(this)->binding_;
00065 }
00066
00067
00068
00069
00070
00071
00072
00073 template <class Self>
00074 prefix_ void
00075 senf::ppi::EventImplementationHelper<void,Self>::callback(ClockService::clock_type time)
00076 {
00077 binding().callback(time);
00078 }
00079
00080 template <class Self>
00081 prefix_ void senf::ppi::EventImplementationHelper<void,Self>::callback()
00082 {
00083 binding().callback();
00084 }
00085
00086
00087
00088
00089 template <class Self>
00090 prefix_ senf::ppi::detail::EventBinding<void> &
00091 senf::ppi::EventImplementationHelper<void,Self>::binding()
00092 {
00093 SENF_ASSERT( static_cast<Self*>(this)->binding_,
00094 "senf::ppi::EventImplementationHelper::binding(): Missing registerEvent()" );
00095 return * static_cast<Self*>(this)->binding_;
00096 }
00097
00098
00099
00100
00101 template <class EventType>
00102 prefix_ senf::ppi::module::Module & senf::ppi::EventImplementation<EventType>::module()
00103 const
00104 {
00105 return binding_->module();
00106 }
00107
00108 template <class EventType>
00109 prefix_ senf::ppi::EventManager & senf::ppi::EventImplementation<EventType>::manager()
00110 const
00111 {
00112 return binding_->manager();
00113 }
00114
00115
00116
00117
00118 template <class EventType>
00119 prefix_ senf::ppi::EventImplementation<EventType>::EventImplementation()
00120 : binding_(0)
00121 {}
00122
00123
00124
00125
00126 template <class EventType>
00127 prefix_ bool senf::ppi::EventImplementation<EventType>::v_isRegistered()
00128 {
00129 return binding_;
00130 }
00131
00132 template <class EventType>
00133 prefix_ void
00134 senf::ppi::EventImplementation<EventType>::setBinding(detail::EventBinding<Event> & binding)
00135 {
00136 binding_ = & binding;
00137 }
00138
00139
00140 #undef prefix_
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151