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_VIA_STYLE_CONSTRAINT_DATA

Public Member Functions

 RULE_EDITOR_DATA_BASE ()=default
 
 RULE_EDITOR_DATA_BASE (int aId, int aParentId, 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.
 
int GetParentId ()
 Get the parent ID of the rule.
 
void SetParentId (int aParentId)
 Set the parent ID of the rule.
 
wxString GetRuleName ()
 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
 
std::optional< int > m_parentId
 
wxString m_ruleName
 
wxString m_comment
 
bool m_isNew
 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 45 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,
int aParentId,
wxString aRuleName )
inlineexplicit

Definition at line 50 of file rule_editor_data_base.h.

References m_id, m_isNew, m_parentId, 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
sourceThe source object to copy from.

Implements ICopyable.

Definition at line 132 of file rule_editor_data_base.h.

References m_comment, and RULE_EDITOR_DATA_BASE().

Referenced by DRC_RE_BASE_CONSTRAINT_DATA::CopyFrom(), and DIALOG_DRC_RULE_EDITOR::DuplicateRule().

◆ GetComment()

wxString RULE_EDITOR_DATA_BASE::GetComment ( )
inline

Get the comment associated with the rule.

Returns
The comment of the rule.

Definition at line 104 of file rule_editor_data_base.h.

References m_comment.

Referenced by DRC_RULE_SAVER::generateRuleText().

◆ 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 62 of file rule_editor_data_base.h.

References m_id.

Referenced by DIALOG_DRC_RULE_EDITOR::buildRuleTreeNode(), and DIALOG_DRC_RULE_EDITOR::LoadExistingRules().

◆ GetParentId()

int RULE_EDITOR_DATA_BASE::GetParentId ( )
inline

Get the parent ID of the rule.

Returns
The parent ID of the rule, or -1 if no parent is set.

Definition at line 76 of file rule_editor_data_base.h.

References m_parentId.

Referenced by RULE_EDITOR_DIALOG_BASE::AppendNewRuleTreeItem().

◆ GetRuleName()

wxString RULE_EDITOR_DATA_BASE::GetRuleName ( )
inline

Get the name of the rule.

Returns
The name of the rule.

Definition at line 90 of file rule_editor_data_base.h.

References m_ruleName.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and DIALOG_DRC_RULE_EDITOR::UpdateRuleTypeTreeItemData().

◆ 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 118 of file rule_editor_data_base.h.

References m_isNew.

Referenced by DIALOG_DRC_RULE_EDITOR::RemoveRule().

◆ SetComment()

void RULE_EDITOR_DATA_BASE::SetComment ( wxString aComment)
inline

Set the comment for the rule.

Parameters
aCommentThe comment to set.

Definition at line 111 of file rule_editor_data_base.h.

References m_comment.

◆ 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 69 of file rule_editor_data_base.h.

References m_id.

Referenced by DIALOG_DRC_RULE_EDITOR::buildRuleTreeNodeData().

◆ 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 125 of file rule_editor_data_base.h.

References m_isNew.

Referenced by DIALOG_DRC_RULE_EDITOR::buildRuleTreeNode(), and DIALOG_DRC_RULE_EDITOR::UpdateRuleTypeTreeItemData().

◆ SetParentId()

void RULE_EDITOR_DATA_BASE::SetParentId ( int aParentId)
inline

Set the parent ID of the rule.

Parameters
aParentIdThe parent ID to set.

Definition at line 83 of file rule_editor_data_base.h.

References m_parentId.

Referenced by DIALOG_DRC_RULE_EDITOR::buildRuleTreeNodeData().

◆ 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 97 of file rule_editor_data_base.h.

References m_ruleName.

Member Data Documentation

◆ m_comment

wxString RULE_EDITOR_DATA_BASE::m_comment
private

Definition at line 143 of file rule_editor_data_base.h.

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

◆ m_id

int RULE_EDITOR_DATA_BASE::m_id
private

Definition at line 140 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
private

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

Definition at line 144 of file rule_editor_data_base.h.

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

◆ m_parentId

std::optional<int> RULE_EDITOR_DATA_BASE::m_parentId
private

Definition at line 141 of file rule_editor_data_base.h.

Referenced by GetParentId(), RULE_EDITOR_DATA_BASE(), and SetParentId().

◆ m_ruleName

wxString RULE_EDITOR_DATA_BASE::m_ruleName
private

Definition at line 142 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: