1 //=============================================================================
5 * The classe define the templates for the client and server.
7 * @author Balachandran Natarajan <bala@cs.wustl.edu>
9 //=============================================================================
14 #include "tao/Utils/ORB_Manager.h"
16 #include "ace/Get_Opt.h"
17 #include "ace/Read_Buffer.h"
22 * @brief A set of useful class Templates for using the TAO CORBA
25 * A template server definition. This template can be used by
26 * single server/client projects for definition of their
27 * server/clients. See the directories time, bank, echo for
28 * further details of implemenatation.
30 template <class Servant
>
40 /// Initialize the Server state - parsing arguments and waiting.
41 /// interface_name is the name used to register the Servant.
42 int init (const char *servant_name
,
46 /// After calling <init>, this method will register the server with
47 /// the TAO Naming Service using the servant_name passed to <init>.
57 /// name of the servant to be used for TAO Naming Service
60 /// Parses the commandline arguments.
63 /// The ORB manager - a helper class for accessing the POA and
64 /// registering objects.
65 TAO_ORB_Manager orb_manager_
;
67 // TAO_Naming_Server namingServer;
68 // helper class for getting access to Naming Service.
70 /// File where the IOR of the server object is stored.
71 FILE *ior_output_file_
;
73 /// Number of command line arguments.
76 /// The command line arguments.
83 * @brief Template Client class
85 * A template client implementation for a single server/client
86 * model. The example usage of these usage can be found in the
87 * sub-directories below
89 template <class InterfaceObj
, class Var
>
99 /// Initialize the client communication endpoint with server.
100 int init (const char *name
,int argc
, ACE_TCHAR
*argv
[]);
102 /// Return the interface object pointer.
103 InterfaceObj
*operator-> () { return server_
.in ();};
105 /// Returns the shutdown flag.
108 /// Fills in the shutdwon flag.
111 /// Initialize naming service
112 int obtain_initial_references ();
115 /// Function to read the server IOR from a file.
116 int read_ior (ACE_TCHAR
*filename
);
118 /// Parses the arguments passed on the command line.
121 // TAO_Naming_Client namingClient;
122 // helper class for getting access to Naming Service.
124 /// # of arguments on the command line.
127 /// arguments from command line.
130 /// IOR of the obj ref of the server.
133 /// Name to be usred for the naming service
136 /// Remember our orb.
142 /// Flag to use the naming service
145 /// Flag for shutting down the server
149 #include "Simple_util.cpp"
150 #endif /* TAO_UTIL_H */