vector moved to COLLECTOR

This commit is contained in:
dickelbeck 2007-08-20 02:36:25 +00:00
parent 1d9516c0a7
commit e140e42746
1 changed files with 0 additions and 43 deletions

View File

@ -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;
}