00001 /* 00002 * Copyright (c) 2004 CSIRO ICT Centre 00003 * 00004 * $Id: ActiveList.h 587 2004-12-03 15:06:33Z nch $ 00005 */ 00006 00007 /* 00008 * ActiveList defines the interface that any active list 00009 * data structure must implement. It also provides some 00010 * simple methods that every concrete implementation will 00011 * make use of. 00012 * 00013 * Objects are pushed onto the back of the list and accessed 00014 * from the front. 00015 * 00016 * The testObject method searches through the active list for 00017 * active objects that match the provided testObject. Matched 00018 * pairs are reported to the matchedConsumer. Returns true 00019 * if a match was found. 00020 */ 00021 00022 #ifndef ACTIVELIST_DEFINED 00023 #define ACTIVELIST_DEFINED 00024 00025 class ActiveObject; 00026 class Object; 00027 class ObjectConsumer; 00028 class ObjectPairConsumer; 00029 class Profiler; 00030 00031 00032 class ActiveList 00033 { 00034 public: 00035 virtual ~ActiveList(); 00036 virtual void deletePriorObjects(double boundary, 00037 ObjectConsumer * uActiveCons)=0; 00038 virtual void pushBack(Object const * object, 00039 bool matchedPreviously=false)=0; 00040 virtual bool testObject(Object const * testObject, 00041 double upperLimitOnDistance, 00042 ObjectPairConsumer * matchedConsumer)=0; 00043 virtual void clear(ObjectConsumer * uActiveCons)=0; 00044 virtual void finished(ObjectConsumer * uActiveCons)=0; 00045 virtual bool isEmpty()=0; 00046 virtual ActiveObject * popFront()=0; 00047 00048 void setProfiler(Profiler * prof); 00049 00050 protected: 00051 Profiler * profiler; 00052 00053 ActiveList(); 00054 00055 private: 00056 ActiveList(ActiveList const &); 00057 ActiveList & operator=(ActiveList const &); 00058 }; 00059 00060 #endif // ifndef ACTIVELIST_DEFINED 00061