summaryrefslogtreecommitdiff
path: root/ace/Timer_Queue_T.i
blob: c18bfc26f28a4dc8c25298a77629e8c01ddb30fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/* -*- C++ -*- */
// $Id$

// Timer_Queue_T.i

template <class TYPE, class FUNCTOR, class LOCK> ACE_INLINE void
ACE_Timer_Queue_T<TYPE, FUNCTOR, LOCK>::timer_skew (const ACE_Time_Value &skew)
{
  timer_skew_ = skew;
}

template <class TYPE, class FUNCTOR, class LOCK> ACE_INLINE const ACE_Time_Value &
ACE_Timer_Queue_T<TYPE, FUNCTOR, LOCK>::timer_skew (void) const
{
  return timer_skew_;
}

template <class TYPE, class FUNCTOR, class LOCK> ACE_INLINE int
ACE_Timer_Queue_T<TYPE, FUNCTOR, LOCK>::expire (void)
{
  if (!this->is_empty ())
    return this->expire (this->gettimeofday () + timer_skew_);
  else
    return 0;
}

template <class TYPE, class FUNCTOR, class LOCK> void
ACE_Timer_Queue_T<TYPE, FUNCTOR, LOCK>::upcall (TYPE &type,
						const void *act,
						const ACE_Time_Value &cur_time)
{
  this->upcall_functor_.timeout (*this, type, act, cur_time);
}


template <class TYPE, class FUNCTOR, class LOCK> ACE_Time_Value
ACE_Timer_Queue_T<TYPE, FUNCTOR, LOCK>::gettimeofday (void)
{
  // Invoke gettimeofday via pointer to function.
  return gettimeofday_ ();
}

template <class TYPE, class FUNCTOR, class LOCK> void
ACE_Timer_Queue_T<TYPE, FUNCTOR, LOCK>::gettimeofday (ACE_Time_Value (*gettimeofday)(void))
{
  gettimeofday_ = gettimeofday;
}

template <class TYPE, class FUNCTOR, class LOCK> LOCK &
ACE_Timer_Queue_T<TYPE, FUNCTOR, LOCK>::mutex (void)
{
  return this->mutex_;
}

template <class TYPE, class FUNCTOR, class LOCK> FUNCTOR &
ACE_Timer_Queue_T<TYPE, FUNCTOR, LOCK>::upcall_functor (void)
{
  return this->upcall_functor_;
}