OpenWalnut
1.4.0
|
Basic class for encapsulating a std::pair to be interpreted as interval. More...
#include <WInterval.h>
Public Types | |
typedef boost::shared_ptr< WInterval< T > > | SPtr |
Convenience typedef for a boost::shared_ptr< WInterval >. More... | |
typedef boost::shared_ptr< const WInterval< T > > | ConstSPtr |
Convenience typedef for a boost::shared_ptr< const WInterval >. More... | |
typedef std::pair< T, T > | StoreType |
Type used to store the information. More... | |
typedef WInterval< T > | Type |
My own type. More... | |
Public Member Functions | |
WInterval (const StoreType &c) | |
Copy constructor to create a WInterval using a std::pair. More... | |
WInterval (const Type &c) | |
Copy constructor. More... | |
WInterval (const T &l, const T &u) | |
Create a new interval instance using the given values. More... | |
virtual | ~WInterval () |
Destructor. More... | |
operator const StoreType & () const | |
Convert the WInterval instance to a std::pair again. More... | |
const T & | getLower () const |
Get the lower value of the interval. More... | |
const T & | getUpper () const |
Return the upper value of the interval. More... | |
T | getLength () const |
The length of the interval. More... | |
bool | operator== (Type interval) const |
Compare this interval with another one. More... | |
bool | operator!= (Type interval) const |
Compare this interval with another one. More... | |
Private Attributes | |
StoreType | m_interval |
The interval itself. More... | |
Basic class for encapsulating a std::pair to be interpreted as interval.
This class intentionally does not include a parameter telling whether the interval is open or not (mathematically: [],][,[[,]])
T | the type used for this interval |
Definition at line 44 of file WInterval.h.
Convenience typedef for a boost::shared_ptr< const WInterval >.
Definition at line 55 of file WInterval.h.
Convenience typedef for a boost::shared_ptr< WInterval >.
Definition at line 50 of file WInterval.h.
Type used to store the information.
Definition at line 60 of file WInterval.h.
My own type.
Definition at line 65 of file WInterval.h.
Copy constructor to create a WInterval using a std::pair.
c | the pair to use |
Definition at line 239 of file WInterval.h.
Create a new interval instance using the given values.
l | the lower border |
u | the upper border |
Definition at line 254 of file WInterval.h.
Destructor.
Definition at line 261 of file WInterval.h.
T WInterval< T >::getLength | ( | ) | const |
The length of the interval.
This is upper - lower.
Definition at line 285 of file WInterval.h.
const T & WInterval< T >::getLower | ( | ) | const |
Get the lower value of the interval.
Definition at line 273 of file WInterval.h.
Referenced by PROPERTY_TYPE_HELPER::WStringConversion< WPVBaseTypes::PV_INTERVAL >::asString(), WInterval< T >::operator==(), and wge::toUniformType().
const T & WInterval< T >::getUpper | ( | ) | const |
Return the upper value of the interval.
Definition at line 279 of file WInterval.h.
Referenced by PROPERTY_TYPE_HELPER::WStringConversion< WPVBaseTypes::PV_INTERVAL >::asString(), WInterval< T >::operator==(), and wge::toUniformType().
Convert the WInterval instance to a std::pair again.
Definition at line 267 of file WInterval.h.
Compare this interval with another one.
interval | the other one |
Definition at line 297 of file WInterval.h.
Compare this interval with another one.
interval | the other one |
Definition at line 291 of file WInterval.h.
References WInterval< T >::getLower(), and WInterval< T >::getUpper().
The interval itself.
Definition at line 145 of file WInterval.h.