GME  13
CoreMetaProject.h
Go to the documentation of this file.
00001 
00002 #ifndef MGA_COREMETAPROJECT_H
00003 #define MGA_COREMETAPROJECT_H
00004 
00005 #include <list>//slist
00006 
00007 class CCoreMetaObject;
00008 
00009 // --------------------------- CCoreMetaProject
00010 
00011 class ATL_NO_VTABLE CCoreMetaProject : 
00012         public CComObjectRootEx<CComSingleThreadModel>,
00013         public CComCoClass<CCoreMetaProject, &__uuidof(CoreMetaProject)>,
00014         public IDispatchImpl<ICoreMetaProject, &__uuidof(ICoreMetaProject), &__uuidof(__MGACoreLib)>,
00015         public ISupportErrorInfoImpl<&__uuidof(ICoreMetaProject)>
00016 {
00017 public:
00018         CCoreMetaProject();
00019         ~CCoreMetaProject();
00020 
00021 DECLARE_REGISTRY_RESOURCEID(IDR_COREMETAPROJECT)
00022 
00023 BEGIN_COM_MAP(CCoreMetaProject)
00024         COM_INTERFACE_ENTRY(ICoreMetaProject)
00025         COM_INTERFACE_ENTRY(IDispatch)
00026 END_COM_MAP()
00027 
00028 // ------- COM methods
00029 
00030 public:
00031         STDMETHODIMP get_GUID(guid_type *p);
00032         STDMETHODIMP put_GUID(guid_type p);
00033         STDMETHODIMP get_Token(BSTR *p);
00034         STDMETHODIMP put_Token(BSTR p);
00035         STDMETHODIMP get_Name(BSTR *p);
00036         STDMETHODIMP put_Name(BSTR p);
00037         STDMETHODIMP get_Object(metaid_type metaid, ICoreMetaObject **p);
00038         STDMETHODIMP GetObjectDisp(metaid_type metaid, ICoreMetaObject **p) { return get_Object( metaid, p); }
00039         STDMETHODIMP get_Objects(ICoreMetaObjects **p);
00040         STDMETHODIMP AddObject(metaid_type metaid, BSTR token, BSTR name, ICoreMetaObject **p);
00041 
00042 // ------- Methods
00043 
00044 public:
00045         // returns NULL if not found
00046         CCoreMetaObject *GetObject(metaid_type metaid) NOTHROW;
00047 
00048 // ------- Properties
00049 
00050 public:
00051 
00052         typedef std::forward_list<CCoreMetaObject*> objects_type;
00053         typedef objects_type::iterator objects_iterator;
00054 
00055         objects_type objects;
00056         std::string name;
00057         std::string token;
00058         ::GUID guid;
00059 };
00060 
00061 #ifndef _ATL_DEBUG_INTERFACES
00062 inline IUnknown *CastToUnknown(CCoreMetaProject *p) { return (IUnknown*)(ICoreMetaProject*)p; }
00063 inline CCoreMetaProject *CastToMetaProject(IUnknown *p) { return (CCoreMetaProject*)(ICoreMetaProject*)p; }
00064 #else
00065 inline IUnknown *CastToUnknown(CCoreMetaProject *p) { return (IUnknown*)(ICoreMetaProject*)p; }
00066 inline CCoreMetaProject *CastToMetaProject(IUnknown *p) { return (CCoreMetaProject*)(ICoreMetaProject*)((ATL::_QIThunk *)(p))->m_pUnk; }
00067 #endif
00068 
00069 #endif//MGA_COREMETAPROJECT_H