vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vrecko::Interval< tval, tref > Class Template Reference

#include <Interval.h>

Inheritance diagram for vrecko::Interval< tval, tref >:
vrecko::Range

Public Member Functions

 Interval (tref lowerBound, tref upperBound)
 
 Interval (tref lowerBound, tref upperBound, bool lowerInclusive, bool upperInclusive)
 
tref getLowerBound () const
 
tref getUpperBound () const
 
bool isLowerInclusive () const
 
bool isUpperInclusive () const
 
bool includesValue (tref value) const
 
- Public Member Functions inherited from vrecko::Range
bool isInterval () const
 
bool isEnumeration () const
 

Additional Inherited Members

- Public Types inherited from vrecko::Range
enum  RangeType { RANGE_INTERVAL, RANGE_ENUMERATION }
 
- Protected Member Functions inherited from vrecko::Range
 Range (RangeType rangeType)
 
 Range (const Range &range)
 

Detailed Description

template<class tval, class tref = tval>
class vrecko::Interval< tval, tref >

Represents an immutable interval.

This class uses templates. Specialized classes are prepared for int, long, float and double data types. No other specializations should be used. Specialized classes are listed below definition of this class.

Parameters
tvaldata type used for values storage
trefdata type used for arguments and results passing
See Also
Range
Enumeration
IntInterval
LongInterval
FloatInterval
DoubleInterval

Constructor & Destructor Documentation

template<class tval , class tref = tval>
vrecko::Interval< tval, tref >::Interval ( tref  lowerBound,
tref  upperBound 
)
inline

Constructs an implicitly closed Interval object.

Parameters
lowerBoundvalue of the lower bound of the interval
upperBoundvalue of the upper bound of the interval
template<class tval , class tref = tval>
vrecko::Interval< tval, tref >::Interval ( tref  lowerBound,
tref  upperBound,
bool  lowerInclusive,
bool  upperInclusive 
)
inline

Constructs an Interval object.

Parameters
lowerBoundvalue of the lower bound of the interval
upperBoundvalue of the upper bound of the interval
lowerInclusiveinclusion flag for the lower bound
upperInclusiveinclusion flag for the upper bound

Member Function Documentation

template<class tval , class tref = tval>
tref vrecko::Interval< tval, tref >::getLowerBound ( ) const
inline

Returns the lower bound.

Returns
current value of the lower bound
template<class tval , class tref = tval>
tref vrecko::Interval< tval, tref >::getUpperBound ( ) const
inline

Returns the upper bound.

Returns
current value of the upper bound
template<class tval , class tref = tval>
bool vrecko::Interval< tval, tref >::includesValue ( tref  value) const
inline

"Includes value" predicate.

Parameters
valuevalue to be checked
Returns
true if the value is included in the interval, false otherwise
template<class tval , class tref = tval>
bool vrecko::Interval< tval, tref >::isLowerInclusive ( ) const
inline

"Is lower inclusive" predicate.

Returns
true if the interval is lower bound inclusive, false otherwise
template<class tval , class tref = tval>
bool vrecko::Interval< tval, tref >::isUpperInclusive ( ) const
inline

"Is upper inclusive" predicate.

Returns
true if the interval is upper bound inclusive, false otherwise

The documentation for this class was generated from the following file: