Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / tests / NestedUpcall / MT_Client_Test / client.h
blob8828e19463fa1dcbc79673fe66e6fd5520f974f0
2 //=============================================================================
3 /**
4 * @file client.h
6 * Test for multithreaded client using one global ORB (and Reactor)
8 * @author Michael Kircher
9 */
10 //=============================================================================
12 #ifndef MT_CLIENT_H
13 #define MT_CLIENT_H
15 #include "ace/Get_Opt.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
18 # pragma once
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "ace/Task.h"
22 #include "ace/Thread_Manager.h"
23 #include "tao/ORB.h"
24 #include "MT_Client_TestC.h"
26 /**
27 * @class MT_Client
29 * @brief A simple client talking to one server
31 * It is connecting to a server which holds the Object_A
32 * or using the "-m" switch to a server holding the MT_Object
34 class MT_Client
36 public:
37 /// = Constructor and destructor.
38 MT_Client ();
39 ~MT_Client ();
41 /// Execute client example code.
42 int run ();
44 /// Initialize the client communication endpoint with server.
45 int init (int argc,
46 ACE_TCHAR **argv,
47 int client_number);
49 private:
50 /// reading the IOR of object A in
51 int read_ior (ACE_TCHAR *filename);
53 /// Parses the arguments passed on the command line.
54 int parse_args ();
56 /// # of arguments on the command line.
57 int argc_;
59 /// arguments from command line.
60 ACE_TCHAR **argv_;
62 /// Key of the object
63 char *object_key_;
65 /// Flag to tell server to shutdown.
66 int shutdown_;
68 /// Remember our orb.
69 CORBA::ORB_var orb_var_;
71 /// pointer to the mt Object
72 MT_Object_var mT_Object_var_;
74 /// This is used to choose the server...
75 int client_number_;
77 /// number of loops
78 unsigned long iterations_;
81 /**
82 * @class MT_Client_Task
84 * @brief Wrapper for the MT_Client to be an extra thread
86 * No big purpose, just wrapping
88 class MT_Client_Task : public ACE_Task<ACE_SYNCH>
90 public:
91 MT_Client_Task (int argc, ACE_TCHAR **argv, int client_number);
93 virtual int svc ();
95 private:
96 MT_Client mT_Client_;
97 int argc_;
98 ACE_TCHAR **argv_;
100 /// To determine if we use the first or the second server.
101 int client_number_;
104 #endif /* MT_CLIENT_H */