KiCad PCB EDA Suite
DRC_LIST_UNCONNECTED Class Reference

Class DRC_LIST_UNCONNECTED is an implementation of the interface named DRC_ITEM_LIST which uses a vector of pointers to DRC_ITEMs to fulfill the interface. More...

#include <dialog_drclistbox.h>

Inheritance diagram for DRC_LIST_UNCONNECTED:
DRC_ITEM_LIST

Public Member Functions

 DRC_LIST_UNCONNECTED (DRC_LIST *aList)
 
void DeleteAllItems () override
 Function DeleteAllItems removes and deletes all the items in the list. More...
 
const DRC_ITEMGetItem (int aIndex) override
 Function GetItem retrieves a DRC_ITEM by pointer. More...
 
void DeleteItem (int aIndex) override
 Function DeleteAllItems removes and deletes desired item from the list. More...
 
int GetCount () override
 Function GetCount returns the number of items in the list. More...
 

Private Attributes

DRC_LISTm_vector
 

Detailed Description

Class DRC_LIST_UNCONNECTED is an implementation of the interface named DRC_ITEM_LIST which uses a vector of pointers to DRC_ITEMs to fulfill the interface.

No ownership is taken of the vector, which will reside in class DRC

Definition at line 116 of file dialog_drclistbox.h.

Constructor & Destructor Documentation

DRC_LIST_UNCONNECTED::DRC_LIST_UNCONNECTED ( DRC_LIST aList)
inline

Definition at line 122 of file dialog_drclistbox.h.

122  :
123  m_vector(aList)
124  {
125  }

Member Function Documentation

void DRC_LIST_UNCONNECTED::DeleteAllItems ( )
inlineoverridevirtual

Function DeleteAllItems removes and deletes all the items in the list.

Implements DRC_ITEM_LIST.

Definition at line 134 of file dialog_drclistbox.h.

135  {
136  if( m_vector )
137  {
138  for( unsigned i=0; i<m_vector->size(); ++i )
139  delete (*m_vector)[i];
140 
141  m_vector->clear();
142  }
143  }
void DRC_LIST_UNCONNECTED::DeleteItem ( int  aIndex)
inlineoverridevirtual

Function DeleteAllItems removes and deletes desired item from the list.

Parameters
aIndexThe 0 based index into the list of the desired item which is to be deleted.

Implements DRC_ITEM_LIST.

Definition at line 156 of file dialog_drclistbox.h.

157  {
158  if( m_vector && (unsigned)aIndex < m_vector->size() )
159  {
160  delete (*m_vector)[aIndex];
161  m_vector->erase( m_vector->begin()+aIndex );
162  }
163  }
int DRC_LIST_UNCONNECTED::GetCount ( )
inlineoverridevirtual

Function GetCount returns the number of items in the list.

Implements DRC_ITEM_LIST.

Definition at line 170 of file dialog_drclistbox.h.

171  {
172  if( m_vector )
173  {
174  return m_vector->size();
175  }
176  return 0;
177  }
const DRC_ITEM* DRC_LIST_UNCONNECTED::GetItem ( int  aIndex)
inlineoverridevirtual

Function GetItem retrieves a DRC_ITEM by pointer.

The actual item remains owned by the list container.

Parameters
aIndexThe 0 based index into the list of the desired item.
Returns
const DRC_ITEM* - the desired item or NULL if aIndex is out of range.

Implements DRC_ITEM_LIST.

Definition at line 146 of file dialog_drclistbox.h.

147  {
148  if( m_vector && (unsigned)aIndex < m_vector->size() )
149  {
150  const DRC_ITEM* item = (*m_vector)[aIndex];
151  return item;
152  }
153  return NULL;
154  }
Class DRC_ITEM is a holder for a DRC (in Pcbnew) or ERC (in Eeschema) error item. ...

Member Data Documentation

DRC_LIST* DRC_LIST_UNCONNECTED::m_vector
private

Definition at line 118 of file dialog_drclistbox.h.


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