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< std::shared_ptr< CLEANUP_ITEM > > *aList)
 
void SetSeverities (int aSeverities) override
 
int GetCount (int aSeverity=-1) override
 
std::shared_ptr< RC_ITEMGetItem (int aIndex) 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

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

77  :
78  m_sourceVector( aList )
79  {
80  }
std::vector< std::shared_ptr< CLEANUP_ITEM > > * m_sourceVector
Definition: cleanup_item.h:73

Member Function Documentation

◆ DeleteAllItems()

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

Implements RC_ITEMS_PROVIDER.

Definition at line 111 of file cleanup_item.h.

112  {
113  if( aDeep )
114  {
115  m_sourceVector->clear();
116  }
117  }
std::vector< std::shared_ptr< CLEANUP_ITEM > > * m_sourceVector
Definition: cleanup_item.h:73

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

103  {
104  if( aDeep )
105  {
106  auto item = m_sourceVector->at( aIndex );
107  m_sourceVector->erase( m_sourceVector->begin() + aIndex );
108  }
109  }
std::vector< std::shared_ptr< CLEANUP_ITEM > > * m_sourceVector
Definition: cleanup_item.h:73

References m_sourceVector.

◆ GetCleanupItem()

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

Definition at line 96 of file cleanup_item.h.

97  {
98  return m_sourceVector->at( aIndex );
99  }
std::vector< std::shared_ptr< CLEANUP_ITEM > > * m_sourceVector
Definition: cleanup_item.h:73

References m_sourceVector.

◆ GetCount()

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

Implements RC_ITEMS_PROVIDER.

Definition at line 86 of file cleanup_item.h.

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

References m_sourceVector.

◆ GetItem()

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

Retrieve a RC_ITEM by index.

Implements RC_ITEMS_PROVIDER.

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:73

References m_sourceVector.

◆ SetSeverities()

void VECTOR_CLEANUP_ITEMS_PROVIDER::SetSeverities ( int  aSeverities)
inlineoverridevirtual

Implements RC_ITEMS_PROVIDER.

Definition at line 82 of file cleanup_item.h.

83  {
84  }

Member Data Documentation

◆ m_sourceVector

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

Definition at line 73 of file cleanup_item.h.

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


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