~ubuntu-branches/ubuntu/breezy/ace/breezy

« back to all changes in this revision

Viewing changes to TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Clerk.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad, Benjamin Montgomery, Adam Conrad
  • Date: 2005-09-18 22:51:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge) (0.1.2 woody)
  • Revision ID: james.westby@ubuntu.com-20050918225138-seav22q6fyylb536
Tags: 5.4.7-3ubuntu1
[ Benjamin Montgomery ]
* Added a patch for amd64 and powerpc that disables the compiler
  option -fvisibility-inlines-hidden

[ Adam Conrad ]
* Added DPATCH_OPTION_CPP=1 to debian/patches/00options to make
  Benjamin's above changes work correctly with dpatch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// -*- C++ -*-
2
 
 
3
 
//=============================================================================
4
 
/**
5
 
 *  @file    TAO_Time_Service_Clerk.h
6
 
 *
7
 
 *  TAO_Time_Service_Clerk.h,v 1.15 2003/07/21 23:51:33 dhinton Exp
8
 
 *
9
 
 *  This class implements the CosTime::TimeService IDL interface.
10
 
 *
11
 
 *
12
 
 *  @author Vishal Kachroo  <vishal@cs.wustl.edu>
13
 
 */
14
 
//=============================================================================
15
 
 
16
 
 
17
 
#ifndef TAO_TIME_SERVICE_CLERK_H
18
 
#define TAO_TIME_SERVICE_CLERK_H
19
 
#include /**/ "ace/pre.h"
20
 
 
21
 
#include "ace/Reactor.h"
22
 
#include "orbsvcs/Naming/Naming_Utils.h"
23
 
 
24
 
#include "orbsvcs/TimeServiceS.h"
25
 
#include "Timer_Helper.h"
26
 
#include "time_export.h"
27
 
 
28
 
/**
29
 
 * @class TAO_Time_Service_Clerk
30
 
 *
31
 
 * @brief TimeService Object Implementation.
32
 
 *
33
 
 * The Object implementation implements methods to retrieve
34
 
 * GLOBAL time as well as secure GLOBAL time. The times are
35
 
 * retrieved as UTOs. The object also allows creation of a TIO
36
 
 * for a given time interval.  In general, the TimeService clerk
37
 
 * manages the UTOs and the TIOs. The notion of time returned
38
 
 * here is the globally synchronized time.
39
 
 */
40
 
class TAO_Time_Export TAO_Time_Service_Clerk : public POA_CosTime::TimeService
41
 
{
42
 
public:
43
 
 
44
 
  /// Helper class to help in the updation of time.
45
 
  friend class Timer_Helper;
46
 
 
47
 
  /// Unbounded set of IORs.
48
 
  typedef ACE_Array_Base<CosTime::TimeService_var> IORS;
49
 
 
50
 
  // = Initialization and termination methods.
51
 
  /// Constructor.
52
 
  TAO_Time_Service_Clerk (int timer_value,
53
 
                          int timer_value_usecs,
54
 
                          const IORS& server);
55
 
 
56
 
  /// Destructor.
57
 
  ~TAO_Time_Service_Clerk (void);
58
 
 
59
 
  /// This operation returns the global time and an estimate of
60
 
  /// inaccuracy in a UTO.
61
 
  virtual CosTime::UTO_ptr universal_time (ACE_ENV_SINGLE_ARG_DECL)
62
 
    ACE_THROW_SPEC ((CORBA::SystemException,
63
 
                     CosTime::TimeUnavailable));
64
 
 
65
 
  /**
66
 
   * This operation returns the global time in a UTO only if the time
67
 
   * can be guaranteed to have been obtained securely. Currently this
68
 
   * operation is not implemented and throws a CORBA::NO_IMPLEMENT
69
 
   * exception, if called.
70
 
   */
71
 
  virtual CosTime::UTO_ptr secure_universal_time (ACE_ENV_SINGLE_ARG_DECL)
72
 
    ACE_THROW_SPEC ((CORBA::SystemException,
73
 
                     CosTime::TimeUnavailable));
74
 
 
75
 
  /// This creates a new UTO based on the given parameters.
76
 
  virtual CosTime::UTO_ptr new_universal_time (TimeBase::TimeT time,
77
 
                                               TimeBase::InaccuracyT inaccuracy,
78
 
                                               TimeBase::TdfT tdf
79
 
                                               ACE_ENV_ARG_DECL)
80
 
    ACE_THROW_SPEC ((CORBA::SystemException));
81
 
 
82
 
  /// This creates a new UTO given a time in the UtcT form.
83
 
  virtual CosTime::UTO_ptr uto_from_utc (const TimeBase::UtcT &utc
84
 
                                         ACE_ENV_ARG_DECL)
85
 
    ACE_THROW_SPEC ((CORBA::SystemException));
86
 
 
87
 
  /// This creates a new TIO with the given parameters.
88
 
  virtual CosTime::TIO_ptr new_interval (TimeBase::TimeT lower,
89
 
                                         TimeBase::TimeT upper
90
 
                                         ACE_ENV_ARG_DECL)
91
 
    ACE_THROW_SPEC ((CORBA::SystemException));
92
 
 
93
 
  /// Return the globally synchronized time.
94
 
  virtual CORBA::ULongLong get_time (void);
95
 
 
96
 
  /// This method is called by the driver program to set the Naming
97
 
  /// Server instance.
98
 
  void name_server (TAO_Naming_Server &server);
99
 
 
100
 
  /// Returns the time displacement factor.
101
 
  CORBA::Short time_displacement_factor (void);
102
 
 
103
 
  /// Set the TDF.
104
 
  void time_displacement_factor (CORBA::Short);
105
 
 
106
 
  /// Get method for inaccuracy.
107
 
  TimeBase::InaccuracyT inaccuracy (void);
108
 
 
109
 
  /// Set method for inaccuracy.
110
 
  void inaccuracy (TimeBase::InaccuracyT inaccuracy);
111
 
 
112
 
  /// Clerk's notion of time.
113
 
  CORBA::ULongLong time_;
114
 
 
115
 
private:
116
 
 
117
 
  /// Time displacement factor in minutes.
118
 
  CORBA::Short time_displacement_factor_;
119
 
 
120
 
  /// Inaccuracy in the time.
121
 
  TimeBase::InaccuracyT inaccuracy_;
122
 
 
123
 
  /// Set of server Time Server IORs.
124
 
  IORS server_;
125
 
 
126
 
  /// Time when last global synchronization was done.
127
 
  CORBA::ULongLong update_timestamp_;
128
 
 
129
 
  /**
130
 
   * This is a friend class that inherits from the Event Handler
131
 
   * class.  The handle_timeout method of this class is scheduled for
132
 
   * periodic invocation by the reactor. This method, in turn, updates
133
 
   * the clerks notion of time. Using this class obviates the need for
134
 
   * the clerk to multiple inherit from the servant base as well as
135
 
   * the event handler.
136
 
   */
137
 
  Timer_Helper helper_;
138
 
};
139
 
 
140
 
#include /**/ "ace/post.h"
141
 
#endif /* TIME_SERVICE_CLERK_H */