KiCad PCB EDA Suite
Loading...
Searching...
No Matches
RULE_EDITOR_DATA_BASE Class Reference

Concrete class representing the base data structure for a rule editor. More...

#include <rule_editor_data_base.h>

Inheritance diagram for RULE_EDITOR_DATA_BASE:
ICopyable DRC_RE_BASE_CONSTRAINT_DATA DRC_RE_ABSOLUTE_LENGTH_TWO_CONSTRAINT_DATA DRC_RE_ALLOWED_ORIENTATION_CONSTRAINT_DATA DRC_RE_BOOL_INPUT_CONSTRAINT_DATA DRC_RE_CUSTOM_RULE_CONSTRAINT_DATA DRC_RE_MINIMUM_TEXT_HEIGHT_THICKNESS_CONSTRAINT_DATA DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA DRC_RE_PERMITTED_LAYERS_CONSTRAINT_DATA DRC_RE_ROUTING_DIFF_PAIR_CONSTRAINT_DATA DRC_RE_ROUTING_WIDTH_CONSTRAINT_DATA DRC_RE_VIAS_UNDER_SMD_CONSTRAINT_DATA DRC_RE_VIA_STYLE_CONSTRAINT_DATA

Public Member Functions

 RULE_EDITOR_DATA_BASE ()=default
 
 RULE_EDITOR_DATA_BASE (int aId, wxString aRuleName)
 
virtual ~RULE_EDITOR_DATA_BASE ()=default
 
int GetId ()
 Get the unique ID of the rule.
 
void SetId (int aId)
 Set the unique ID of the rule.
 
wxString GetRuleName () const
 Get the name of the rule.
 
void SetRuleName (wxString aRuleName)
 Set the name of the rule.
 
wxString GetComment ()
 Get the comment associated with the rule.
 
void SetComment (wxString aComment)
 Set the comment for the rule.
 
bool IsNew ()
 Check if the rule is marked as new.
 
void SetIsNew (bool aIsNew)
 Mark the rule as new or not.
 
void CopyFrom (const ICopyable &aSource) override
 Implementation of the polymorphic CopyFrom method.
 

Private Attributes

int m_id = 0
 
wxString m_ruleName
 
wxString m_comment
 
bool m_isNew = false
 Flag indicating if the user is creating a new rule (true) or editing an existing rule (false).
 

Detailed Description

Concrete class representing the base data structure for a rule editor.

Definition at line 40 of file rule_editor_data_base.h.

Constructor & Destructor Documentation

◆ RULE_EDITOR_DATA_BASE() [1/2]

RULE_EDITOR_DATA_BASE::RULE_EDITOR_DATA_BASE ( )
default

◆ RULE_EDITOR_DATA_BASE() [2/2]

RULE_EDITOR_DATA_BASE::RULE_EDITOR_DATA_BASE ( int aId,
wxString aRuleName )
inlineexplicit

Definition at line 45 of file rule_editor_data_base.h.

References m_id, m_isNew, and m_ruleName.

◆ ~RULE_EDITOR_DATA_BASE()

virtual RULE_EDITOR_DATA_BASE::~RULE_EDITOR_DATA_BASE ( )
virtualdefault

Member Function Documentation

◆ CopyFrom()

void RULE_EDITOR_DATA_BASE::CopyFrom ( const ICopyable & aSource)
inlineoverridevirtual

Implementation of the polymorphic CopyFrom method.

Parameters
aSourceThe source object to copy from.

Implements ICopyable.

Definition at line 115 of file rule_editor_data_base.h.

References m_comment, and RULE_EDITOR_DATA_BASE().

Referenced by DRC_RE_BASE_CONSTRAINT_DATA::CopyFrom().

◆ GetComment()

wxString RULE_EDITOR_DATA_BASE::GetComment ( )
inline

Get the comment associated with the rule.

Returns
The comment of the rule.

Definition at line 87 of file rule_editor_data_base.h.

References m_comment.

Referenced by DRC_RULE_SAVER::generateMergedRuleText(), DRC_RULE_SAVER::generateRuleText(), and DRC_RULE_DOCUMENT::UpdateEntry().

◆ GetId()

int RULE_EDITOR_DATA_BASE::GetId ( )
inline

Get the unique ID of the rule.

Returns
The unique ID of the rule.

Definition at line 59 of file rule_editor_data_base.h.

References m_id.

◆ GetRuleName()

wxString RULE_EDITOR_DATA_BASE::GetRuleName ( ) const
inline

Get the name of the rule.

Returns
The name of the rule.

Definition at line 73 of file rule_editor_data_base.h.

References m_ruleName.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and CONSTRAINT_RULES_LIST::copyRuleData().

◆ IsNew()

bool RULE_EDITOR_DATA_BASE::IsNew ( )
inline

Check if the rule is marked as new.

Returns
True if the rule is new (being created), false if it is being edited.

Definition at line 101 of file rule_editor_data_base.h.

References m_isNew.

◆ SetComment()

void RULE_EDITOR_DATA_BASE::SetComment ( wxString aComment)
inline

Set the comment for the rule.

Parameters
aCommentThe comment to set.

Definition at line 94 of file rule_editor_data_base.h.

References m_comment.

Referenced by DRC_RULE_DOCUMENT::UpdateEntry().

◆ SetId()

void RULE_EDITOR_DATA_BASE::SetId ( int aId)
inline

Set the unique ID of the rule.

Parameters
aIdThe unique ID to set.

Definition at line 66 of file rule_editor_data_base.h.

References m_id.

◆ SetIsNew()

void RULE_EDITOR_DATA_BASE::SetIsNew ( bool aIsNew)
inline

Mark the rule as new or not.

Parameters
aIsNewTrue to mark the rule as new, false to mark it as existing.

Definition at line 108 of file rule_editor_data_base.h.

References m_isNew.

◆ SetRuleName()

void RULE_EDITOR_DATA_BASE::SetRuleName ( wxString aRuleName)
inline

Set the name of the rule.

Parameters
aRuleNameThe name of the rule to set.

Definition at line 80 of file rule_editor_data_base.h.

References m_ruleName.

Referenced by CONSTRAINT_RULES_LIST::copyRuleData(), and DRC_RULE_DOCUMENT::UpdateEntry().

Member Data Documentation

◆ m_comment

wxString RULE_EDITOR_DATA_BASE::m_comment
private

Definition at line 125 of file rule_editor_data_base.h.

Referenced by CopyFrom(), GetComment(), and SetComment().

◆ m_id

int RULE_EDITOR_DATA_BASE::m_id = 0
private

Definition at line 123 of file rule_editor_data_base.h.

Referenced by GetId(), RULE_EDITOR_DATA_BASE(), and SetId().

◆ m_isNew

bool RULE_EDITOR_DATA_BASE::m_isNew = false
private

Flag indicating if the user is creating a new rule (true) or editing an existing rule (false).

Definition at line 126 of file rule_editor_data_base.h.

Referenced by IsNew(), RULE_EDITOR_DATA_BASE(), and SetIsNew().

◆ m_ruleName

wxString RULE_EDITOR_DATA_BASE::m_ruleName
private

Definition at line 124 of file rule_editor_data_base.h.

Referenced by GetRuleName(), RULE_EDITOR_DATA_BASE(), and SetRuleName().


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