summaryrefslogtreecommitdiff
path: root/TAO/tao/ORB_Time_Policy.h
blob: 9c8a8ee4fe79c10ef62fed7be03c4327e4d89e31 (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
61
62
63
64
65
66
// -*- C++ -*-

//=============================================================================
/**
 *  @file   ORB_Time_Policy.h
 *
 *  @author Martin Corino <mcorino@remedy.nl>
 */
//=============================================================================

#ifndef ORB_TIME_POLICY_H
#define ORB_TIME_POLICY_H

#include /**/ "ace/pre.h"

#include /**/ "tao/TAO_Export.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "tao/Versioned_Namespace.h"
#include "ace/Time_Policy.h"
#include "ace/Time_Policy_T.h"
#include "ace/Countdown_Time_T.h"

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

namespace TAO
{

  /**
   * @class ORB_Time_Policy
   *
   * @brief Implement a time policy class which returns timer according
   *        to the active ORB time policy.
   *
   */
  class TAO_Export ORB_Time_Policy
  {
  public:
    /// Return the current time according to this policy
    ACE_Time_Value operator() () const;

    static void set_time_policy (ACE_Dynamic_Time_Policy_Base const * pol);
    static void reset_time_policy (void);

  private:
    static ACE_Time_Policy_T<ACE_Default_Time_Policy> default_policy_;
    static ACE_Dynamic_Time_Policy_Base const * active_policy_;
  };

  // Declare a countdown timer type based on ORB time policy
  typedef ACE_Countdown_Time_T<ORB_Time_Policy> ORB_Countdown_Time;

} // TAO

TAO_END_VERSIONED_NAMESPACE_DECL

#if defined (__ACE_INLINE__)
# include "tao/ORB_Time_Policy.inl"
#endif /* ! __ACE_INLINE__ */

#include /**/ "ace/post.h"

#endif /* ORB_TIME_POLICY_H */