KiCad PCB EDA Suite
DRC_RULE Class Reference

#include <drc_rule.h>

Public Member Functions

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

Public Attributes

bool m_Unary
 
bool m_Implicit
 
KIID m_ImplicitItemId
 
wxString m_Name
 
wxString m_LayerSource
 
LSET m_LayerCondition
 
DRC_RULE_CONDITIONm_Condition
 
std::vector< DRC_CONSTRAINTm_Constraints
 
SEVERITY m_Severity
 

Detailed Description

Definition at line 92 of file drc_rule.h.

Constructor & Destructor Documentation

◆ DRC_RULE() [1/2]

DRC_RULE::DRC_RULE ( )

Definition at line 31 of file drc_rule.cpp.

31 :
32 m_Unary( false ),
33 m_Implicit( false ),
36 m_Condition( nullptr ),
38{
39}
SEVERITY m_Severity
Definition: drc_rule.h:117
bool m_Unary
Definition: drc_rule.h:109
DRC_RULE_CONDITION * m_Condition
Definition: drc_rule.h:115
LSET m_LayerCondition
Definition: drc_rule.h:114
KIID m_ImplicitItemId
Definition: drc_rule.h:111
bool m_Implicit
Definition: drc_rule.h:110
static LSET AllLayersMask()
Definition: lset.cpp:808
@ RPT_SEVERITY_UNDEFINED

◆ DRC_RULE() [2/2]

DRC_RULE::DRC_RULE ( const wxString &  aName)

Definition at line 42 of file drc_rule.cpp.

42 :
43 m_Unary( false ),
44 m_Implicit( false ),
46 m_Name( aName ),
48 m_Condition( nullptr ),
50{
51}
wxString m_Name
Definition: drc_rule.h:112

◆ ~DRC_RULE()

DRC_RULE::~DRC_RULE ( )
virtual

Definition at line 54 of file drc_rule.cpp.

55{
56 delete m_Condition;
57}

References m_Condition.

Member Function Documentation

◆ AddConstraint()

void DRC_RULE::AddConstraint ( DRC_CONSTRAINT aConstraint)

Definition at line 60 of file drc_rule.cpp.

61{
62 aConstraint.SetParentRule( this );
63 m_Constraints.push_back( aConstraint );
64}
void SetParentRule(DRC_RULE *aParentRule)
Definition: drc_rule.h:144
std::vector< DRC_CONSTRAINT > m_Constraints
Definition: drc_rule.h:116

References m_Constraints, and DRC_CONSTRAINT::SetParentRule().

Referenced by DRC_RULES_PARSER::parseConstraint().

◆ AppliesTo()

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

Definition at line 100 of file drc_rule.h.

101 {
102 return true;
103 };

◆ FindConstraint()

std::optional< DRC_CONSTRAINT > DRC_RULE::FindConstraint ( DRC_CONSTRAINT_T  aType)

Definition at line 67 of file drc_rule.cpp.

68{
70 {
71 if( c.m_Type == aType )
72 return c;
73 }
74
75 return std::optional<DRC_CONSTRAINT>();
76}

References m_Constraints.

Referenced by DRC_RULES_PARSER::parseConstraint(), and DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal().

Member Data Documentation

◆ m_Condition

DRC_RULE_CONDITION* DRC_RULE::m_Condition

Definition at line 115 of file drc_rule.h.

Referenced by ~DRC_RULE().

◆ m_Constraints

std::vector<DRC_CONSTRAINT> DRC_RULE::m_Constraints

Definition at line 116 of file drc_rule.h.

Referenced by AddConstraint(), and FindConstraint().

◆ m_Implicit

bool DRC_RULE::m_Implicit

◆ m_ImplicitItemId

KIID DRC_RULE::m_ImplicitItemId

Definition at line 111 of file drc_rule.h.

Referenced by DRC_TEST_PROVIDER_DISALLOW::Run().

◆ m_LayerCondition

LSET DRC_RULE::m_LayerCondition

Definition at line 114 of file drc_rule.h.

◆ m_LayerSource

wxString DRC_RULE::m_LayerSource

Definition at line 113 of file drc_rule.h.

◆ m_Name

◆ m_Severity

SEVERITY DRC_RULE::m_Severity

Definition at line 117 of file drc_rule.h.

Referenced by DRC_CONSTRAINT::GetSeverity(), and PCB_MARKER::GetSeverity().

◆ m_Unary

bool DRC_RULE::m_Unary

Definition at line 109 of file drc_rule.h.


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