KiCad PCB EDA Suite
VECTOR_CLEANUP_ITEMS_PROVIDER Class Reference

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< std::shared_ptr< CLEANUP_ITEM > > *aList)
 
void SetSeverities (int aSeverities) override
 
int GetCount (int aSeverity=-1) const override
 
std::shared_ptr< RC_ITEMGetItem (int aIndex) const override
 Retrieve a RC_ITEM by index. More...
 
std::shared_ptr< CLEANUP_ITEMGetCleanupItem (int aIndex)
 
void DeleteItem (int aIndex, bool aDeep) override
 Remove (and optionally deletes) the indexed item from the list. More...
 
void DeleteAllItems (bool aIncludeExclusions, bool aDeep) override
 

Private Attributes

std::vector< std::shared_ptr< CLEANUP_ITEM > > * m_sourceVector
 

Detailed Description

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

Constructor & Destructor Documentation

◆ VECTOR_CLEANUP_ITEMS_PROVIDER()

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

Definition at line 72 of file cleanup_item.h.

72  :
73  m_sourceVector( aList )
74  {
75  }
std::vector< std::shared_ptr< CLEANUP_ITEM > > * m_sourceVector
Definition: cleanup_item.h:115

Member Function Documentation

◆ DeleteAllItems()

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

Implements RC_ITEMS_PROVIDER.

Definition at line 106 of file cleanup_item.h.

107  {
108  if( aDeep )
109  {
110  m_sourceVector->clear();
111  }
112  }
std::vector< std::shared_ptr< CLEANUP_ITEM > > * m_sourceVector
Definition: cleanup_item.h:115

References m_sourceVector.

◆ DeleteItem()

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

Remove (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 97 of file cleanup_item.h.

98  {
99  if( aDeep )
100  {
101  auto item = m_sourceVector->at( aIndex );
102  m_sourceVector->erase( m_sourceVector->begin() + aIndex );
103  }
104  }
std::vector< std::shared_ptr< CLEANUP_ITEM > > * m_sourceVector
Definition: cleanup_item.h:115

References m_sourceVector.

◆ GetCleanupItem()

std::shared_ptr<CLEANUP_ITEM> VECTOR_CLEANUP_ITEMS_PROVIDER::GetCleanupItem ( int  aIndex)
inline

Definition at line 91 of file cleanup_item.h.

92  {
93  return m_sourceVector->at( aIndex );
94  }
std::vector< std::shared_ptr< CLEANUP_ITEM > > * m_sourceVector
Definition: cleanup_item.h:115

References m_sourceVector.

◆ GetCount()

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

Implements RC_ITEMS_PROVIDER.

Definition at line 81 of file cleanup_item.h.

82  {
83  return m_sourceVector->size();
84  }
std::vector< std::shared_ptr< CLEANUP_ITEM > > * m_sourceVector
Definition: cleanup_item.h:115

References m_sourceVector.

◆ GetItem()

std::shared_ptr<RC_ITEM> VECTOR_CLEANUP_ITEMS_PROVIDER::GetItem ( int  aIndex) const
inlineoverridevirtual

Retrieve a RC_ITEM by index.

Implements RC_ITEMS_PROVIDER.

Definition at line 86 of file cleanup_item.h.

87  {
88  return m_sourceVector->at( aIndex );
89  }
std::vector< std::shared_ptr< CLEANUP_ITEM > > * m_sourceVector
Definition: cleanup_item.h:115

References m_sourceVector.

◆ SetSeverities()

void VECTOR_CLEANUP_ITEMS_PROVIDER::SetSeverities ( int  aSeverities)
inlineoverridevirtual

Implements RC_ITEMS_PROVIDER.

Definition at line 77 of file cleanup_item.h.

78  {
79  }

Member Data Documentation

◆ m_sourceVector

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

Definition at line 115 of file cleanup_item.h.

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


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