8 #ifndef OPENDDS_DCPS_MULTI_TASK_H 9 #define OPENDDS_DCPS_MULTI_TASK_H 37 bool worth_passing_along =
false;
42 if (worth_passing_along) {
77 multi_task->enable_i(delay_);
94 multi_task->disable_i();
108 next_time_ = now +
delay_;
123 " failed to schedule timer %p\n",
ACE_TEXT(
"")));
125 next_time_ = now + per;
129 if (estimated_next_time < next_time_) {
133 cancel_estimate_ = now2 - now;
137 " failed to reschedule timer %p\n",
ACE_TEXT(
"")));
139 next_time_ = now2 + per;
156 template <
typename Delegate>
166 , delegate_(delegate)
167 , function_(function) {}
177 ((*handle).*function_)(now);
RcHandle< T > rchandle_from(T *pointer)
MultiTask(RcHandle< ReactorInterceptor > interceptor, const TimeDuration &delay)
void enable(const TimeDuration &delay)
CommandPtr execute_or_enqueue(CommandPtr command)
const ACE_Time_Value & value() const
WeakRcHandle< Delegate > delegate_
WeakRcHandle< MultiTask > const multi_task_
static TimePoint_T< MonotonicClock > now()
virtual void execute(const MonotonicTimePoint &now)=0
virtual void reactor(ACE_Reactor *reactor)
virtual long schedule_timer(ACE_Event_Handler *event_handler, const void *arg, const ACE_Time_Value &delay, const ACE_Time_Value &interval=ACE_Time_Value::zero)
ScheduleDisableCommand(WeakRcHandle< MultiTask > multi_task)
int handle_timeout(const ACE_Time_Value &tv, const void *)
const TimeDuration delay_
virtual ACE_Reactor * reactor(void) const
void enable_i(const TimeDuration &per)
ScheduleEnableCommand(WeakRcHandle< MultiTask > multi_task, const TimeDuration &delay)
const ACE_Reactor * reactor() const
MonotonicTimePoint next_time_
virtual int cancel_timer(long timer_id, const void **arg=0, int dont_call_handle_close=1)
TimeDuration cancel_estimate_
WeakRcHandle< ReactorInterceptor > interceptor_
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
void execute(const MonotonicTimePoint &now)
RcHandle< T > lock() const
WeakRcHandle< MultiTask > const multi_task_
const TimeDuration delay_
#define TheServiceParticipant
PmfMultiTask(RcHandle< ReactorInterceptor > interceptor, const TimeDuration &delay, RcHandle< Delegate > delegate, PMF function)
The Internal API and Implementation of OpenDDS.