Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / NestedUpcall / MT_Client_Test / local_server.h
blobcc1e4357e9530eee819221883fe474bae44ab01d
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
40 public:
42 /// Default constructor
43 MT_Server ();
45 /// Destructor
46 ~MT_Server (void);
48 /// Initialize the MT_Server state - parsing arguments and ...
49 int init (int argc,
50 ACE_TCHAR **argv,
51 TAO_ORB_Manager* orb_manager_ptr);
53 /// Run the orb
54 int run (void);
56 /// Just run it briefly
57 int run_ORB_briefly (void);
59 private:
60 /// reading the IOR of mt object in
61 int read_ior (ACE_TCHAR *filename);
63 /// Parses the commandline arguments.
64 int parse_args (void);
66 /// Key of the object
67 char *object_key_;
69 /// File to output the IOR of the object A.
70 FILE* ior_output_file_;
72 /// The ORB manager
73 TAO_ORB_Manager* orb_manager_ptr_;
75 /// Implementation object
76 MT_Object_i mT_Object_i_;
78 /// reference for the distant MT Object
79 MT_Object_var mT_Object_var_;
81 /// Number of commandline arguments.
82 int argc_;
84 /// commandline arguments.
85 ACE_TCHAR **argv_;
87 /// number of times the server should call to the disted MT OBject
88 unsigned int iterations_;
90 /// IOR of our servant.
91 CORBA::String_var str_;
95 /**
96 * @class MT_Server_Task
98 * @brief Wrapper for the MT_Server to be an extra thread
100 * No big purpose, just wrapping
102 class MT_Server_Task : public ACE_Task<ACE_SYNCH>
104 public:
105 MT_Server_Task (ACE_Thread_Manager* thr_mgr_ptr,
106 int argc,
107 ACE_TCHAR **argv,
108 TAO_ORB_Manager* orb_manager_ptr);
110 virtual int svc (void);
112 private:
113 MT_Server mT_Server_;
114 int argc_;
115 ACE_TCHAR **argv_;
116 TAO_ORB_Manager* orb_manager_ptr_;
120 #endif /* MT_CLIENT_TEST_MT_SERVER_H */