GME
13
|
00001 00002 #include "stdafx.h" 00003 #include "MgaMetaAspect.h" 00004 00005 // --------------------------- CMgaMetaAspect 00006 00007 // ------- Edit 00008 00009 STDMETHODIMP CMgaMetaAspect::CreatePart(IMgaMetaRole *role, IMgaMetaPart **p) 00010 { 00011 CHECK_OUT(p); 00012 00013 if( role == NULL ) 00014 COMRETURN(E_POINTER); 00015 00016 ASSERT( metaprojectref != NULL ); 00017 00018 COMTRY 00019 { 00020 CCoreObjectPtr self(GetUnknown()); 00021 ASSERT( self != NULL ); 00022 00023 CCoreObjectPtr other(role); 00024 ASSERT( other != NULL ); 00025 00026 CCoreObjectPtr part; 00027 metaproject->CreateMetaBase(METAID_METAPART, part); 00028 00029 part.PutPointerValue(ATTRID_PARTASPECT_PTR, self); 00030 part.PutPointerValue(ATTRID_PARTROLE_PTR, other); 00031 00032 COMTHROW( ::QueryInterface(part, p) ); 00033 } 00034 COMCATCH(;) 00035 } 00036 00037 // ------- Traverse 00038 00039 void CMgaMetaAspect::Traverse(CMgaMetaProject *metaproject, CCoreObjectPtr &me) 00040 { 00041 ASSERT( metaproject != NULL ); 00042 ASSERT( me != NULL ); 00043 00044 CMgaMetaBase::Traverse(metaproject, me); 00045 00046 TraverseCollection(metaproject, me, ATTRID_PARTASPECT_PTR); 00047 TraverseCollection(metaproject, me, ATTRID_ATTRLINK_USEDIN_PTR); 00048 }