summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbala <balanatarajan@users.noreply.github.com>1999-01-16 22:32:50 +0000
committerbala <balanatarajan@users.noreply.github.com>1999-01-16 22:32:50 +0000
commite2101d2516eee3f20bc29a0ce2ddada63ec8f6d1 (patch)
tree34c4b0e81f8c05015349a5d470b04fb99f4794f5
parentcda7a088333b97c0f7653fd88fbe06b910d070b6 (diff)
downloadATCD-e2101d2516eee3f20bc29a0ce2ddada63ec8f6d1.tar.gz
Implemented suggestions of Dr.Schmidt
-rw-r--r--TAO/examples/Simple/Simple_util.h93
-rw-r--r--TAO/examples/Simple/time/Time_Client_i.cpp22
2 files changed, 52 insertions, 63 deletions
diff --git a/TAO/examples/Simple/Simple_util.h b/TAO/examples/Simple/Simple_util.h
index 483b2adce96..33b3020f592 100644
--- a/TAO/examples/Simple/Simple_util.h
+++ b/TAO/examples/Simple/Simple_util.h
@@ -12,7 +12,7 @@
// The classe define the templates for the client and server.
//
// = AUTHOR
-// @@ Bala, please add yourself here!
+// Balachandran Natarajan <bala@cs.wustl.edu>
//
// ============================================================================
@@ -31,15 +31,17 @@ class Server
// A set of useful class Templates for using the TAO CORBA implementation.
//
// = DESCRIPTION
- // @@ Bala, please fill in a brief description here.
+ // A template server definition. This template can be used by
+ // single server/client projects for defintion of their server/
+ // clients. Pl. see the directories time, bank, echo for further
+ // details of implemenatation.
public:
// = Initialization and termination methods.
- // @@ Bala, please use "Server (void)", etc. for all "()" in your code!
- Server ();
+ Server (void);
// Constructor.
- ~Server ();
+ ~Server (void);
// Destructor.
int init (const char *servant_name,
@@ -49,7 +51,7 @@ public:
// Initialize the Server state - parsing arguments and waiting.
// interface_name is the name used to register the Servant.
- void register_name ();
+ void register_name (void);
// after calling init(), this method will register the server with
// the TAO Naming Service using the servant_name passed to init().
@@ -63,7 +65,7 @@ protected:
const char *name;
// name of the servant to be used for TAO Naming Service
- int parse_args ();
+ int parse_args (void);
// Parses the commandline arguments.
TAO_ORB_Manager orb_manager_;
@@ -87,63 +89,60 @@ template <class InterfaceObj, class Var>
class Client
{
// = TITLE
- // @@ Bala, please fill in a brief description here.
+ // Template Client class
//
// = DESCRIPTION
- // @@ Bala, please fill in a brief description here.
+ // A template client implementation for a single server/client
+ // model. The example usage of these usage can be found in the
+ // sub-directories below
public:
- // @@ Bala, please reformat this stuff to use ACE indenting and map
- // "()" to "(void)"!
-
- // = Initialization and termination methods.
- Client ();
- // Constructor.
-
- ~Client ();
- // Destructor.
+ // = Initialization and termination methods.
+ Client (void);
+ // Constructor.
- int init (int argc, char *argv[]);
- // Initialize the client communication endpoint with server.
+ ~Client (void);
+ // Destructor.
- // @@ Bala, please don't inline this in the header file, and also
- // remove the inline keyword.
- inline InterfaceObj *operator-> () { return server_.in ();};
- // Return the interface object pointer.
+ int init (int argc, char *argv[]);
+ // Initialize the client communication endpoint with server.
- int shutdown (void );
- // Returns the shutdown flag.
+ InterfaceObj *operator-> () { return server_.in ();};
+ // Return the interface object pointer.
- void shutdown (int);
- // Fills in the shutdwon flag.
+ int shutdown (void );
+ // Returns the shutdown flag.
+
+ void shutdown (int);
+ // Fills in the shutdwon flag.
protected:
- int read_ior (char *filename);
- // Function to read the server IOR from a file.
-
- int parse_args ();
- // Parses the arguments passed on the command line.
+ int read_ior (char *filename);
+ // Function to read the server IOR from a file.
- int argc_;
- // # of arguments on the command line.
+ int parse_args (void);
+ // Parses the arguments passed on the command line.
- char **argv_;
- // arguments from command line.
+ int argc_;
+ // # of arguments on the command line.
- char *ior_;
- // IOR of the obj ref of the server.
+ char **argv_;
+ // arguments from command line.
- CORBA::Environment env_;
- // Environment variable.
+ char *ior_;
+ // IOR of the obj ref of the server.
- Var server_;
- // Server object
+ CORBA::Environment env_;
+ // Environment variable.
- int shutdown_;
- // Flag for shutting down the server
+ Var server_;
+ // Server object
- CORBA::ORB_var orb_;
- // Remember our orb.
+ int shutdown_;
+ // Flag for shutting down the server
+
+ CORBA::ORB_var orb_;
+ // Remember our orb.
};
#endif /* TAO_UTIL_H */
diff --git a/TAO/examples/Simple/time/Time_Client_i.cpp b/TAO/examples/Simple/time/Time_Client_i.cpp
index 3e345da603d..18ccd459070 100644
--- a/TAO/examples/Simple/time/Time_Client_i.cpp
+++ b/TAO/examples/Simple/time/Time_Client_i.cpp
@@ -5,15 +5,13 @@
// This is the interface program that accesses the remote object
// Constructor.
-// @@ Bala, please watch the formatting stuff..
-Time_Client_i::Time_Client_i( void)
+Time_Client_i::Time_Client_i (void)
{
//no-op
}
//Destructor.
-// @@ Bala, please watch the formatting stuff..
-Time_Client_i::~Time_Client_i( void)
+Time_Client_i::~Time_Client_i (void)
{
//no-op
}
@@ -22,13 +20,6 @@ int
Time_Client_i::run (int argc,
char** argv)
{
- // Instantiation of template with the interface object and its _var
- // object.
-
- // @@ Bala, just for fun, why don't you put this as a private data
- // member in the Time_Client_i class.
- Client<Time, Time_var> client;
-
// Initialize the client
if (client.init (argc, argv) == -1)
return -1;
@@ -45,15 +36,14 @@ Time_Client_i::run (int argc,
ACE_DEBUG ((LM_DEBUG,
"string time is %s\n",
ascii_timedate));
-
- // @@ Bala, watch the formatting stuff..
- if ( client.shutdown () == 1)
+
+ if (client.shutdown () == 1)
client->shutdown (TAO_TRY_ENV);
}
TAO_CATCHANY
{
- // @@ Bala, watch the formatting stuff..
- TAO_TRY_ENV.print_exception("\tException");
+ TAO_TRY_ENV.print_exception ("\tException");
+ return -1;
}
TAO_ENDTRY;