Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Range< T > Class Template Reference

A template class to represent ranges. More...

#include <Range.h>

Collaboration diagram for Range< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Range ()
 Constructor.

 Range (T min, T max)
 Constructor.

Range< T > & add (T t)
 The function enlarges the range so that a certain value will be part of it.

Range< T > & add (const Range< T > &r)
 The function enlarges the range so that the resulting range also contains another one.

bool isInside (T t) const
 The function checks whether a certain value is in the range.

T limit (T t) const
 The function limits a certain value to the range.

Range< T > limit (const Range< T > &r) const
 The function limits another range to this range.

T getSize () const
 The function returns the size of the range.

T getCenter () const
 The function returns the center of the range.

The 13 Allen relations
bool operator== (const Range< T > &r) const
bool operator< (const Range< T > &r) const
bool operator> (const Range< T > &r) const
bool meets (const Range< T > &r) const
bool metBy (const Range< T > &r) const
bool overlaps (const Range< T > &r) const
bool overlappedBy (const Range< T > &r) const
bool starts (const Range< T > &r) const
bool startedBy (const Range< T > &r) const
bool finishes (const Range< T > &r) const
bool finishedBy (const Range< T > &r) const
bool during (const Range< T > &r) const
bool contains (const Range< T > &r) const

Public Attributes

T min
T max
 The limits of the range.


Detailed Description

template<class T>
class Range< T >

A template class to represent ranges.

It also defines the 13 Allen relations

Definition at line 15 of file Range.h.


Constructor & Destructor Documentation

template<class T>
Range< T >::Range (   )  [inline]
 

Constructor.

Defines an empty range.

Definition at line 24 of file Range.h.

Referenced by GT2004BasicBehaviorGoToPointAndAvoidObstacles::execute(), and GT2004BasicBehaviorTurnAroundPoint::execute().

template<class T>
Range< T >::Range (  T  min,
T  max
)  [inline]
 

Constructor.

Parameters:
min The minimum of the range.
max The maximum of the range.

Definition at line 31 of file Range.h.


Member Function Documentation

template<class T>
Range<T>& Range< T >::add (  T  t  )  [inline]
 

The function enlarges the range so that a certain value will be part of it.

Parameters:
t The value that will be part of the range.
Returns:
A reference to the range.

Definition at line 39 of file Range.h.

Referenced by Range< double >::add().

template<class T>
Range<T>& Range< T >::add (  const Range< T > &  r  )  [inline]
 

The function enlarges the range so that the resulting range also contains another one.

Parameters:
r The range that also will be part of the range.
Returns:
A reference to the range.

Definition at line 53 of file Range.h.

template<class T>
bool Range< T >::isInside (  T  t  )  const [inline]
 

The function checks whether a certain value is in the range.

Note that the function is able to handle circular range, i.e. max < min.

Parameters:
t The value.
Returns:
Is the value inside the range?

Definition at line 66 of file Range.h.

template<class T>
T Range< T >::limit (  T  t  )  const [inline]
 

The function limits a certain value to the range.

Note that the function is not able to handle circular range, i.e. max < min.

Parameters:
t The value that will be "clipped" to the range.
Returns:
The limited value.

Definition at line 75 of file Range.h.

Referenced by GT2004HeadControl::getLookAtBallAngles(), GT2004HeadPathPlanner::init(), Range< double >::limit(), and GT2004HeadControl::simpleLookAtPointRelativeToRobot().

template<class T>
Range<T> Range< T >::limit (  const Range< T > &  r  )  const [inline]
 

The function limits another range to this range.

Note that the function is able to handle circular range, i.e. max < min.

Parameters:
r The range that will be "clipped" to this range.
Returns:
The limited value.

Definition at line 83 of file Range.h.

template<class T>
T Range< T >::getSize (   )  const [inline]
 

The function returns the size of the range.

Returns:
The difference between the lower limit and the higher limit.

Definition at line 89 of file Range.h.

Referenced by GoalRecognizer::scanHorizontalForGoals(), and GT2004GoalRecognizer::scanHorizontalForGoals().

template<class T>
T Range< T >::getCenter (   )  const [inline]
 

The function returns the center of the range.

Returns:
The center.

Definition at line 95 of file Range.h.

template<class T>
bool Range< T >::operator== (  const Range< T > &  r  )  const [inline]
 

Definition at line 99 of file Range.h.

template<class T>
bool Range< T >::operator< (  const Range< T > &  r  )  const [inline]
 

Definition at line 100 of file Range.h.

template<class T>
bool Range< T >::operator> (  const Range< T > &  r  )  const [inline]
 

Definition at line 101 of file Range.h.

template<class T>
bool Range< T >::meets (  const Range< T > &  r  )  const [inline]
 

Definition at line 102 of file Range.h.

template<class T>
bool Range< T >::metBy (  const Range< T > &  r  )  const [inline]
 

Definition at line 103 of file Range.h.

template<class T>
bool Range< T >::overlaps (  const Range< T > &  r  )  const [inline]
 

Definition at line 104 of file Range.h.

template<class T>
bool Range< T >::overlappedBy (  const Range< T > &  r  )  const [inline]
 

Definition at line 105 of file Range.h.

template<class T>
bool Range< T >::starts (  const Range< T > &  r  )  const [inline]
 

Definition at line 106 of file Range.h.

template<class T>
bool Range< T >::startedBy (  const Range< T > &  r  )  const [inline]
 

Definition at line 107 of file Range.h.

template<class T>
bool Range< T >::finishes (  const Range< T > &  r  )  const [inline]
 

Definition at line 108 of file Range.h.

template<class T>
bool Range< T >::finishedBy (  const Range< T > &  r  )  const [inline]
 

Definition at line 109 of file Range.h.

template<class T>
bool Range< T >::during (  const Range< T > &  r  )  const [inline]
 

Definition at line 110 of file Range.h.

template<class T>
bool Range< T >::contains (  const Range< T > &  r  )  const [inline]
 

Definition at line 111 of file Range.h.


Member Data Documentation

template<class T>
T Range< T >::min
 

Definition at line 18 of file Range.h.

Referenced by Range< double >::add(), Range< double >::contains(), Range< double >::during(), Range< double >::finishedBy(), Range< double >::finishes(), Range< double >::getCenter(), Range< double >::getSize(), Range< double >::isInside(), Range< double >::limit(), Range< double >::meets(), Range< double >::metBy(), Range< double >::operator==(), Range< double >::operator>(), Range< double >::overlappedBy(), Range< double >::overlaps(), Pose2D::random(), Range< double >::Range(), GoalRecognizer::scanHorizontalForGoals(), GT2004GoalRecognizer::scanHorizontalForGoals(), Range< double >::startedBy(), and Range< double >::starts().

template<class T>
T Range< T >::max
 

The limits of the range.

Definition at line 18 of file Range.h.

Referenced by Range< double >::add(), Range< double >::contains(), Range< double >::during(), Range< double >::finishedBy(), Range< double >::finishes(), Range< double >::getCenter(), Range< double >::getSize(), Range< double >::isInside(), Range< double >::limit(), Range< double >::meets(), Range< double >::metBy(), Range< double >::operator<(), Range< double >::operator==(), Range< double >::operator>(), Range< double >::overlappedBy(), Range< double >::overlaps(), Pose2D::random(), Range< double >::Range(), GoalRecognizer::scanHorizontalForGoals(), GT2004GoalRecognizer::scanHorizontalForGoals(), Range< double >::startedBy(), and Range< double >::starts().


The documentation for this class was generated from the following file:
Generated on Thu Sep 23 20:10:56 2004 for GT2004 by doxygen 1.3.6