Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / tests / NestedUpcall / MT_Client_Test / local_server.h
blobdb8bc482cf0c1fa620999422391bd9448f97323e
2 //=============================================================================
3 /**
4 * @file local_server.h
6 * This class implements a simple server for the
7 * Nested Upcalls - MT Client test
9 * @author Michael Kircher
11 //=============================================================================
13 #ifndef MT_CLIENT_TEST_MT_SERVER_H
14 #define MT_CLIENT_TEST_MT_SERVER_H
16 #include "MT_Object_i.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "ace/Get_Opt.h"
23 #include "ace/Task.h"
24 #include "ace/Log_Msg.h"
26 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
27 class TAO_ORB_Manager;
28 TAO_END_VERSIONED_NAMESPACE_DECL
30 /**
31 * @class MT_Server
33 * @brief This is the server for the mt_object
35 * See the README file for more information.
37 class MT_Server
39 public:
40 /// Default constructor
41 MT_Server ();
43 /// Destructor
44 ~MT_Server ();
46 /// Initialize the MT_Server state - parsing arguments and ...
47 int init (int argc,
48 ACE_TCHAR **argv,
49 TAO_ORB_Manager* orb_manager_ptr);
51 /// Run the orb
52 int run ();
54 /// Just run it briefly
55 int run_ORB_briefly ();
57 private:
58 /// reading the IOR of mt object in
59 int read_ior (ACE_TCHAR *filename);
61 /// Parses the commandline arguments.
62 int parse_args ();
64 /// Key of the object
65 char *object_key_;
67 /// File to output the IOR of the object A.
68 FILE* ior_output_file_;
70 /// The ORB manager
71 TAO_ORB_Manager* orb_manager_ptr_;
73 /// Implementation object
74 MT_Object_i mT_Object_i_;
76 /// reference for the distant MT Object
77 MT_Object_var mT_Object_var_;
79 /// Number of commandline arguments.
80 int argc_;
82 /// commandline arguments.
83 ACE_TCHAR **argv_;
85 /// number of times the server should call to the disted MT OBject
86 unsigned int iterations_;
88 /// IOR of our servant.
89 CORBA::String_var str_;
93 /**
94 * @class MT_Server_Task
96 * @brief Wrapper for the MT_Server to be an extra thread
98 * No big purpose, just wrapping
100 class MT_Server_Task : public ACE_Task<ACE_SYNCH>
102 public:
103 MT_Server_Task (ACE_Thread_Manager* thr_mgr_ptr,
104 int argc,
105 ACE_TCHAR **argv,
106 TAO_ORB_Manager* orb_manager_ptr);
108 virtual int svc ();
110 private:
111 MT_Server mT_Server_;
112 int argc_;
113 ACE_TCHAR **argv_;
114 TAO_ORB_Manager* orb_manager_ptr_;
118 #endif /* MT_CLIENT_TEST_MT_SERVER_H */