#ifndef OBJECT_H #define OBJECT_H #include <typeinfo> #include <string> #include <map> #include "base.h" //! a class to associate data with an ID class Object : public base { private: public: //! reference count int refcount; //! whether this object has quitted int quit; //! whether this object has been deleted int nuke_me; //! construct the object with given id Object(const char *_id); virtual ~Object(); //! the object id const char *id; //! set /key/ to /val/ virtual void set(const char *key, const char *val); //! set /key/ to /val/ virtual void set(const char *key, int val) { base::set(key, val); } //! set /key/ to /val/ virtual void set(const char *key, string val) { set(key, val.c_str()); } //! get string of /key/ virtual const char *get(const char *key) const; }; #endif