diff options
Diffstat (limited to 'TAO/examples/AMH/Sink_Server/Base_Server.h')
-rw-r--r-- | TAO/examples/AMH/Sink_Server/Base_Server.h | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/TAO/examples/AMH/Sink_Server/Base_Server.h b/TAO/examples/AMH/Sink_Server/Base_Server.h index 8a4160ca778..449a862d059 100644 --- a/TAO/examples/AMH/Sink_Server/Base_Server.h +++ b/TAO/examples/AMH/Sink_Server/Base_Server.h @@ -22,6 +22,7 @@ #include "tao/PortableServer/PortableServer.h" #include "tao/PortableServer/Servant_Base.h" + // Forward declaration of the kind of servant we are willing to handle // in this server class AMH_Servant; @@ -33,15 +34,19 @@ class AMH_Servant; class Base_Server { public: - Base_Server (int *argc, char **argv); + Base_Server (int &argc, char **argv); - // @@ Mayur, empty parameter lists should be denoted with "(void)", - // not "()". Again, this is detailed in the guidelines. - // // Is there any reason to make the destructor virtual? Will you // ever be destroying a derived class through a pointer to // Base_Server? - virtual ~Base_Server (); + // + // Mayur: I like to code 'defensively': This class already has + // virtual methods (it is a base class after all!). Making the + // destructor won't add any additional overhead (other than one more + // entry in the vtbl) and if, by chance, someone does delete a + // derived-class though this classes ptr, we are still safe. The + // short answer to your question is : I don't know. :) + virtual ~Base_Server (void); // Just parse the command line for the output-file (-o) option. // return -1 if -o option is not present @@ -56,36 +61,28 @@ public: /// register the servant with the poa virtual void register_servant (AMH_Servant *servant); - // @@ Mayur, empty parameter lists should be denoted with "(void)", - // not "()". Again, this is detailed in the guidelines. - /// orb-perform_work () abstraction - virtual void run_event_loop (); + virtual void run_event_loop (void); public: // @@ Mayur, please put inlined methods in a separate `.inl' file, // as detailed in the ACE/TAO coding/style guidelines, and as per // our conventions. - // - // @@ Mayur, empty parameter lists should be denoted with "(void)", - // not "()". Again, this is detailed in the guidelines. + // Mayur: A seperate file for just one method? AAAGH. OK. /// Accesor method (for servants) to the initialised ORB - CORBA::ORB_ptr orb () { return this->orb_.in (); } + CORBA::ORB_ptr orb (void); protected: - int *argc_; + int &argc_; char **argv_; - char *ior_output_file_; + const char *ior_output_file_; CORBA::ORB_var orb_; PortableServer::POA_var root_poa_; private: - // @@ Mayur, why are you passing a CORBA::String_var by value? - /// There is no need to. Just pass in the string via "ior.in()" - /// in the caller. /// Write servant IOR to file specified with the '-o' option - int write_ior_to_file (CORBA::String_var ior); + int write_ior_to_file (const char * ior); }; #include "ace/post.h" |