Commit e140e427 authored by dickelbeck's avatar dickelbeck

vector moved to COLLECTOR

parent 1d9516c0
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
#ifndef BASE_STRUCT_H #ifndef BASE_STRUCT_H
#define BASE_STRUCT_H #define BASE_STRUCT_H
#include <vector>
#if defined(DEBUG) #if defined(DEBUG)
#include <iostream> // needed for Show() #include <iostream> // needed for Show()
...@@ -97,51 +95,10 @@ class EDA_BaseStruct; ...@@ -97,51 +95,10 @@ class EDA_BaseStruct;
*/ */
class INSPECTOR class INSPECTOR
{ {
private:
/// A place to hold collected objects without taking ownership of their memory.
std::vector<EDA_BaseStruct*> list;
public: public:
virtual ~INSPECTOR() 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;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment