Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / orbsvcs / tests / Time / Client_i.h
blobba1b6b252bb47c03d98cc8e5d75d74ee913c1d21
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Client_i.h
7 * This class implements a simple CORBA client that accesses a Time Service
8 * server.
10 * @author Vishal Kachroo <vishal@cs.wustl.edu>
12 //=============================================================================
15 #include "orbsvcs/TimeServiceC.h"
16 #include "orbsvcs/Naming/Naming_Client.h"
18 /**
19 * @class Client_i
21 * @brief Client implementation to access the Time Service server.
23 * Class wrapper for a client that gets the IOR of the clerk
24 * running on its machine and uses it to get the globally
25 * synchronized time
27 class Client_i
29 public:
30 /// Constructor.
31 Client_i (void);
33 /// Destructor.
34 ~Client_i (void);
36 /// Execute client example code.
37 int run (void);
39 /// Initialize the client communication endpoint with server.
40 int init (int argc, ACE_TCHAR *argv[]);
42 /**
43 * This test throws an exception that the operation
44 * <secure_universal_time> has not been currently implemented in the
45 * given server.
47 void test_for_secure_universal_time (void);
49 /// Tests if the server returns a valid time.
50 void test_for_universal_time (void);
52 /// Tests if the server returns a new UTO filled with the given time.
53 void test_for_new_universal_time (void);
55 /// Tests if the returned UTO has the same value as the given UTC.
56 void test_for_uto_from_utc (void);
58 /// Tests if a new TIO is created according to the given bounds.
59 void test_for_new_interval (void);
61 private:
62 /// Function to read the server IOR from a file.
63 int read_ior (ACE_TCHAR *filename);
65 /// Parses the arguments passed on the command line.
66 int parse_args (void);
68 /// To initialize the naming service and get a clerk IOR.
69 int obtain_initial_references (void);
71 /// # of arguments on the command line.
72 int argc_;
74 /// arguments from command line.
75 ACE_TCHAR **argv_;
77 /// IOR of the obj ref of the server.
78 char *ior_;
80 /// Number of times to invoke the <time> operation.
81 u_int loop_count_;
83 /// Flag for server shutdown.
84 int shutdown_;
86 /// Time Service Server object ptr.
87 CosTime::TimeService_var clerk_;
89 /// An instance of the name client used for resolving the Time
90 /// Service object.
91 TAO_Naming_Client my_name_client_;
93 /// Remember our orb.
94 CORBA::ORB_var orb_;