3 //=============================================================================
7 * This class implements a simple CORBA client that accesses a Time Service
10 * @author Vishal Kachroo <vishal@cs.wustl.edu>
12 //=============================================================================
15 #include "orbsvcs/TimeServiceC.h"
16 #include "orbsvcs/Naming/Naming_Client.h"
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
36 /// Execute client example code.
39 /// Initialize the client communication endpoint with server.
40 int init (int argc
, ACE_TCHAR
*argv
[]);
43 * This test throws an exception that the operation
44 * <secure_universal_time> has not been currently implemented in the
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);
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.
74 /// arguments from command line.
77 /// IOR of the obj ref of the server.
80 /// Number of times to invoke the <time> operation.
83 /// Flag for server shutdown.
86 /// Time Service Server object ptr.
87 CosTime::TimeService_var clerk_
;
89 /// An instance of the name client used for resolving the Time
91 TAO_Naming_Client my_name_client_
;