00001 #ifndef OBJECT_H_INCLUDED
00002 #define OBJECT_H_INCLUDED
00003
00004 #include <boost/archive/text_oarchive.hpp>
00005 #include <boost/archive/text_iarchive.hpp>
00006 #include "RTTI.h"
00007
00008
00009 #include <string>
00010
00011 using namespace std;
00012
00013 class Object{
00014 public:
00015 static const RTTI TYPE;
00016 virtual const RTTI& getType() const{ return TYPE; }
00017
00018 protected:
00019 unsigned int id;
00020 string name;
00021
00022 private:
00023 int refCount;
00024
00025
00026 friend class boost::serialization::access;
00027 template<class Archive>
00028 void serialize(Archive& ar, const unsigned int version){
00029 ar & name;
00030 }
00031
00032 public:
00033 Object();
00034 Object(const string& name);
00035 virtual ~Object();
00036 void setName(const string& name);
00037 const string& getName() const;
00038
00039 public:
00040
00041 void incRef();
00042 void decRef();
00043 int getRefCount()const;
00044 };
00045
00046 #endif // OBJECT_H_INCLUDED