// -*- C++ -*- //============================================================================= /** * @file Client_i.h * * This class implements a simple CORBA client that accesses a Time Service * server. * * @author Vishal Kachroo */ //============================================================================= #include "orbsvcs/TimeServiceC.h" #include "orbsvcs/Naming/Naming_Client.h" /** * @class Client_i * * @brief Client implementation to access the Time Service server. * * Class wrapper for a client that gets the IOR of the clerk * running on its machine and uses it to get the globally * synchronized time */ class Client_i { public: /// Constructor. Client_i (); /// Destructor. ~Client_i (); /// Execute client example code. int run (); /// Initialize the client communication endpoint with server. int init (int argc, ACE_TCHAR *argv[]); /** * This test throws an exception that the operation * has not been currently implemented in the * given server. */ void test_for_secure_universal_time (); /// Tests if the server returns a valid time. void test_for_universal_time (); /// Tests if the server returns a new UTO filled with the given time. void test_for_new_universal_time (); /// Tests if the returned UTO has the same value as the given UTC. void test_for_uto_from_utc (); /// Tests if a new TIO is created according to the given bounds. void test_for_new_interval (); private: /// Function to read the server IOR from a file. int read_ior (ACE_TCHAR *filename); /// Parses the arguments passed on the command line. int parse_args (); /// To initialize the naming service and get a clerk IOR. int obtain_initial_references (); /// # of arguments on the command line. int argc_; /// arguments from command line. ACE_TCHAR **argv_; /// IOR of the obj ref of the server. char *ior_; /// Number of times to invoke the