KiCad PCB EDA Suite
VECTOR_CLEANUP_ITEMS_PROVIDER Class Reference

VECTOR_CLEANUP_ITEMS_PROVIDER is an implementation of the interface named RC_ITEMS_PROVIDER which uses a vector of pointers to CLEANUP_ITEMs to fulfill the interface. More...

#include <cleanup_item.h>

Inheritance diagram for VECTOR_CLEANUP_ITEMS_PROVIDER:
RC_ITEMS_PROVIDER

Public Member Functions

 VECTOR_CLEANUP_ITEMS_PROVIDER (std::vector< CLEANUP_ITEM * > *aList)
 
void SetSeverities (int aSeverities) override
 
int GetCount (int aSeverity=-1) override
 
CLEANUP_ITEMGetItem (int aIndex) override
 Function GetItem retrieves a RC_ITEM by index. More...
 
void DeleteItem (int aIndex, bool aDeep) override
 Function DeleteItem removes (and optionally deletes) the indexed item from the list. More...
 
void DeleteAllItems (bool aIncludeExclusions, bool aDeep) override
 

Private Attributes

std::vector< CLEANUP_ITEM * > * m_sourceVector
 

Detailed Description

VECTOR_CLEANUP_ITEMS_PROVIDER is an implementation of the interface named RC_ITEMS_PROVIDER which uses a vector of pointers to CLEANUP_ITEMs to fulfill the interface.

No ownership is taken of the vector.

Definition at line 74 of file cleanup_item.h.

Constructor & Destructor Documentation

◆ VECTOR_CLEANUP_ITEMS_PROVIDER()

VECTOR_CLEANUP_ITEMS_PROVIDER::VECTOR_CLEANUP_ITEMS_PROVIDER ( std::vector< CLEANUP_ITEM * > *  aList)
inline

Definition at line 80 of file cleanup_item.h.

80  :
81  m_sourceVector( aList )
82  {
83  }
std::vector< CLEANUP_ITEM * > * m_sourceVector
Definition: cleanup_item.h:76

Member Function Documentation

◆ DeleteAllItems()

void VECTOR_CLEANUP_ITEMS_PROVIDER::DeleteAllItems ( bool  aIncludeExclusions,
bool  aDeep 
)
inlineoverridevirtual

Implements RC_ITEMS_PROVIDER.

Definition at line 110 of file cleanup_item.h.

111  {
112  if( aDeep )
113  {
114  for( CLEANUP_ITEM* item : *m_sourceVector )
115  delete item;
116 
117  m_sourceVector->clear();
118  }
119  }
std::vector< CLEANUP_ITEM * > * m_sourceVector
Definition: cleanup_item.h:76

References m_sourceVector.

◆ DeleteItem()

void VECTOR_CLEANUP_ITEMS_PROVIDER::DeleteItem ( int  aIndex,
bool  aDeep 
)
inlineoverridevirtual

Function DeleteItem removes (and optionally deletes) the indexed item from the list.

Parameters
aDeepIf true, the source item should be deleted as well as its entry in the list.

Implements RC_ITEMS_PROVIDER.

Definition at line 99 of file cleanup_item.h.

100  {
101  if( aDeep )
102  {
103  CLEANUP_ITEM* item = m_sourceVector->at( aIndex );
104  delete item;
105 
106  m_sourceVector->erase( m_sourceVector->begin() + aIndex );
107  }
108  }
std::vector< CLEANUP_ITEM * > * m_sourceVector
Definition: cleanup_item.h:76

References m_sourceVector.

◆ GetCount()

int VECTOR_CLEANUP_ITEMS_PROVIDER::GetCount ( int  aSeverity = -1)
inlineoverridevirtual

Implements RC_ITEMS_PROVIDER.

Definition at line 89 of file cleanup_item.h.

90  {
91  return m_sourceVector->size();
92  }
std::vector< CLEANUP_ITEM * > * m_sourceVector
Definition: cleanup_item.h:76

References m_sourceVector.

◆ GetItem()

CLEANUP_ITEM* VECTOR_CLEANUP_ITEMS_PROVIDER::GetItem ( int  aIndex)
inlineoverridevirtual

Function GetItem retrieves a RC_ITEM by index.

Implements RC_ITEMS_PROVIDER.

Definition at line 94 of file cleanup_item.h.

95  {
96  return m_sourceVector->at( aIndex );
97  }
std::vector< CLEANUP_ITEM * > * m_sourceVector
Definition: cleanup_item.h:76

References m_sourceVector.

◆ SetSeverities()

void VECTOR_CLEANUP_ITEMS_PROVIDER::SetSeverities ( int  aSeverities)
inlineoverridevirtual

Implements RC_ITEMS_PROVIDER.

Definition at line 85 of file cleanup_item.h.

86  {
87  }

Member Data Documentation

◆ m_sourceVector

std::vector<CLEANUP_ITEM*>* VECTOR_CLEANUP_ITEMS_PROVIDER::m_sourceVector
private

Definition at line 76 of file cleanup_item.h.

Referenced by DeleteAllItems(), DeleteItem(), GetCount(), and GetItem().


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