3 //=============================================================================
5 * @file Time_Policy_T.h
7 * @author Martin Corino <mcorino@remedy.nl>
9 //=============================================================================
11 #ifndef ACE_TIME_POLICY_T_H
12 #define ACE_TIME_POLICY_T_H
14 #include /**/ "ace/pre.h"
16 #include /**/ "ace/ACE_export.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "ace/Time_Policy.h"
24 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
27 * @class ACE_Time_Policy_T
29 * @brief Template class implementing a dynamic time policy based on
32 template <typename TIME_POLICY
>
33 class ACE_Time_Policy_T
: public ACE_Dynamic_Time_Policy_Base
36 ACE_Time_Policy_T (TIME_POLICY
const & time_policy
= TIME_POLICY());
37 virtual ~ACE_Time_Policy_T ();
39 /// Return the current time according to this policy
40 ACE_Time_Value_T
<ACE_Delegating_Time_Policy
> operator()() const;
42 /// Allows applications to control how the timer queue gets the time
44 void set_time_policy(TIME_POLICY
const & time_policy
);
46 /// Noop. Just here to satisfy backwards compatibility demands.
47 void set_gettimeofday (ACE_Time_Value (*gettimeofday
)(void));
49 /// Return the current time according to policy implementation.
50 virtual ACE_Time_Value_T
<ACE_Delegating_Time_Policy
> gettimeofday () const;
53 /// The policy to return the current time of day
54 TIME_POLICY time_policy_
;
57 ACE_END_VERSIONED_NAMESPACE_DECL
59 #include /**/ "ace/post.h"
61 #if defined (__ACE_INLINE__)
62 #include "ace/Time_Policy_T.inl"
63 #endif /* __ACE_INLINE__ */
65 #include "ace/Time_Policy_T.cpp"
67 #endif /* ACE_TIME_POLICY_T_H */