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