wrappedoption_imp.hpp 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #ifndef WRAPPEDOPTION_IMP_HPP
  2. #define WRAPPEDOPTION_IMP_HPP
  3. #include <fstream>
  4. #include "wrappedoption.hpp"
  5. using namespace std;
  6. /** class for processing a float as Anyoption parameters
  7. */
  8. class floatWrappedOption: public WrappedOption
  9. {
  10. float *Value;
  11. public:
  12. floatWrappedOption(const char* OptionName, char ShortCut, float *Value, const float DefaultValue, bool _CmdLineOnly=false);
  13. // virtual void setOption(AnyOption *opt);
  14. virtual void getOption(AnyOption *opt);
  15. virtual void Save(fstream &fw);
  16. };
  17. /** class for processing a vector of floats as Anyoption parameters
  18. usage in ini file:
  19. @verbatim ParaRange : 0.3 0.5 0.6 @endverbatim
  20. usage via command line: list of values must be enclosed in quotes (")!
  21. @verbatim ./simsom03 --ParaRange "0.4 0.5 0.7" @endverbatim
  22. */
  23. class floatVectWrappedOption: public WrappedOption
  24. {
  25. vector<float> *Value;
  26. int MinNumVals;
  27. public:
  28. floatVectWrappedOption(const char* OptionName, char ShortCut, vector<float> *Value, vector<float> DefaultValue, int MinNumVals=1, bool _CmdLineOnly=false);
  29. virtual void getOption(AnyOption *opt);
  30. virtual void Save(fstream &fw);
  31. };
  32. /** class for processing a vector of integers as Anyoption parameters
  33. usage in ini file:
  34. @verbatim ParaRange : 3 5 6 @endverbatim
  35. usage via command line: list of values must be enclosed in quotes (")!
  36. @verbatim ./simsom03 --ParaRange "4 5 7" @endverbatim
  37. */
  38. class intVectWrappedOption: public WrappedOption
  39. {
  40. vector<int> *Value;
  41. int MinNumVals;
  42. public:
  43. intVectWrappedOption(const char* OptionName, char ShortCut, vector<int> *Value, vector<int> DefaultValue, int MinNumVals=1, bool _CmdLineOnly=false);
  44. virtual void getOption(AnyOption *opt);
  45. virtual void Save(fstream &fw);
  46. };
  47. /** class for processing an integer as Anyoption parameters
  48. */
  49. class intWrappedOption: public WrappedOption
  50. {
  51. int *Value;
  52. public:
  53. intWrappedOption(const char* OptionName, char ShortCut, int *Value, const int DefaultValue, bool _CmdLineOnly=false);
  54. // virtual int setOption(AnyOption *opt);
  55. virtual void getOption(AnyOption *opt);
  56. virtual void Save(fstream &fw);
  57. };
  58. /** class for processing a string as Anyoption parameters
  59. */
  60. class stringWrappedOption: public WrappedOption
  61. {
  62. string* Value;
  63. public:
  64. stringWrappedOption(const char* OptionName, char ShortCut, string* Value, const char* DefaultValue, bool _CmdLineOnly=false);
  65. // virtual void setOption(AnyOption *opt);
  66. virtual void getOption(AnyOption *opt);
  67. virtual void Save(fstream &fw);
  68. };
  69. /** class for processing a bool as Anyoption flag
  70. */
  71. class flagWrappedOption: public WrappedOption
  72. {
  73. string NoOptionName;
  74. bool *Value;
  75. public:
  76. flagWrappedOption(const char* OptionName, char ShortCut, bool *Value, const bool DefaultValue=false, bool _CmdLineOnly=false);
  77. virtual void setOption(AnyOption *opt);
  78. virtual void getOption(AnyOption *opt);
  79. virtual void Save(fstream &fw);
  80. };
  81. #endif