Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / performance-tests / Pluggable / PP_Test_Client.h
blob8689a013061791542a58cd3d129a7b3fdad72017
2 //=============================================================================
3 /**
4 * @file PP_Test_Client.h
6 * This class implements some basic no-op twoway and oneway requests
7 * to time the latency of the pluggable protocol implementation.
9 * @author Jeff Parsons <parsons@cs.wustl.edu>
11 //=============================================================================
14 #ifndef _PP_TEST_CLIENT_H
15 #define _PP_TEST_CLIENT_H
17 #include "ace/Get_Opt.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 # pragma once
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #include "PP_TestC.h"
25 /**
26 * @class PP_Test_Client
28 * @brief Defines a class that encapsulates behaviour of the PP_Test client
29 * example. Provides a better understanding of the logic in an
30 * object oriented way.
32 * This class declares an interface to run the example client for
33 * PP_Teset CORBA server. All the complexity for initializing the
34 * server is hidden in the class. Just the run() interface is needed.
36 class PP_Test_Client
38 public:
39 // = Constructor and destructor.
40 /// Use <testing_collocation> to control some client's behaviors.
41 PP_Test_Client (int shutdown = 0);
43 ~PP_Test_Client (void);
45 /// Execute client example code.
46 int run (void);
48 /// Initialize the client communication endpoint with server.
49 /// <collocation_test_ior> is used to pass in the ior file name.
50 int init (int argc, ACE_TCHAR **argv);
52 private:
53 /// Function to read the cubit factory ior from a file.
54 int read_ior (ACE_TCHAR *filename);
56 /// Parses the arguments passed on the command line.
57 int parse_args (void);
59 /// Oneway operation test.
60 void send_oneway (void);
62 /// Twoway operation test.
63 void send_void (void);
65 /// This method runs only the send_void() test.
66 int run_void (void);
68 /// This method runs only the send_oneway() test.
69 int run_oneway (void);
71 /// Invoke the method with <do_shutdown> != 0 to shutdown the server.
72 int shutdown_server (int do_shutdown);
74 /// # of arguments on the command line.
75 int argc_;
77 /// arguments from command line.
78 ACE_TCHAR **argv_;
80 /// Remember our orb.
81 CORBA::ORB_var orb_;
83 /// Key of factory obj ref.
84 ACE_TCHAR *factory_key_;
86 /// Number of times to do the send operations.
87 CORBA::ULong loop_count_;
89 /// Flag to tell server to shutdown.
90 int shutdown_;
92 /// factory pointer for cubit.
93 Pluggable_Test_Factory_var factory_;
95 /// Pluggable_Test obj ref.
96 Pluggable_Test_var objref_;
98 /// # of calls made to functions.
99 CORBA::ULong call_count_;
101 /// # of errors incurred in the lifetime of the application.
102 CORBA::ULong error_count_;
104 /// File from which to obtain the IOR.
105 FILE *factory_ior_file_;
107 /// File handle to read the IOR.
108 ACE_HANDLE f_handle_;
110 /// Run only the cube_void() test.
111 int only_void_;
113 /// Run only the cube_oneway() test.
114 int only_oneway_;
117 #endif /* _PP_TEST_CLIENT_H */