Activator_Options.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file   Activator_Options.h
00006  *
00007  *  Activator_Options.h,v 1.6 2006/01/04 16:10:11 giovannd Exp
00008  *
00009  *  @brief  Definition of the Options class for the Implementation Repository.
00010  *
00011  *  @author Darrell Brunsch <brunsch@cs.wustl.edu>
00012  */
00013 //=============================================================================
00014 
00015 #ifndef ACTIVATOR_OPTIONS_H
00016 #define ACTIVATOR_OPTIONS_H
00017 
00018 #include "activator_export.h"
00019 
00020 #include "ace/SString.h"
00021 
00022 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00023 # pragma once
00024 #endif /* ACE_LACKS_PRAGMA_ONCE */
00025 
00026 /**
00027  * @class Options
00028  *
00029  * This is where all the settings for TAO's Implementation Repository are
00030  * stored.
00031  */
00032 class Activator_Export Activator_Options
00033 {
00034 public:
00035 
00036   enum SERVICE_COMMAND {
00037     SC_NONE,
00038     SC_INSTALL,
00039     SC_REMOVE,
00040     SC_INSTALL_NO_LOCATOR
00041   };
00042 
00043   Activator_Options ();
00044 
00045   /// Parse the command-line arguments and initialize the options.
00046   int init (int argc, char *argv[]);
00047   /// This version should only be used when run as an nt service.
00048   int init_from_registry();
00049 
00050   /// Service Mode
00051   bool service (void) const;
00052 
00053   /// Notify the ImR when server processes die.
00054   /// Note : Currently this only works on Unix.
00055   bool notify_imr (void) const;
00056 
00057   /// Debug level for the Implementation Repository.
00058   unsigned int debug (void) const;
00059 
00060   /// Returns the file where the IOR should be stored.
00061   const ACE_CString& ior_filename (void) const;
00062 
00063   /// The nt service command to run (install/remove)
00064   SERVICE_COMMAND service_command(void) const;
00065 
00066   /// Save the command line arguments as registry settings. (Windows only)
00067   int save_registry_options ();
00068 
00069   const char* cmdline(void) const;
00070 
00071   const ACE_CString& name(void) const;
00072 
00073 private:
00074   /// Parses and pulls out arguments for the ImR
00075   int parse_args (int &argc, char *argv[]);
00076 
00077   /// Print the usage information.
00078   void print_usage (void) const;
00079 
00080   /// Loads options from the registry
00081   int load_registry_options ();
00082 
00083 private:
00084 
00085   /// Our extra command line arguments
00086   ACE_CString cmdline_;
00087 
00088   /// Debug level.
00089   unsigned int debug_;
00090 
00091   /// File where the IOR of the server object is stored.
00092   ACE_CString ior_output_file_;
00093 
00094   /// Should we run as a service?
00095   bool service_;
00096 
00097   bool notify_imr_;
00098 
00099   /// SC_NONE, SC_INSTALL, SC_REMOVE, ...
00100   SERVICE_COMMAND service_command_;
00101 
00102   ACE_CString name_;
00103 };
00104 
00105 #endif

Generated on Thu Nov 9 13:36:19 2006 for TAO_Implementation_Repository by doxygen 1.3.6