GME
13
|
00001 00002 #ifndef MGA_MGAMETAASPECT_H 00003 #define MGA_MGAMETAASPECT_H 00004 00005 #ifndef MGA_MGAMETABASE_H 00006 #include "MgaMetaBase.h" 00007 #endif 00008 00009 // --------------------------- CMgaMetaAspect 00010 00011 class ATL_NO_VTABLE CMgaMetaAspect : 00012 public CComObjectRootEx<CComSingleThreadModel>, 00013 public CComCoClass<CMgaMetaAspect, &__uuidof(MgaMetaAspect)>, 00014 public IDispatchImpl<IMgaMetaAspect, &__uuidof(IMgaMetaAspect), &__uuidof(__MGAMetaLib)>, 00015 public CMgaMetaBase 00016 { 00017 public: 00018 IUnknown *GetUnknown() const { return (IMgaMetaAspect*)this; } 00019 00020 DECLARE_REGISTRY_RESOURCEID(IDR_MGAMETAASPECT) 00021 DECLARE_ONLY_AGGREGATABLE(CMgaMetaAspect) 00022 00023 BEGIN_COM_MAP(CMgaMetaAspect) 00024 COM_INTERFACE_ENTRY(IMgaMetaAspect) 00025 COM_INTERFACE_ENTRY2(IMgaMetaBase, CMgaMetaBase) 00026 COM_INTERFACE_ENTRY2(IDispatch, IMgaMetaAspect) 00027 END_COM_MAP() 00028 00029 DECLARE_MGAMETABASE() 00030 00031 public: 00032 STDMETHOD(get_ParentModel)(IMgaMetaModel **p) 00033 { return ComGetPointerValue(GetUnknown(), ATTRID_ASPECTS_COLL, p); } 00034 00035 STDMETHOD(get_Parts)(IMgaMetaParts **p) 00036 { return ComGetCollectionValue<IMgaMetaPart>(GetUnknown(), ATTRID_PARTASPECT_PTR, p); } 00037 00038 STDMETHOD(get_Attributes)(IMgaMetaAttributes **p) 00039 { return ComGetSortedLinkCollValue<IMgaMetaAttribute>(GetUnknown(), 00040 ATTRID_ATTRLINK_USEDIN_PTR, ATTRID_ATTRLINK_ATTR_PTR, p); } 00041 00042 // ------- Edit 00043 00044 public: 00045 STDMETHOD(CreatePart)(IMgaMetaRole *role, IMgaMetaPart **p); 00046 00047 STDMETHOD(AddAttribute)(IMgaMetaAttribute *p) 00048 { return ComAddLink(this, METAID_METAATTRLINK, ATTRID_ATTRLINK_USEDIN_PTR, 00049 ATTRID_ATTRLINK_ATTR_PTR, p); } 00050 00051 STDMETHOD(RemoveAttribute)(IMgaMetaAttribute *p) 00052 { return ComRemoveLink(this, METAID_METAATTRLINK, ATTRID_ATTRLINK_USEDIN_PTR, 00053 ATTRID_ATTRLINK_ATTR_PTR, p); } 00054 00055 // ------- Traverse 00056 00057 public: 00058 static void Traverse(CMgaMetaProject *metaproject, CCoreObjectPtr &me); 00059 00060 }; 00061 00062 #endif//MGA_MGAMETAASPECT_H