mirror of https://gitlab.com/kicad/code/kicad.git
vector moved to COLLECTOR
This commit is contained in:
parent
1d9516c0a7
commit
e140e42746
|
@ -5,8 +5,6 @@
|
|||
#ifndef BASE_STRUCT_H
|
||||
#define BASE_STRUCT_H
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
||||
#if defined(DEBUG)
|
||||
#include <iostream> // needed for Show()
|
||||
|
@ -97,51 +95,10 @@ class EDA_BaseStruct;
|
|||
*/
|
||||
class INSPECTOR
|
||||
{
|
||||
private:
|
||||
/// A place to hold collected objects without taking ownership of their memory.
|
||||
std::vector<EDA_BaseStruct*> list;
|
||||
|
||||
|
||||
public:
|
||||
virtual ~INSPECTOR()
|
||||
{
|
||||
// empty the list so that ~list() does not try and delete all
|
||||
// the objects that it holds. list is not the owner of such objects.
|
||||
Empty();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function GetCount
|
||||
* returns the number of objects in the list
|
||||
*/
|
||||
int GetCount() const
|
||||
{
|
||||
return list.size();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function Empty
|
||||
* sets the list to empty
|
||||
*/
|
||||
void Empty()
|
||||
{
|
||||
list.clear();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function operator[]
|
||||
* is used for read only access and returns the object at index ndx.
|
||||
* @param ndx The index into the list.
|
||||
* @return EDA_BaseStruct* - or something derived from it, or NULL.
|
||||
*/
|
||||
EDA_BaseStruct* operator[]( int ndx ) const
|
||||
{
|
||||
if( (unsigned)ndx < (unsigned)GetCount() )
|
||||
return list[ndx];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue