Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / netsvcs / lib / Time_Request_Reply.h
blob729848a774f13de5a355b312e5915854d0f93c55
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Time_Request_Reply.h
7 * Define the format used to exchange messages between the
8 * ACE time server and clerks.
10 * @author Prashant Jain
12 //=============================================================================
15 #ifndef ACE_TIME_REQUEST_REPLY_H
16 #define ACE_TIME_REQUEST_REPLY_H
17 #include /**/ "ace/pre.h"
19 #include "ace/Time_Value.h"
20 #include "ace/svc_export.h"
22 #if !defined (ACE_LACKS_PRAGMA_ONCE)
23 # pragma once
24 #endif /* ACE_LACKS_PRAGMA_ONCE */
26 /**
27 * @class ACE_Time_Request
29 * @brief Message format for delivering requests to the ACE_Time Server.
31 * This class is implemented to minimize data copying.
32 * In particular, all marshaling is done in situ...
34 class ACE_Svc_Export ACE_Time_Request
36 public:
37 enum Constants
39 /// Request message types.
40 TIME_UPDATE = 01,
42 /// Class-specific constant values.
43 MAX_TIME_LEN = MAXPATHLEN + 1
46 /// Default constructor.
47 ACE_Time_Request ();
49 /**
50 * Create a ACE_Time_Request message.
51 * @param msg_type Type of request.
52 * @param time Time.
53 * @param timeout Max time waiting for request.
55 ACE_Time_Request (ACE_INT32 msg_type,
56 const time_t time,
57 ACE_Time_Value *timeout = 0);
59 // Get the fixed size of message
60 ssize_t size () const;
62 /// Get the type of the message.
63 ACE_INT32 msg_type () const;
65 /// Set the type of the message.
66 void msg_type (ACE_INT32);
68 /// Get the time
69 time_t time () const;
71 // Set the time
72 void time (time_t t);
74 /// Get the blocking semantics.
75 ACE_UINT32 block_forever () const;
77 /// Set the blocking semantics.
78 void block_forever (ACE_UINT32);
80 /// Get the timeout.
81 ACE_Time_Value timeout () const;
83 /// Set the timeout.
84 void timeout (const ACE_Time_Value& timeout);
86 /// Encode the message before transmission.
87 int encode (void *&);
89 /// Decode message after reception.
90 int decode ();
92 /// Print out the values of the message for debugging purposes.
93 void dump () const;
95 private:
96 // = The 5 fields in the <Transfer> struct are transmitted to the server.
97 // The remaining 2 fields are not tranferred -- they are used only on
98 // the server-side to simplify lookups.
100 struct Transfer
102 /// Type of the request (i.e., <TIME_UPDATE>)
103 ACE_INT32 msg_type_;
105 /// Indicates if we should block forever. If 0, then sec_timeout_
106 /// and usec_timeout_ indicates how long we should wait.
107 ACE_UINT32 block_forever_;
109 /// Max seconds willing to wait for name if not blocking forever.
110 ACE_UINT64 sec_timeout_;
112 /// Max micro seconds to wait for name if not blocking forever.
113 ACE_UINT32 usec_timeout_;
115 /// The data portion contains <time_>
116 ACE_UINT64 time_;
119 /// Transfer buffer.
120 Transfer transfer_;
122 /// Time
123 time_t time_;
126 #include /**/ "ace/post.h"
127 #endif /* ACE_TIME_REQUEST_REPLY_H */