GME  13
CoreMetaObject.h
Go to the documentation of this file.
00001 
00002 #ifndef MGA_COREMETAOBJECT_H
00003 #define MGA_COREMETAOBJECT_H
00004 
00005 #include <list>//slist
00006 
00007 class CCoreMetaProject;
00008 class CCoreMetaAttribute;
00009 
00010 // --------------------------- CCoreMetaObject
00011 
00012 class ATL_NO_VTABLE CCoreMetaObject : 
00013         public CComObjectRootEx<CComSingleThreadModel>,
00014         public IDispatchImpl<ICoreMetaObject, &__uuidof(ICoreMetaObject), &__uuidof(__MGACoreLib)>,
00015         public ISupportErrorInfoImpl<&__uuidof(ICoreMetaObject)>
00016 {
00017 public:
00018         CCoreMetaObject();
00019         ~CCoreMetaObject();
00020 
00021 
00022 DECLARE_GET_CONTROLLING_UNKNOWN()
00023 
00024 BEGIN_COM_MAP(CCoreMetaObject)
00025         COM_INTERFACE_ENTRY(ICoreMetaObject)
00026         COM_INTERFACE_ENTRY(IDispatch)
00027 END_COM_MAP()
00028 
00029 // ------- COM methods
00030 
00031 public:
00032         STDMETHODIMP get_Project(ICoreMetaProject **p);
00033         STDMETHODIMP get_MetaID(metaid_type *p);
00034         STDMETHODIMP get_Token(BSTR *p);
00035         STDMETHODIMP get_Name(BSTR *p);
00036         STDMETHODIMP get_Attribute(attrid_type attrid, ICoreMetaAttribute **p);
00037         STDMETHODIMP GetAttributeDisp(attrid_type attrid, ICoreMetaAttribute **p) { return get_Attribute( attrid, p); }
00038         STDMETHODIMP get_Attributes(ICoreMetaAttributes **p);
00039         STDMETHODIMP get_ClassIDs(SAFEARRAY **p);
00040         STDMETHODIMP AddAttribute(attrid_type attrid, BSTR token, BSTR name, 
00041                 valtype_type valtype, ICoreMetaAttribute **p);
00042         STDMETHODIMP AddClassID(guid_type classid);
00043 
00044 // ------- Properties
00045 
00046 public:
00047         typedef std::forward_list<CCoreMetaAttribute*> attributes_type;
00048 
00049         CCoreMetaProject *project;
00050         attributes_type attributes;
00051         std::vector<::GUID> classids;
00052 
00053         metaid_type metaid;
00054         std::string token;
00055         std::string name;
00056 
00057 // ------- Methods
00058 
00059 public:
00060         const attributes_type &GetAttributes() const { return attributes; }
00061         const std::vector<::GUID> &GetClassIDs() const { return classids; }
00062         metaid_type GetMetaID() const { return metaid; }
00063 
00064 };
00065 
00066 #endif//MGA_COREMETAOBJECT_H