Mass++ Common Libraries v2.7.5
 All Classes Namespaces Files Functions Variables Enumerations Macros
NumberRestriction.h
Go to the documentation of this file.
1 
12 #ifndef __KOME_CORE_NUMBER_RESTRICTION_H__
13 #define __KOME_CORE_NUMBER_RESTRICTION_H__
14 
15 
16 #include <string>
17 #include <boost/optional.hpp>
18 
19 
20 namespace kome {
21  namespace core {
26  class CORE_TOOLKITS_CLASS NumberRestriction {
27  public:
33 
38  virtual ~NumberRestriction();
39 
40  protected:
42  boost::optional< double > m_minInclusive;
44  boost::optional< double > m_maxInclusive;
46  boost::optional< double > m_minExclusive;
48  boost::optional< double > m_maxExclusive;
49 
50  public:
55  void reset();
56 
62  void setInclusiveMinValue( const double value );
63 
69  bool hasInclusiveMinValue();
70 
77  double getInclusiveMinValue( const double dfValue = 0.0 );
78 
84  void setInclusiveMaxValue( const double value );
85 
91  bool hasInclusiveMaxValue();
92 
99  double getInclusiveMaxValue( const double dfValue = 0.0 );
100 
106  void setExclusiveMinValue( const double value );
107 
113  bool hasExclusiveMinValue();
114 
121  double getExclusiveMinValue( const double dfValue = 0.0 );
122 
128  void setExclusiveMaxValue( const double value );
129 
135  bool hasExclusiveMaxValue();
136 
143  double getExclusiveMaxValue( const double dfValue = 0.0 );
144 
151  double getLowerBound( const double dfValue = 0.0 );
152 
159  double getUpperBound( const double dfValue = 0.0 );
160 
167  bool checkDoubleValue( const double value );
168 
175  bool checkIntValue( const int value );
176 
183  std::string getRangeStr( const char* name );
184  };
185  }
186 }
187 
188 #endif // __KOME_CORE_NUMBER_RESTRICTION_H__
the restriction of number class
boost::optional< double > m_maxInclusive
boost::optional< double > m_maxExclusive
boost::optional< double > m_minExclusive
boost::optional< double > m_minInclusive