00001
00002 #ifndef __UPF_CLASSINFO_H__
00003 #define __UPF_CLASSINFO_H__
00004
00005 #include "upf/upf.h"
00006
00007 #ifdef HAVE_CONFIG_H
00008 #include "config.h"
00009 #endif
00010
00011 namespace upf { namespace impl {
00012
00013 using namespace std;
00014
00015 class Manager;
00016
00017
00018 class ClassInfo : public IClassInfo, public IWriteableClassInfo
00019 {
00020 friend class Manager;
00021
00022 public:
00023 ClassInfo() : m_frozen(false) {}
00024 virtual ~ClassInfo() {}
00025
00026 void _initInstance();
00027
00028
00029 CID getCID() { return m_cid; }
00030 string getName() { return m_name; }
00031 Ptr<IClassFactory> getFactory() { return m_factory; }
00032 IIDsList getInterfaces() { return m_ifaces; }
00033 bool implementsInterface(const IID& iface);
00034 string getProperty(const string& name);
00035 Properties getProperties();
00036
00037
00038 void setCID(CID id);
00039 void setName(const string& name);
00040 void setFactory(IClassFactory *f);
00041 void addInterface(const IID& id);
00042 void addProperty(const string& name, const string& value);
00043
00044 Ptr<IClassInfo> freeze();
00045
00046 private:
00047 bool m_frozen;
00048 string m_name;
00049 Ptr<IClassFactory> m_factory;
00050 IIDsList m_ifaces;
00051 CID m_cid;
00052 StringHash<string> m_properties;
00053
00054 UPF_DECLARE_CLASS(ClassInfo)
00055 };
00056
00057
00058 } }
00059
00060 #endif