00001
00041 #ifndef _CONTAINER_H
00042 #define _CONTAINER_H
00043
00044 #include "entity.h"
00045
00046 using std::ostream;
00047
00051 namespace container {
00052
00276 class Container: public Object {
00277 public:
00278
00279 const static Info* const TYPE_INFO;
00280
00281 private:
00282
00296 int count;
00297
00298 protected:
00299
00300 Container();
00301 Container(const Container& orig);
00302
00303 public:
00304
00305 virtual ~Container();
00306
00307
00308
00312 int getCount() const;
00313
00317 bool isEmpty() const;
00318
00329 virtual int purgeContents() = 0;
00330
00331 protected:
00332
00333
00334
00335 void setCount(int c);
00336
00337 void incCount();
00338
00339 void decCount();
00340
00341 public:
00342
00343
00344
00345 virtual ostream& renderState(ostream& os) const;
00346
00347 virtual const Info* typeInfo() const;
00348
00349 virtual Object* clone(bool deepCopy = false) const = 0;
00350
00351 };
00352
00353 }
00354 #endif