00001 00041 #ifndef _SORTEDLIST_H 00042 #define _SORTEDLIST_H 00043 00044 #include "list.h" 00045 00046 namespace container { 00047 00053 class SortedList: public virtual List { 00054 public: 00055 00056 const static Info * const TYPE_INFO; 00057 00058 protected: 00059 00060 SortedList(); 00061 SortedList(const SortedList& orig); 00062 00063 public: 00064 00065 virtual ~SortedList(); 00066 00067 /********************* SortedList Methods (public) *********************/ 00068 00085 bool insertSorted(Entity* entity); 00086 00087 protected: 00088 00089 /********************* SortedList Methods (protected) *********************/ 00090 00096 virtual bool insertSorted_impl(Entity* entity) = 0; 00097 00098 private: 00099 00100 /********************* Container Methods (private - reduced visibility) *********************/ 00101 00105 inline void setCount(int c) { 00106 Container::setCount(c); 00107 } 00108 00112 inline void incCount() { 00113 Container::incCount(); 00114 } 00115 00119 inline void decCount() { 00120 Container::decCount(); 00121 } 00122 00123 public: 00124 00125 /********************* Object Methods (public) *********************/ 00126 00127 virtual ostream& renderState(ostream& os) const; 00128 00129 virtual const Info* typeInfo() const; 00130 00131 virtual Object* clone(bool deepCopy = false) const = 0; 00132 00133 }; 00134 00135 } // namespace container 00136 #endif /* _SORTEDLIST_H */