Config.h
Go to the documentation of this file.
00001 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
00002 
00003 // -- BEGIN LICENSE BLOCK ----------------------------------------------
00004 // This file is part of FZIs ic_workspace.
00005 //
00006 // This program is free software licensed under the LGPL
00007 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
00008 // You can find a copy of this license in LICENSE folder in the top
00009 // directory of the source code.
00010 //
00011 // © Copyright 2014 FZI Forschungszentrum Informatik, Karlsruhe, Germany
00012 //
00013 // -- END LICENSE BLOCK ------------------------------------------------
00014 
00015 //----------------------------------------------------------------------
00026 //----------------------------------------------------------------------
00027 #ifndef ICL_CORE_CONFIG_CONFIG_H_INCLUDED
00028 #define ICL_CORE_CONFIG_CONFIG_H_INCLUDED
00029 
00030 #include <boost/foreach.hpp>
00031 
00032 #include <icl_core/BaseTypes.h>
00033 #include <icl_core/EnumHelper.h>
00034 #include <icl_core/StringHelper.h>
00035 #include <icl_core/TemplateHelper.h>
00036 #include <icl_core_logging/Logging.h>
00037 
00038 #include "icl_core_config/ImportExport.h"
00039 #include "icl_core_config/ConfigIterator.h"
00040 #include "icl_core_config/ConfigManager.h"
00041 #include "icl_core_config/ConfigParameter.h"
00042 #include "icl_core_config/ConfigValues.h"
00043 #include "icl_core_config/GetoptParser.h"
00044 #include "icl_core_config/GetoptParameter.h"
00045 #include "icl_core_config/Util.h"
00046 
00047 #ifdef _IC_BUILDER_OPENSPLICEDDS_
00048 # include "dds_dcps.h"
00049 #endif
00050 
00051 #ifdef _IC_BUILDER_DEPRECATED_STYLE_
00052 
00053 // -- START Deprecated compatibility headers --
00054 #include "icl_core_config/tConfig.h"
00055 #include "icl_core_config/tConfigIterator.h"
00056 #include "icl_core_config/tConfigParameter.h"
00057 #include "icl_core_config/tConfigValues.h"
00058 #include "icl_core_config/tGetopt.h"
00059 #include "icl_core_config/tGetoptParameter.h"
00060 // -- END Deprecated compatibility headers --
00061 
00062 # include "icl_core/Deprecate.h"
00063 #endif
00064 
00065 namespace icl_core {
00067 namespace config {
00068 
00069 extern ICL_CORE_CONFIG_IMPORT_EXPORT const char * CONFIGFILE_CONFIG_KEY;
00070 
00071 ICL_CORE_CONFIG_IMPORT_EXPORT void dump();
00072 
00073 ICL_CORE_CONFIG_IMPORT_EXPORT void debugOutCommandLine(int argc, char *argv[]);
00074 
00075 ICL_CORE_CONFIG_IMPORT_EXPORT ConfigIterator find(const icl_core::String& query);
00076 
00078 template <typename T>
00079 bool get(const icl_core::String& key, typename icl_core::ConvertToRef<T>::ToRef value);
00080 
00082 template <typename T>
00083 bool get(const char *key, typename icl_core::ConvertToRef<T>::ToRef value)
00084 {
00085   return get<T>(icl_core::String(key), value);
00086 }
00087 
00089 template <typename T>
00090 bool get(const icl_core::String& key, typename icl_core::ConvertToRef<T>::ToRef value)
00091 {
00092   icl_core::String str_value;
00093   if (ConfigManager::instance().get(key, str_value))
00094   {
00095     try
00096     {
00097       value = impl::hexical_cast<T>(str_value);
00098       return true;
00099     }
00100     catch (...)
00101     {
00102       return false;
00103     }
00104   }
00105   else
00106   {
00107     return false;
00108   }
00109 }
00110 
00112 template <>
00113 inline
00114 bool get<icl_core::String>(const icl_core::String& key, icl_core::String& value)
00115 {
00116   return ConfigManager::instance().get(key, value);
00117 }
00118 
00120 template <>
00121 inline
00122 bool get<bool>(const icl_core::String& key, bool& value)
00123 {
00124   icl_core::String str_value;
00125   if (ConfigManager::instance().get(key, str_value))
00126   {
00127     str_value = toLower(str_value);
00128     if (str_value == "0" || str_value == "no" || str_value == "false")
00129     {
00130       value = false;
00131       return true;
00132     }
00133     else if (str_value == "1" || str_value == "yes" || str_value == "true")
00134     {
00135       value = true;
00136       return true;
00137     }
00138     else
00139     {
00140       return false;
00141     }
00142   }
00143   else
00144   {
00145     return false;
00146   }
00147 }
00148 
00149 #ifdef _IC_BUILDER_OPENSPLICEDDS_
00150 
00151 template<>
00152 inline
00153 bool get<DDS::String>(const icl_core::String& key, DDS::String& value)
00154 {
00155   icl_core::String str_value;
00156   if (ConfigManager::instance().get(key, str_value))
00157   {
00158     value = DDS::string_dup(str_value.c_str());
00159     return true;
00160   }
00161   else
00162   {
00163     return false;
00164   }
00165 }
00166 #endif
00167 
00168 template <typename T>
00169 bool get(const icl_core::String& key, typename icl_core::ConvertToRef<T>::ToRef value,
00170          const char *descriptions[], const char *end_marker = NULL)
00171 {
00172   icl_core::String str_value;
00173   if (ConfigManager::instance().get(key, str_value))
00174   {
00175     int32_t raw_value;
00176     if (icl_core::string2Enum(str_value, raw_value, descriptions, end_marker))
00177     {
00178       value = T(raw_value);
00179       return true;
00180     }
00181     else
00182     {
00183       return false;
00184     }
00185   }
00186   else
00187   {
00188     return false;
00189   }
00190 }
00191 
00192 template <typename T>
00193 bool get(const char *key, typename icl_core::ConvertToRef<T>::ToRef value,
00194          const char *descriptions[], const char *end_marker = NULL)
00195 {
00196   return get<T>(icl_core::String(key), value, descriptions, end_marker);
00197 }
00198 
00199 template <typename T>
00200 T getDefault(const icl_core::String& key, typename icl_core::ConvertToRef<T>::ToConstRef default_value)
00201 {
00202   T value = default_value;
00203   get<T> (key, value);
00204   return value;
00205 }
00206 
00207 template <typename T>
00208 T getDefault(const char *key, typename icl_core::ConvertToRef<T>::ToConstRef default_value)
00209 {
00210   return getDefault<T> (icl_core::String(key), default_value);
00211 }
00212 
00213 template <> inline
00214 icl_core::String getDefault<icl_core::String>(const icl_core::String& key,
00215                                               const icl_core::String& default_value)
00216 {
00217   icl_core::String value = default_value;
00218   get<icl_core::String>(key, value);
00219   return value;
00220 }
00221 
00222 #ifdef _IC_BUILDER_OPENSPLICEDDS_
00223 template<>
00224 inline
00225 DDS::String getDefault<DDS::String>(const icl_core::String& key,
00226                                     const DDS::String& default_value)
00227 {
00228   DDS::String value = default_value;
00229   get<DDS::String>(key, value);
00230   return value;
00231 }
00232 #endif
00233 
00240 inline
00241 bool get(const ConfigValues config_values, icl_core::logging::LogStream& log_stream,
00242          bool cleanup = true, bool report_error = true)
00243 {
00244   // Read the configuration parameters.
00245   bool result = true;
00246   const impl::ConfigValueIface *const*config = config_values;
00247   while (*config != NULL)
00248   {
00249     if ((*config)->get())
00250     {
00251       SLOGGING_TRACE(log_stream, "Read configuration parameter \""
00252                      << (*config)->key() << "\" = \"" << (*config)->stringValue()
00253                      << "\"." << icl_core::logging::endl);
00254     }
00255     else
00256     {
00257       if (report_error)
00258       {
00259         SLOGGING_ERROR(log_stream, "Error reading configuration parameter \""
00260                        << (*config)->key() << "\"!" << icl_core::logging::endl);
00261       }
00262       else
00263       {
00264         SLOGGING_TRACE(log_stream, "Could not read configuration parameter \""
00265                        << (*config)->key() << "\"." << icl_core::logging::endl);
00266       }
00267       result = false;
00268     }
00269     ++config;
00270   }
00271 
00272   // Cleanup!
00273   if (cleanup)
00274   {
00275     config = config_values;
00276     while (*config != NULL)
00277     {
00278       delete *config;
00279       ++config;
00280     }
00281   }
00282 
00283   return result;
00284 }
00285 
00292 inline
00293 bool get(std::string config_prefix,
00294          ConfigValueList config_values, icl_core::logging::LogStream& log_stream,
00295          bool cleanup = true, bool report_error = true)
00296 {
00297   /* Remark: config_values has to be passed by value, not by reference.
00298    *         Otherwise boost::assign::list_of() can not work correctly.
00299    */
00300 
00301   // Add a trailing slash, if necessary.
00302   if (config_prefix != "" && config_prefix[config_prefix.length() - 1] != '/')
00303   {
00304     config_prefix = config_prefix + "/";
00305   }
00306 
00307   // Read the configuration parameters.
00308   bool result = false;
00309   bool error = false;
00310   BOOST_FOREACH(impl::ConfigValueIface const * config, config_values)
00311   {
00312     if (config->get(config_prefix, log_stream))
00313     {
00314       SLOGGING_TRACE(log_stream, "Read configuration parameter \""
00315                      << config_prefix << config->key() << "\" = \"" << config->stringValue()
00316                      << "\"." << icl_core::logging::endl);
00317     }
00318     else
00319     {
00320       if (report_error)
00321       {
00322         SLOGGING_ERROR(log_stream, "Error reading configuration parameter \""
00323                        << config_prefix << config->key() << "\"!" << icl_core::logging::endl);
00324       }
00325       else
00326       {
00327         SLOGGING_TRACE(log_stream, "Could not read configuration parameter \""
00328                        << config_prefix << config->key() << "\"." << icl_core::logging::endl);
00329       }
00330       error = true;
00331     }
00332     result = true;
00333   }
00334 
00335   if (error)
00336   {
00337     result = false;
00338   }
00339 
00340   // Cleanup!
00341   if (cleanup)
00342   {
00343     BOOST_FOREACH(impl::ConfigValueIface * config, config_values)
00344     {
00345       delete config;
00346     }
00347   }
00348 
00349   return result;
00350 }
00351 
00352 inline
00353 bool get(ConfigValueList config_values, icl_core::logging::LogStream& log_stream,
00354          bool cleanup = true, bool report_error = true)
00355 {
00356   return get("", config_values, log_stream, cleanup, report_error);
00357 }
00358 
00359 template <typename T>
00360 void setValue(const icl_core::String& key, typename icl_core::ConvertToRef<T>::ToConstRef value)
00361 {
00362   ConfigManager::instance().setValue<T>(key, value);
00363 }
00364 
00365 template <typename T>
00366 void setValue(const char *key, typename icl_core::ConvertToRef<T>::ToConstRef value)
00367 {
00368   ConfigManager::instance().setValue<T>(icl_core::String(key), value);
00369 }
00370 
00371 inline
00372 void setValue(const icl_core::String& key, const icl_core::String& value)
00373 {
00374   setValue<icl_core::String>(key, value);
00375 }
00376 
00377 inline
00378 bool paramOptPresent(const icl_core::String& name)
00379 {
00380   return Getopt::instance().paramOptPresent(name);
00381 }
00382 
00383 template <typename T>
00384 bool paramOpt(const icl_core::String& name, typename icl_core::ConvertToRef<T>::ToRef value)
00385 {
00386   Getopt& getopt = Getopt::instance();
00387   if (getopt.paramOptPresent(name))
00388   {
00389     try
00390     {
00391       value = impl::hexical_cast<T>(getopt.paramOpt(name));
00392       return true;
00393     }
00394     catch (...)
00395     {
00396       return false;
00397     }
00398   }
00399   else
00400   {
00401     return false;
00402   }
00403 }
00404 template <typename T>
00405 bool paramOpt(const char *name, typename icl_core::ConvertToRef<T>::ToRef value)
00406 {
00407   return paramOpt<T>(icl_core::String(name), value);
00408 }
00409 
00410 template <typename T>
00411 bool paramOpt(const icl_core::String& name, typename icl_core::ConvertToRef<T>::ToRef value,
00412               const char *descriptions[], const char *end_marker = NULL)
00413 {
00414   Getopt& getopt = Getopt::instance();
00415   if (getopt.paramOptPresent(name))
00416   {
00417     icl_core::String str_value = getopt.paramOpt(name);
00418     int32_t raw_value;
00419     if (icl_core::string2Enum(str_value, raw_value, descriptions, end_marker))
00420     {
00421       value = T(raw_value);
00422       return true;
00423     }
00424     else
00425     {
00426       return false;
00427     }
00428   }
00429   else
00430   {
00431     return false;
00432   }
00433 }
00434 
00435 template <typename T>
00436 bool paramOpt(const char *name, typename icl_core::ConvertToRef<T>::ToRef value,
00437               const char *descriptions[], const char *end_marker = NULL)
00438 {
00439   return paramOpt<T>(icl_core::String(name), value, descriptions, end_marker);
00440 }
00441 
00442 template <typename T>
00443 T paramOptDefault(const icl_core::String& name, typename icl_core::ConvertToRef<T>::ToConstRef default_value)
00444 {
00445   Getopt& getopt = Getopt::instance();
00446   if (getopt.paramOptPresent(name))
00447   {
00448     try
00449     {
00450       return impl::hexical_cast<T>(getopt.paramOpt(name));
00451     }
00452     catch (...)
00453     {
00454       return default_value;
00455     }
00456   }
00457   else
00458   {
00459     return default_value;
00460   }
00461 }
00462 
00463 template <typename T>
00464 T paramOptDefault(const char *name, typename icl_core::ConvertToRef<T>::ToConstRef default_value)
00465 {
00466   return paramOptDefault<T>(icl_core::String(name), default_value);
00467 }
00468 
00469 template <typename T>
00470 bool paramNonOpt(size_t index, typename icl_core::ConvertToRef<T>::ToRef value)
00471 {
00472   Getopt& getopt = Getopt::instance();
00473   if (index < getopt.paramNonOptCount())
00474   {
00475     try
00476     {
00477       value = impl::hexical_cast<T>(getopt.paramNonOpt(index));
00478       return true;
00479     }
00480     catch (...)
00481     {
00482       return false;
00483     }
00484   }
00485   else
00486   {
00487     return false;
00488   }
00489 }
00490 
00491 template <typename T>
00492 bool paramNonOpt(size_t index, typename icl_core::ConvertToRef<T>::ToRef value,
00493                  const char *descriptions[], const char *end_marker = NULL)
00494 {
00495   Getopt& getopt = Getopt::instance();
00496   if (index < getopt.paramNonOptCount())
00497   {
00498     icl_core::String str_value = getopt.paramNonOpt(index);
00499     int32_t raw_value;
00500     if (icl_core::string2Enum(str_value, raw_value, descriptions, end_marker))
00501     {
00502       value = T(raw_value);
00503       return true;
00504     }
00505     else
00506     {
00507       return false;
00508     }
00509   }
00510   else
00511   {
00512     return false;
00513   }
00514 }
00515 
00516 inline icl_core::String paramNonOpt(size_t index)
00517 {
00518   return Getopt::instance().paramNonOpt(index);
00519 }
00520 
00521 inline size_t extraCmdParamCount()
00522 {
00523   return Getopt::instance().extraCmdParamCount();
00524 }
00525 
00526 inline icl_core::String extraCmdParam(size_t index)
00527 {
00528   return Getopt::instance().extraCmdParam(index);
00529 }
00530 
00531 inline void activateExtraCmdParams(const icl_core::String& delimiter = "--")
00532 {
00533   Getopt::instance().activateExtraCmdParams(delimiter);
00534 }
00535 
00536 inline size_t paramNonOptCount()
00537 {
00538   return Getopt::instance().paramNonOptCount();
00539 }
00540 
00541 inline void addParameter(const ConfigParameter& parameter)
00542 {
00543   ConfigManager::instance().addParameter(parameter);
00544 }
00545 
00546 inline void addParameter(const ConfigParameterList& parameters)
00547 {
00548   ConfigManager::instance().addParameter(parameters);
00549 }
00550 
00551 inline void addParameter(const ConfigPositionalParameter& parameter)
00552 {
00553   ConfigManager::instance().addParameter(parameter);
00554 }
00555 
00556 inline void addParameter(const ConfigPositionalParameterList& parameters)
00557 {
00558   ConfigManager::instance().addParameter(parameters);
00559 }
00560 
00561 inline void addParameter(const GetoptParameter& parameter)
00562 {
00563   Getopt::instance().addParameter(parameter);
00564 }
00565 
00566 inline void addParameter(const GetoptParameterList& parameters)
00567 {
00568   Getopt::instance().addParameter(parameters);
00569 }
00570 
00571 inline void addParameter(const GetoptPositionalParameter& parameter)
00572 {
00573   Getopt::instance().addParameter(parameter);
00574 }
00575 
00576 inline void addParameter(const GetoptPositionalParameterList& parameters)
00577 {
00578   Getopt::instance().addParameter(parameters);
00579 }
00580 
00581 inline void setProgramVersion(icl_core::String const & version)
00582 {
00583   Getopt::instance().setProgramVersion(version);
00584 }
00585 
00586 inline void setProgramDescription(icl_core::String const & description)
00587 {
00588   Getopt::instance().setProgramDescription(description);
00589 }
00590 
00591 inline void printHelp()
00592 {
00593   Getopt::instance().printHelp();
00594 }
00595 
00596 ICL_CORE_CONFIG_IMPORT_EXPORT bool initialize(int& argc, char *argv[], bool remove_read_arguments);
00597 
00598 ICL_CORE_CONFIG_IMPORT_EXPORT
00599 bool initialize(int& argc, char *argv[],
00600                 Getopt::CommandLineCleaning cleanup = Getopt::eCLC_None,
00601                 Getopt::ParameterRegistrationCheck registration_check = Getopt::ePRC_Strict);
00602 
00604 //#ifdef _IC_BUILDER_DEPRECATED_STYLE_
00605 
00606 ICL_CORE_VC_DEPRECATE_STYLE
00607 void Dump()
00608 ICL_CORE_GCC_DEPRECATE_STYLE;
00609 inline void Dump()
00610 { dump(); }
00611 
00612 ICL_CORE_VC_DEPRECATE_STYLE
00613 void DebugOutCommandLine(int argc, char *argv[])
00614 ICL_CORE_GCC_DEPRECATE_STYLE;
00615 inline void DebugOutCommandLine(int argc, char *argv[])
00616 { debugOutCommandLine(argc, argv); }
00617 
00618 ICL_CORE_VC_DEPRECATE_STYLE
00619 ConfigIterator Find(const icl_core::String& query)
00620 ICL_CORE_GCC_DEPRECATE_STYLE;
00621 inline ConfigIterator Find(const icl_core::String& query)
00622 { return find(query); }
00623 
00627 template <typename T>
00628 bool Get(const icl_core::String& key,
00629          typename icl_core::ConvertToRef<T>::ToRef value) ICL_CORE_GCC_DEPRECATE_STYLE;
00630 
00634 template <typename T>
00635 bool Get(const char *key, typename icl_core::ConvertToRef<T>::ToRef value) ICL_CORE_GCC_DEPRECATE_STYLE;
00636 template <typename T>
00637 ICL_CORE_VC_DEPRECATE_STYLE bool Get(const char *key, typename icl_core::ConvertToRef<T>::ToRef value)
00638 { return get<T>(key, value); }
00639 
00643 template <typename T>
00644 bool Get(const icl_core::String& key,
00645          typename icl_core::ConvertToRef<T>::ToRef value)
00646 ICL_CORE_GCC_DEPRECATE_STYLE;
00647 template <typename T> inline
00648 ICL_CORE_VC_DEPRECATE_STYLE bool Get(const icl_core::String& key,
00649                                      typename icl_core::ConvertToRef<T>::ToRef value)
00650 { return get<T>(key, value); }
00651 
00655 template <>
00656 bool Get<icl_core::String>(const icl_core::String& key,
00657                            icl_core::String& value)
00658 ICL_CORE_GCC_DEPRECATE_STYLE;
00659 template <> inline
00660 ICL_CORE_VC_DEPRECATE_STYLE bool Get<icl_core::String>(const icl_core::String& key,
00661                                                        icl_core::String& value)
00662 { return get<icl_core::String>(key, value); }
00663 
00667 template <>
00668 bool Get<bool>(const icl_core::String& key, bool& value)
00669 ICL_CORE_GCC_DEPRECATE_STYLE;
00670 template <> inline
00671 ICL_CORE_VC_DEPRECATE_STYLE bool Get<bool>(const icl_core::String& key, bool& value)
00672 { return get<bool>(key, value); }
00673 
00674 template <typename T>
00675 bool Get(const icl_core::String& key,
00676          typename icl_core::ConvertToRef<T>::ToRef value,
00677          const char *descriptions[],
00678          const char *end_marker = NULL)
00679 ICL_CORE_GCC_DEPRECATE_STYLE;
00680 template <typename T>
00681 ICL_CORE_VC_DEPRECATE_STYLE bool Get(const icl_core::String& key,
00682                                      typename icl_core::ConvertToRef<T>::ToRef value,
00683                                      const char *descriptions[],
00684                                      const char *end_marker)
00685 { return get<T>(key, value, descriptions, end_marker); }
00686 
00687 template <typename T>
00688 bool Get(const char *key,
00689          typename icl_core::ConvertToRef<T>::ToRef value,
00690          const char *descriptions[],
00691          const char *end_marker = NULL)
00692 ICL_CORE_GCC_DEPRECATE_STYLE;
00693 template <typename T>
00694 ICL_CORE_VC_DEPRECATE_STYLE bool Get(const char *key,
00695                                      typename icl_core::ConvertToRef<T>::ToRef value,
00696                                      const char *descriptions[],
00697                                      const char *end_marker)
00698 { return get<T>(key, value, descriptions, end_marker); }
00699 
00700 template <typename T>
00701 T GetDefault(const icl_core::String& key,
00702              typename icl_core::ConvertToRef<T>::ToConstRef default_value)
00703 ICL_CORE_GCC_DEPRECATE_STYLE;
00704 template <typename T>
00705 ICL_CORE_VC_DEPRECATE_STYLE T GetDefault(const icl_core::String& key,
00706                                          typename icl_core::ConvertToRef<T>::ToConstRef default_value)
00707 { return getDefault<T>(key, default_value); }
00708 
00709 template <typename T>
00710 T GetDefault(const char *key,
00711              typename icl_core::ConvertToRef<T>::ToConstRef default_value)
00712 ICL_CORE_GCC_DEPRECATE_STYLE;
00713 template <typename T>
00714 ICL_CORE_VC_DEPRECATE_STYLE T GetDefault(const char *key,
00715                                          typename icl_core::ConvertToRef<T>::ToConstRef default_value)
00716 { return getDefault<T>(key, default_value); }
00717 
00718 template <>
00719 icl_core::String GetDefault<icl_core::String>(const icl_core::String& key,
00720                                               const icl_core::String& default_value)
00721 ICL_CORE_GCC_DEPRECATE_STYLE;
00722 template <> inline
00723 ICL_CORE_VC_DEPRECATE_STYLE
00724 icl_core::String GetDefault<icl_core::String>(const icl_core::String& key,
00725                                               const icl_core::String& default_value)
00726 { return getDefault<icl_core::String>(key, default_value); }
00727 
00731 ICL_CORE_VC_DEPRECATE_STYLE
00732 bool Get(const ConfigValues config_values,
00733          icl_core::logging::LogStream& log_stream, bool cleanup = true)
00734 ICL_CORE_GCC_DEPRECATE_STYLE;
00735 inline bool Get(const ConfigValues config_values,
00736                 icl_core::logging::LogStream& log_stream, bool cleanup)
00737 { return get(config_values, log_stream, cleanup); }
00738 
00739 template <typename T>
00740 void SetValue(const icl_core::String& key,
00741               typename icl_core::ConvertToRef<T>::ToConstRef value)
00742 ICL_CORE_GCC_DEPRECATE_STYLE;
00743 template <typename T>
00744 ICL_CORE_VC_DEPRECATE_STYLE void SetValue(const icl_core::String& key,
00745                                           typename icl_core::ConvertToRef<T>::ToConstRef value)
00746 { setValue<T>(key, value); }
00747 
00748 template <typename T>
00749 void SetValue(const char *key,
00750               typename icl_core::ConvertToRef<T>::ToConstRef value)
00751 ICL_CORE_GCC_DEPRECATE_STYLE;
00752 template <typename T>
00753 ICL_CORE_VC_DEPRECATE_STYLE void SetValue(const char *key,
00754                                           typename icl_core::ConvertToRef<T>::ToConstRef value)
00755 { setValue<T>(key, value); }
00756 
00757 ICL_CORE_VC_DEPRECATE_STYLE
00758 void SetValue(const icl_core::String& key, const icl_core::String& value)
00759 ICL_CORE_GCC_DEPRECATE_STYLE;
00760 inline void SetValue(const icl_core::String& key, const icl_core::String& value)
00761 { setValue(key, value); }
00762 
00763 ICL_CORE_VC_DEPRECATE_STYLE
00764 bool ParamOptPresent(const icl_core::String& name)
00765 ICL_CORE_GCC_DEPRECATE_STYLE;
00766 inline bool ParamOptPresent(const icl_core::String& name)
00767 { return paramOptPresent(name); }
00768 
00769 template <typename T>
00770 bool ParamOpt(const icl_core::String& name,
00771               typename icl_core::ConvertToRef<T>::ToRef value)
00772 ICL_CORE_GCC_DEPRECATE_STYLE;
00773 template <typename T>
00774 ICL_CORE_VC_DEPRECATE_STYLE bool ParamOpt(const icl_core::String& name,
00775                                           typename icl_core::ConvertToRef<T>::ToRef value)
00776 { return paramOpt<T>(name, value); }
00777 
00778 template <typename T>
00779 bool ParamOpt(const char *name, typename icl_core::ConvertToRef<T>::ToRef value)
00780 ICL_CORE_GCC_DEPRECATE_STYLE;
00781 template <typename T>
00782 ICL_CORE_VC_DEPRECATE_STYLE bool ParamOpt(const char *name, typename icl_core::ConvertToRef<T>::ToRef value)
00783 { return paramOpt<T>(name, value); }
00784 
00785 template <typename T>
00786 bool ParamOpt(const icl_core::String& name, typename icl_core::ConvertToRef<T>::ToRef value,
00787               const char *descriptions[], const char *end_marker = NULL)
00788 ICL_CORE_GCC_DEPRECATE_STYLE;
00789 template <typename T>
00790 ICL_CORE_VC_DEPRECATE_STYLE
00791 bool ParamOpt(const icl_core::String& name, typename icl_core::ConvertToRef<T>::ToRef value,
00792               const char *descriptions[], const char *end_marker)
00793 { return paramOpt<T>(name, value, descriptions, end_marker); }
00794 
00795 template <typename T>
00796 bool ParamOpt(const char *name, typename icl_core::ConvertToRef<T>::ToRef value,
00797               const char *descriptions[], const char *end_marker = NULL)
00798 ICL_CORE_GCC_DEPRECATE_STYLE;
00799 template <typename T>
00800 ICL_CORE_VC_DEPRECATE_STYLE
00801 bool ParamOpt(const char *name, typename icl_core::ConvertToRef<T>::ToRef value,
00802               const char *descriptions[], const char *end_marker)
00803 { return paramOpt<T>(name, value, descriptions, end_marker); }
00804 
00805 template <typename T>
00806 T ParamOptDefault(const icl_core::String& name, typename icl_core::ConvertToRef<T>::ToConstRef default_value)
00807 ICL_CORE_GCC_DEPRECATE_STYLE;
00808 template <typename T>
00809 ICL_CORE_VC_DEPRECATE_STYLE
00810 T ParamOptDefault(const icl_core::String& name, typename icl_core::ConvertToRef<T>::ToConstRef default_value)
00811 { return paramOptDefault<T>(name, default_value); }
00812 
00813 template <typename T>
00814 T ParamOptDefault(const char *name, typename icl_core::ConvertToRef<T>::ToConstRef default_value)
00815 ICL_CORE_GCC_DEPRECATE_STYLE;
00816 template <typename T>
00817 ICL_CORE_VC_DEPRECATE_STYLE
00818 T ParamOptDefault(const char *name, typename icl_core::ConvertToRef<T>::ToConstRef default_value)
00819 { return paramOptDefault<T>(name, default_value); }
00820 
00821 template <typename T>
00822 bool ParamNonOpt(size_t index, typename icl_core::ConvertToRef<T>::ToRef value)
00823 ICL_CORE_GCC_DEPRECATE_STYLE;
00824 template <typename T>
00825 ICL_CORE_VC_DEPRECATE_STYLE
00826 bool ParamNonOpt(size_t index, typename icl_core::ConvertToRef<T>::ToRef value)
00827 { return paramNonOpt<T>(index, value); }
00828 
00829 template <typename T>
00830 bool ParamNonOpt(size_t index, typename icl_core::ConvertToRef<T>::ToRef value,
00831                  const char *descriptions[], const char *end_marker = NULL)
00832 ICL_CORE_GCC_DEPRECATE_STYLE;
00833 template <typename T>
00834 ICL_CORE_VC_DEPRECATE_STYLE
00835 bool ParamNonOpt(size_t index, typename icl_core::ConvertToRef<T>::ToRef value,
00836                  const char *descriptions[], const char *end_marker)
00837 { return paramNonOpt<T>(index, value, descriptions, end_marker); }
00838 
00839 ICL_CORE_VC_DEPRECATE_STYLE
00840 icl_core::String ParamNonOpt(size_t index)
00841 ICL_CORE_GCC_DEPRECATE_STYLE;
00842 inline icl_core::String ParamNonOpt(size_t index)
00843 { return paramNonOpt(index); }
00844 
00845 ICL_CORE_VC_DEPRECATE_STYLE
00846 size_t ExtraCmdParamCount()
00847 ICL_CORE_GCC_DEPRECATE_STYLE;
00848 inline size_t ExtraCmdParamCount()
00849 { return extraCmdParamCount(); }
00850 
00851 ICL_CORE_VC_DEPRECATE_STYLE
00852 icl_core::String ExtraCmdParam(size_t index)
00853 ICL_CORE_GCC_DEPRECATE_STYLE;
00854 inline icl_core::String ExtraCmdParam(size_t index)
00855 { return extraCmdParam(index); }
00856 
00857 ICL_CORE_VC_DEPRECATE_STYLE
00858 void ActivateExtraCmdParams(const icl_core::String& delimiter = "--")
00859 ICL_CORE_GCC_DEPRECATE_STYLE;
00860 inline void ActivateExtraCmdParams(const icl_core::String& delimiter)
00861 { activateExtraCmdParams(delimiter); }
00862 
00863 ICL_CORE_VC_DEPRECATE_STYLE
00864 size_t ParamNonOptCount()
00865 ICL_CORE_GCC_DEPRECATE_STYLE;
00866 inline size_t ParamNonOptCount()
00867 { return paramNonOptCount(); }
00868 
00869 ICL_CORE_VC_DEPRECATE_STYLE
00870 void AddParameter(const ConfigParameter& parameter)
00871 ICL_CORE_GCC_DEPRECATE_STYLE;
00872 inline void AddParameter(const ConfigParameter& parameter)
00873 { addParameter(parameter); }
00874 
00875 ICL_CORE_VC_DEPRECATE_STYLE
00876 void AddParameter(const ConfigParameterList& parameters)
00877 ICL_CORE_GCC_DEPRECATE_STYLE;
00878 inline void AddParameter(const ConfigParameterList& parameters)
00879 { addParameter(parameters); }
00880 
00881 ICL_CORE_VC_DEPRECATE_STYLE
00882 void AddParameter(const GetoptParameter& parameter)
00883 ICL_CORE_GCC_DEPRECATE_STYLE;
00884 inline void AddParameter(const GetoptParameter& parameter)
00885 { addParameter(parameter); }
00886 
00887 ICL_CORE_VC_DEPRECATE_STYLE
00888 void AddParameter(const GetoptParameterList& parameters)
00889 ICL_CORE_GCC_DEPRECATE_STYLE;
00890 inline void AddParameter(const GetoptParameterList& parameters)
00891 { addParameter(parameters); }
00892 
00893 ICL_CORE_VC_DEPRECATE_STYLE
00894 void PrintHelp()
00895 ICL_CORE_GCC_DEPRECATE_STYLE;
00896 inline void PrintHelp()
00897 { printHelp(); }
00898 
00899 ICL_CORE_VC_DEPRECATE_STYLE
00900 bool Initialize(int& argc, char *argv[], bool remove_read_arguments)
00901 ICL_CORE_GCC_DEPRECATE_STYLE;
00902 inline bool Initialize(int& argc, char *argv[], bool remove_read_arguments)
00903 { return initialize(argc, argv, remove_read_arguments); }
00904 
00905 ICL_CORE_VC_DEPRECATE_STYLE
00906 bool Initialize(int& argc, char *argv[],
00907                 Getopt::CommandLineCleaning cleanup = Getopt::eCLC_None,
00908                 Getopt::ParameterRegistrationCheck registration_check = Getopt::ePRC_Strict)
00909 ICL_CORE_GCC_DEPRECATE_STYLE;
00910 inline bool Initialize(int& argc, char *argv[],
00911                 Getopt::CommandLineCleaning cleanup,
00912                 Getopt::ParameterRegistrationCheck registration_check)
00913 { return initialize(argc, argv, cleanup, registration_check); }
00914 
00915 //#endif
00917 
00918 }
00919 }
00920 
00921 #endif


schunk_svh_driver
Author(s): Georg Heppner
autogenerated on Fri Aug 28 2015 12:59:18