00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef LOCATOR_OPTIONS_H
00016 #define LOCATOR_OPTIONS_H
00017
00018 #include "locator_export.h"
00019
00020 #include "ace/SString.h"
00021 #include "ace/Time_Value.h"
00022
00023 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00024 # pragma once
00025 #endif
00026
00027
00028
00029
00030
00031
00032
00033
00034 class Locator_Export Options
00035 {
00036 public:
00037
00038 enum SERVICE_COMMAND {
00039 SC_NONE,
00040 SC_INSTALL,
00041 SC_REMOVE
00042 };
00043
00044 enum RepoMode {
00045 REPO_NONE,
00046 REPO_XML_FILE,
00047 REPO_HEAP_FILE,
00048 REPO_REGISTRY
00049 };
00050
00051 Options ();
00052
00053
00054 int init (int argc, char *argv[]);
00055
00056 int init_from_registry();
00057
00058
00059 bool service (void) const;
00060
00061
00062 unsigned int debug (void) const;
00063
00064
00065 const ACE_TString& ior_filename (void) const;
00066
00067
00068 bool multicast (void) const;
00069
00070
00071 SERVICE_COMMAND service_command(void) const;
00072
00073 int save_registry_options();
00074
00075 const char* cmdline(void) const;
00076
00077
00078
00079 const ACE_TString& persist_file_name(void) const;
00080
00081
00082 bool readonly (void) const;
00083
00084 RepoMode repository_mode (void) const;
00085
00086
00087 bool repository_erase (void) const;
00088
00089
00090 ACE_Time_Value startup_timeout (void) const;
00091
00092
00093
00094
00095 ACE_Time_Value ping_interval (void) const;
00096
00097 private:
00098
00099 int parse_args (int &argc, char *argv[]);
00100
00101
00102 void print_usage (void) const;
00103
00104
00105 int run_service_command (const ACE_TString& cmdline);
00106
00107 int load_registry_options();
00108 private:
00109
00110
00111 RepoMode repo_mode_;
00112
00113
00114 bool erase_repo_;
00115
00116
00117 unsigned int debug_;
00118
00119
00120 ACE_TString ior_output_file_;
00121
00122
00123 bool multicast_;
00124
00125
00126 bool service_;
00127
00128
00129 ACE_Time_Value ping_interval_;
00130
00131
00132 ACE_Time_Value startup_timeout_;
00133
00134
00135 bool readonly_;
00136
00137
00138 SERVICE_COMMAND service_command_;
00139
00140
00141 ACE_CString cmdline_;
00142
00143
00144 ACE_TString persist_file_name_;
00145 };
00146
00147 #endif