KiCad PCB EDA Suite
RANGED_NUM< T > Class Template Reference

#include <ranged_num.h>

Public Member Functions

 RANGED_NUM (T aValue=0, T aTolerancePlus=0, T aToleranceMinus=0)
 
 operator T ()
 
RANGED_NUMoperator= (const T aValue)
 
bool Matches (const T &aOther) const
 

Private Attributes

m_value
 
m_tolerancePlus
 
m_toleranceMinus
 

Detailed Description

template<class T>
class RANGED_NUM< T >

Definition at line 24 of file ranged_num.h.

Constructor & Destructor Documentation

template<class T>
RANGED_NUM< T >::RANGED_NUM ( aValue = 0,
aTolerancePlus = 0,
aToleranceMinus = 0 
)
inline

Definition at line 26 of file ranged_num.h.

26  :
27  m_value( aValue ),
28  m_tolerancePlus( aTolerancePlus ),
29  m_toleranceMinus( aToleranceMinus )
30  {}
T m_tolerancePlus
Definition: ranged_num.h:49
T m_toleranceMinus
Definition: ranged_num.h:49

Member Function Documentation

template<class T>
bool RANGED_NUM< T >::Matches ( const T &  aOther) const
inline

Definition at line 43 of file ranged_num.h.

Referenced by PNS::DIFF_PAIR::CoupledLength(), PNS::DIFF_PAIR::CoupledSegmentPairs(), and PNS::findCoupledVertices().

44  {
45  return ( aOther >= m_value - m_toleranceMinus && aOther <= m_value + m_tolerancePlus );
46  }
T m_tolerancePlus
Definition: ranged_num.h:49
T m_toleranceMinus
Definition: ranged_num.h:49
template<class T>
RANGED_NUM< T >::operator T ( )
inline

Definition at line 32 of file ranged_num.h.

References RANGED_NUM< T >::m_value.

33  {
34  return m_value;
35  }
template<class T>
RANGED_NUM& RANGED_NUM< T >::operator= ( const T  aValue)
inline

Definition at line 37 of file ranged_num.h.

38  {
39  m_value = aValue;
40  return *this;
41  }

Member Data Documentation

template<class T>
T RANGED_NUM< T >::m_toleranceMinus
private

Definition at line 49 of file ranged_num.h.

Referenced by RANGED_NUM< int >::Matches().

template<class T>
T RANGED_NUM< T >::m_tolerancePlus
private

Definition at line 49 of file ranged_num.h.

Referenced by RANGED_NUM< int >::Matches().

template<class T>
T RANGED_NUM< T >::m_value
private

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