KiCad PCB EDA Suite
AM_PARAM_EVAL Class Reference

This helper class hold a value or an arithmetic operator to calculate the final value of a aperture macro parameter, using usual arithmetic operator precedence Only operators ADD, SUB, MUL, DIV, OPEN_PAR, CLOSE_PAR have meaning when calculating a value. More...

#include <class_am_param.h>

Public Member Functions

 AM_PARAM_EVAL (parm_item_type aType)
 
 AM_PARAM_EVAL (double aValue)
 
parm_item_type GetType () const
 
bool IsOperator () const
 
double GetValue () const
 
parm_item_type GetOperator () const
 
int GetPriority () const
 

Static Public Member Functions

static int GetPriority (parm_item_type aType)
 

Private Attributes

parm_item_type m_type
 
double m_dvalue
 

Detailed Description

This helper class hold a value or an arithmetic operator to calculate the final value of a aperture macro parameter, using usual arithmetic operator precedence Only operators ADD, SUB, MUL, DIV, OPEN_PAR, CLOSE_PAR have meaning when calculating a value.

Definition at line 160 of file class_am_param.h.

Constructor & Destructor Documentation

AM_PARAM_EVAL::AM_PARAM_EVAL ( parm_item_type  aType)
inline

Definition at line 163 of file class_am_param.h.

164  : m_type( aType), m_dvalue( 0.0 )
165  {}
parm_item_type m_type
AM_PARAM_EVAL::AM_PARAM_EVAL ( double  aValue)
inline

Definition at line 167 of file class_am_param.h.

168  : m_type( parm_item_type::NOP ), m_dvalue( aValue )
169  {}
parm_item_type m_type

Member Function Documentation

parm_item_type AM_PARAM_EVAL::GetOperator ( ) const
inline

Definition at line 178 of file class_am_param.h.

References m_type.

Referenced by Evaluate(), and GetPriority().

178 { return m_type; }
parm_item_type m_type
int AM_PARAM_EVAL::GetPriority ( ) const
inline

Definition at line 179 of file class_am_param.h.

References GetOperator(), and GetPriority().

Referenced by Evaluate(), and GetPriority().

179 { return GetPriority( GetOperator() ); }
parm_item_type GetOperator() const
int GetPriority() const
static int AM_PARAM_EVAL::GetPriority ( parm_item_type  aType)
inlinestatic

Definition at line 181 of file class_am_param.h.

References ADD, CLOSE_PAR, DIV, MUL, OPEN_PAR, and SUB.

182  {
183  switch( aType )
184  {
185  case ADD:
186  case SUB:
187  return 1;
188 
189  case MUL:
190  case DIV:
191  return 2;
192 
193  case OPEN_PAR:
194  case CLOSE_PAR:
195  return 3;
196 
197  default:
198  break;
199  }
200 
201  return 0;
202  }
parm_item_type AM_PARAM_EVAL::GetType ( ) const
inline

Definition at line 171 of file class_am_param.h.

References m_type.

172  {
173  return m_type;
174  }
parm_item_type m_type
double AM_PARAM_EVAL::GetValue ( ) const
inline

Definition at line 177 of file class_am_param.h.

References m_dvalue.

Referenced by Evaluate().

177 { return m_dvalue; }
bool AM_PARAM_EVAL::IsOperator ( ) const
inline

Definition at line 176 of file class_am_param.h.

References m_type, and NOP.

Referenced by Evaluate().

176 { return m_type != NOP; }
parm_item_type m_type

Member Data Documentation

double AM_PARAM_EVAL::m_dvalue
private

Definition at line 206 of file class_am_param.h.

Referenced by GetValue().

parm_item_type AM_PARAM_EVAL::m_type
private

Definition at line 205 of file class_am_param.h.

Referenced by GetOperator(), GetType(), and IsOperator().


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