CMS 3D CMS Logo

lat::Range< T > Struct Template Reference

#include <Iguana/Utilities/classlib/utils/Range.h>

List of all members.

Public Member Functions

bool contains (const Range< T > &other) const
bool contains (const T &value) const
bool containsStrictly (const Range< T > &other) const
bool empty (void) const
void high (const T &value)
high (void) const
Range intersection (const Range &other) const
bool intersects (const Range &other) const
void low (const T &value)
low (void) const
 Range (const T &x, const T &y)
 Range (void)
width (void) const

Private Attributes

m_high
m_low


Detailed Description

template<class T>
struct lat::Range< T >

Definition at line 18 of file Range.h.


Constructor & Destructor Documentation

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

Definition at line 63 of file Range.h.

00063 { }

template<class T>
lat::Range< T >::Range ( const T &  x,
const T &  y 
) [inline]

Definition at line 66 of file Range.h.

00067     : m_low (x < y ? x : y), m_high (x < y ? y : x)
00068 { }


Member Function Documentation

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

Definition at line 107 of file Range.h.

References lat::Range< T >::m_high, and lat::Range< T >::m_low.

00108 { return m_low <= other.m_low && other.m_high <= m_high; }

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

Definition at line 103 of file Range.h.

References lat::Range< T >::m_high, and lat::Range< T >::m_low.

00104 { return m_low <= value && value < m_high; }

template<class T>
bool lat::Range< T >::containsStrictly ( const Range< T > &  other  )  const [inline]

Definition at line 111 of file Range.h.

References lat::Range< T >::m_high, and lat::Range< T >::m_low.

00112 { return m_low < other.m_low && other.m_high < m_high; }

template<class T>
bool lat::Range< T >::empty ( void   )  const [inline]

Definition at line 83 of file Range.h.

References lat::Range< T >::m_high, and lat::Range< T >::m_low.

00084 { return m_high == m_low; }

template<class T>
void lat::Range< T >::high ( const T &  value  )  [inline]

Definition at line 99 of file Range.h.

References lat::Range< T >::m_high.

00100 { m_high = value; }

template<class T>
T lat::Range< T >::high ( void   )  const [inline]

Definition at line 95 of file Range.h.

References lat::Range< T >::m_high.

Referenced by lat::Sequence< T >::limits(), and lat::operator==().

00096 { return m_high; }

template<class T>
Range< T > lat::Range< T >::intersection ( const Range< T > &  other  )  const [inline]

Definition at line 119 of file Range.h.

References lat::Range< T >::m_high, lat::Range< T >::m_low, lat::MakeRange(), max, and min.

00120 { return MakeRange (std::min (m_high, std::max (m_low, other.m_low)),
00121                     std::min (m_high, other.m_high)); }

template<class T>
bool lat::Range< T >::intersects ( const Range< T > &  other  )  const [inline]

Definition at line 115 of file Range.h.

References lat::Range< T >::m_high, and lat::Range< T >::m_low.

00116 { return m_low < other.m_high && m_high > other.m_low; }

template<class T>
void lat::Range< T >::low ( const T &  value  )  [inline]

Definition at line 91 of file Range.h.

References lat::Range< T >::m_low.

00092 { m_low = value; }

template<class T>
T lat::Range< T >::low ( void   )  const [inline]

Definition at line 87 of file Range.h.

References lat::Range< T >::m_low.

Referenced by lat::Sequence< T >::limits(), and lat::operator==().

00088 { return m_low; }

template<class T>
T lat::Range< T >::width ( void   )  const [inline]

Definition at line 79 of file Range.h.

References lat::Range< T >::m_high, and lat::Range< T >::m_low.

00080 { return m_high - m_low; }


Member Data Documentation

template<class T>
T lat::Range< T >::m_high [private]

Definition at line 42 of file Range.h.

Referenced by lat::Range< T >::contains(), lat::Range< T >::containsStrictly(), lat::Range< T >::empty(), lat::Range< T >::high(), lat::Range< T >::intersection(), lat::Range< T >::intersects(), and lat::Range< T >::width().

template<class T>
T lat::Range< T >::m_low [private]

Definition at line 41 of file Range.h.

Referenced by lat::Range< T >::contains(), lat::Range< T >::containsStrictly(), lat::Range< T >::empty(), lat::Range< T >::intersection(), lat::Range< T >::intersects(), lat::Range< T >::low(), and lat::Range< T >::width().


The documentation for this struct was generated from the following file:
Generated on Tue Jun 9 18:48:34 2009 for CMSSW by  doxygen 1.5.4