KiCad PCB EDA Suite
DRC_RULE Class Reference

#include <drc_rule.h>

Public Member Functions

 DRC_RULE ()
 
virtual ~DRC_RULE ()
 
virtual bool AppliesTo (const BOARD_ITEM *a, const BOARD_ITEM *b=nullptr) const
 
void AddConstraint (DRC_CONSTRAINT &aConstraint)
 
OPT< DRC_CONSTRAINTFindConstraint (DRC_CONSTRAINT_T aType)
 

Public Attributes

bool m_Unary
 
bool m_Implicit
 
wxString m_Name
 
wxString m_LayerSource
 
LSET m_LayerCondition
 
DRC_RULE_CONDITIONm_Condition
 
std::vector< DRC_CONSTRAINTm_Constraints
 

Detailed Description

Definition at line 79 of file drc_rule.h.

Constructor & Destructor Documentation

◆ DRC_RULE()

DRC_RULE::DRC_RULE ( )

Definition at line 31 of file drc_rule.cpp.

31  :
32  m_Unary( false ),
33  m_Implicit( false ),
35  m_Condition( nullptr )
36 {
37 }
DRC_RULE_CONDITION * m_Condition
Definition: drc_rule.h:99
bool m_Implicit
Definition: drc_rule.h:95
static LSET AllLayersMask()
Definition: lset.cpp:787
LSET m_LayerCondition
Definition: drc_rule.h:98
bool m_Unary
Definition: drc_rule.h:94

◆ ~DRC_RULE()

DRC_RULE::~DRC_RULE ( )
virtual

Definition at line 40 of file drc_rule.cpp.

41 {
42  delete m_Condition;
43 }
DRC_RULE_CONDITION * m_Condition
Definition: drc_rule.h:99

References m_Condition.

Member Function Documentation

◆ AddConstraint()

void DRC_RULE::AddConstraint ( DRC_CONSTRAINT aConstraint)

Definition at line 46 of file drc_rule.cpp.

47 {
48  aConstraint.SetParentRule( this );
49  m_Constraints.push_back( aConstraint );
50 }
std::vector< DRC_CONSTRAINT > m_Constraints
Definition: drc_rule.h:100
void SetParentRule(DRC_RULE *aParentRule)
Definition: drc_rule.h:124

References m_Constraints, and DRC_CONSTRAINT::SetParentRule().

Referenced by DRC_ENGINE::loadImplicitRules(), and DRC_RULES_PARSER::parseConstraint().

◆ AppliesTo()

virtual bool DRC_RULE::AppliesTo ( const BOARD_ITEM a,
const BOARD_ITEM b = nullptr 
) const
inlinevirtual

Definition at line 85 of file drc_rule.h.

86  {
87  return true;
88  };

◆ FindConstraint()

OPT< DRC_CONSTRAINT > DRC_RULE::FindConstraint ( DRC_CONSTRAINT_T  aType)

Definition at line 52 of file drc_rule.cpp.

53 {
54  for( auto &c : m_Constraints)
55  if( c.m_Type == aType )
56  return c;
57 
58  return OPT<DRC_CONSTRAINT>();
59 }
std::vector< DRC_CONSTRAINT > m_Constraints
Definition: drc_rule.h:100
boost::optional< T > OPT
Definition: optional.h:7

References m_Constraints.

Referenced by DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal().

Member Data Documentation

◆ m_Condition

DRC_RULE_CONDITION* DRC_RULE::m_Condition

◆ m_Constraints

std::vector<DRC_CONSTRAINT> DRC_RULE::m_Constraints

Definition at line 100 of file drc_rule.h.

Referenced by AddConstraint(), FindConstraint(), and DRC_ENGINE::loadImplicitRules().

◆ m_Implicit

bool DRC_RULE::m_Implicit

◆ m_LayerCondition

LSET DRC_RULE::m_LayerCondition

Definition at line 98 of file drc_rule.h.

Referenced by DRC_ENGINE::loadImplicitRules(), and DRC_RULES_PARSER::parseDRC_RULE().

◆ m_LayerSource

wxString DRC_RULE::m_LayerSource

Definition at line 97 of file drc_rule.h.

Referenced by DRC_RULES_PARSER::parseDRC_RULE().

◆ m_Name

◆ m_Unary

bool DRC_RULE::m_Unary

Definition at line 94 of file drc_rule.h.


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