GME
13
|
00001 00002 #ifndef MGA_MGAMETAMODEL_H 00003 #define MGA_MGAMETAMODEL_H 00004 00005 #ifndef MGA_MGAMETAFCO_H 00006 #include "MgaMetaFCO.h" 00007 #endif 00008 00009 // --------------------------- CMgaMetaModel 00010 00011 class ATL_NO_VTABLE CMgaMetaModel : 00012 public CComCoClass<CMgaMetaModel, &__uuidof(MgaMetaModel)>, 00013 public CComObjectRootEx<CComSingleThreadModel>, 00014 public IDispatchImpl<IMgaMetaModel, &__uuidof(IMgaMetaModel), &__uuidof(__MGAMetaLib)>, 00015 public CMgaMetaFCO, 00016 public ISupportErrorInfo 00017 { 00018 public: 00019 IUnknown *GetUnknown() const { return (IMgaMetaModel*)this; } 00020 00021 DECLARE_REGISTRY_RESOURCEID(IDR_MGAMETAMODEL) 00022 DECLARE_ONLY_AGGREGATABLE(CMgaMetaModel) 00023 00024 BEGIN_COM_MAP(CMgaMetaModel) 00025 COM_INTERFACE_ENTRY(IMgaMetaModel) 00026 COM_INTERFACE_ENTRY(IMgaMetaFCO) 00027 COM_INTERFACE_ENTRY2(IMgaMetaBase, CMgaMetaBase) 00028 COM_INTERFACE_ENTRY2(IDispatch, IMgaMetaModel) 00029 COM_INTERFACE_ENTRY(ISupportErrorInfo) 00030 END_COM_MAP() 00031 00032 DECLARE_MGAMETAFCO() 00033 00034 STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid) 00035 { 00036 return ( 00037 IsEqualGUID(riid, __uuidof(IMgaMetaModel)) 00038 || IsEqualGUID(riid, __uuidof(IMgaMetaFCO)) 00039 || IsEqualGUID(riid, __uuidof(IMgaMetaBase)) 00040 || IsEqualGUID(riid, __uuidof(IDispatch)) 00041 ) ? S_OK : S_FALSE; 00042 } 00043 00044 public: 00045 STDMETHOD(get_DefinedFCOs)(IMgaMetaFCOs **p) 00046 { return ComGetSortedCollValue<IMgaMetaFCO>(GetUnknown(), ATTRID_DEFFCO_PTR, p); } 00047 00048 STDMETHOD(get_DefinedFCOByName)(BSTR name, VARIANT_BOOL inscope, IMgaMetaFCO **p); 00049 00050 STDMETHOD(GetDefinedFCOByNameDisp)(BSTR name, VARIANT_BOOL inscope, IMgaMetaFCO **p) 00051 { return get_DefinedFCOByName( name, inscope, p); } 00052 00053 STDMETHOD(get_Roles)(IMgaMetaRoles **p) 00054 { return ComGetSortedCollValue<IMgaMetaRole>(GetUnknown(), ATTRID_ROLES_COLL, p); } 00055 00056 STDMETHOD(get_RoleByName)(BSTR name, IMgaMetaRole **p); 00057 00058 STDMETHOD(GetRoleByNameDisp)(BSTR name, IMgaMetaRole **p) 00059 { return get_RoleByName( name, p); } 00060 00061 STDMETHOD(get_Aspects)(IMgaMetaAspects **p) 00062 { return ComGetSortedCollValue<IMgaMetaAspect>(GetUnknown(), ATTRID_ASPECTS_COLL, p); } 00063 00064 STDMETHOD(get_AspectByName)(BSTR name, IMgaMetaAspect **p); 00065 00066 STDMETHOD(GetAspectByNameDisp)(BSTR name, IMgaMetaAspect **p) 00067 { return get_AspectByName( name, p); } 00068 00069 STDMETHOD(LegalConnectionRoles)(BSTR paths, IMgaMetaRoles **p); 00070 STDMETHOD(LegalReferenceRoles)(BSTR path, IMgaMetaRoles **p); 00071 STDMETHOD(LegalSetRoles)(BSTR path, IMgaMetaRoles **p); 00072 STDMETHOD(LegalRoles)(IMgaMetaFCO *kind, IMgaMetaRoles **p); 00073 00074 // ------- Edit 00075 00076 public: 00077 STDMETHOD(DefineModel)(IMgaMetaModel **p) 00078 { return ComDefineBase(this, METAID_METAMODEL, ATTRID_DEFFCO_PTR, p); } 00079 00080 STDMETHOD(DefineAtom)(IMgaMetaAtom **p) 00081 { return ComDefineBase(this, METAID_METAATOM, ATTRID_DEFFCO_PTR, p); } 00082 00083 STDMETHOD(DefineReference)(IMgaMetaReference **p) 00084 { return ComDefineBase(this, METAID_METAREFERENCE, ATTRID_DEFFCO_PTR, p); } 00085 00086 STDMETHOD(DefineSet)(IMgaMetaSet **p) 00087 { return ComDefineBase(this, METAID_METASET, ATTRID_DEFFCO_PTR, p); } 00088 00089 STDMETHOD(DefineConnection)(IMgaMetaConnection **p) 00090 { return ComDefineBase(this, METAID_METACONNECTION, ATTRID_DEFFCO_PTR, p); } 00091 00092 STDMETHOD(CreateRole)(IMgaMetaFCO *kind, IMgaMetaRole **p); 00093 00094 STDMETHOD(CreateAspect)(IMgaMetaAspect **p) 00095 { return ComDefineBase(this, METAID_METAASPECT, ATTRID_ASPECTS_COLL, p); } 00096 00097 // ------- Traverse 00098 00099 public: 00100 static void Traverse(CMgaMetaProject *metaproject, CCoreObjectPtr &me); 00101 00102 }; 00103 00104 #endif//MGA_MGAMETAMODEL_H