00001 /* 00002 * Copyright (c) 2004 CSIRO ICT Centre 00003 * 00004 * $Id: SimpleActiveList.h 587 2004-12-03 15:06:33Z nch $ 00005 */ 00006 00007 /* 00008 * SimpleActiveList implements an ActiveList as a simple 00009 * double ended queue of active objects. 00010 * 00011 * This is not an efficient implementation and should 00012 * not be used for large active lists. This is provided 00013 * as a comparison to the indexed active list and to 00014 * ensure the results obtained by that structure are 00015 * valid. 00016 */ 00017 00018 #ifndef SIMPLEACTIVELIST_DEFINED 00019 #define SIMPLEACTIVELIST_DEFINED 00020 00021 #include <deque> 00022 00023 #include "ActiveList.h" 00024 00025 class ActiveObject; 00026 class Object; 00027 class ObjectPairConsumer; 00028 class ObjectConsumer; 00029 00030 00031 class SimpleActiveList : public ActiveList 00032 { 00033 public: 00034 SimpleActiveList(); 00035 virtual ~SimpleActiveList(); 00036 00037 virtual void deletePriorObjects(double boundary, 00038 ObjectConsumer * uActiveCons); 00039 virtual void pushBack(Object const * object, 00040 bool matchedPreviously=false); 00041 virtual bool testObject(Object const * object, 00042 double upperLimitOnDistance, 00043 ObjectPairConsumer * matchedConsumer); 00044 virtual void clear(ObjectConsumer * uActiveCons); 00045 virtual void finished(ObjectConsumer * uActiveCons); 00046 virtual bool isEmpty(); 00047 virtual ActiveObject * popFront(); 00048 00049 private: 00050 typedef std::deque<ActiveObject *> SAL; 00051 SAL activeStructure; 00052 double activeMaxSD; 00053 00054 SimpleActiveList(SimpleActiveList const &); 00055 SimpleActiveList & operator=(SimpleActiveList const &); 00056 }; 00057 00058 #endif // ifndef SIMPLEACTIVELIST_DEFINED