16 using namespace kome::core;
21 #define new new( _NORMAL_BLOCK, __FILE__, __LINE__ )
22 #define malloc( s ) _malloc_dbg( s, _NORMAL_BLOCK, __FILE__, __LINE__ )
134 return MAX( v0, v1 );
155 return MIN( v0, v1 );
240 boost::optional< double > v;
241 bool inclusive =
false;
259 range = FMT(
"%g <", v.get() );
264 range.append(
NVL( name,
"" ) );
270 range.append(
NVL( name,
"" ) );
273 range += FMT(
">= %g", v.get() );
277 range += FMT(
"> %g", v.get() );
298 if( range.empty() ) {
299 range =
NVL( name,
"" );
301 range.append(
" <" );
305 range.append( FMT(
" %g", v.get() ) );
bool hasExclusiveMaxValue()
judges whether this argument exclusive max value.
NumberRestriction()
constructor
void reset()
resets restriction
virtual ~NumberRestriction()
destructor
void setExclusiveMinValue(const double value)
sets exclusive min value
std::string getRangeStr(const char *name)
gets character string that means value range
double getUpperBound(const double dfValue=0.0)
gets upper bound value
int roundnum(const double v)
gets the closest integer to the argument
#define NVL(checkVal, replaceVal)
bool hasInclusiveMinValue()
judges whether this argument inclusive min value.
boost::optional< double > m_maxInclusive
void setInclusiveMinValue(const double value)
sets inclusive min value
bool hasExclusiveMinValue()
judges whether this argument exclusive min value.
double getInclusiveMinValue(const double dfValue=0.0)
gets min inclusive value
void setInclusiveMaxValue(const double value)
sets inclusive max value
double getInclusiveMaxValue(const double dfValue=0.0)
gets max inclusive value
boost::optional< double > m_maxExclusive
interfaces of NumberRestriction class
bool hasInclusiveMaxValue()
judges whether this argument inclusive max value.
boost::optional< double > m_minExclusive
void setExclusiveMaxValue(const double value)
sets exclusive max value
boost::optional< double > m_minInclusive
bool checkDoubleValue(const double value)
checks real number value is in the specified range
double getExclusiveMaxValue(const double dfValue=0.0)
gets max exclusive value
double getLowerBound(const double dfValue=0.0)
gets lower bound value
bool checkIntValue(const int value)
checks integer value is in the specified range
double getExclusiveMinValue(const double dfValue=0.0)
gets min exclusive value