00001 00041 #ifndef _ORDEREDLIST_H 00042 #define _ORDEREDLIST_H 00043 00044 #include "list.h" 00045 00046 using std::ostream; 00047 using std::string; 00048 00049 namespace container { 00050 00058 class OrderedList: public virtual List { 00059 public: 00060 00061 const static Info* const TYPE_INFO; 00062 00063 protected: 00064 00065 OrderedList(); 00066 OrderedList(const OrderedList& pattern); 00067 00068 public: 00069 00070 virtual ~OrderedList(); 00071 00072 /********************* OrderedList Methods (public) *********************/ 00073 00086 void append(Entity* entity); 00087 00095 void insertBefore(Entity* entity); 00096 00097 protected: 00098 00099 /********************* OrderedList Methods (protected) *********************/ 00100 00106 virtual void append_impl(Entity* entity) = 0; 00107 00113 virtual void insertBefore_impl(Entity* entity) = 0; 00114 00115 private: 00116 00117 /********************* Container Methods (private - reduced visibility) *********************/ 00118 00122 inline void setCount(int c) { 00123 Container::setCount(c); 00124 } 00125 00129 inline void incCount() { 00130 Container::incCount(); 00131 } 00132 00136 inline void decCount() { 00137 Container::decCount(); 00138 } 00139 00140 public: 00141 00142 /********************* Object Methods (public) *********************/ 00143 00144 virtual ostream& renderState(ostream& os) const; 00145 00146 virtual const Info* typeInfo() const; 00147 00148 virtual Object* clone(bool deepCopy = false) const = 0; 00149 }; 00150 00151 } // namespace container 00152 00153 #endif /* _ORDEREDLIST_H */