GME  13
MgaMetaPointerSpec.cpp
Go to the documentation of this file.
00001 
00002 #include "stdafx.h"
00003 #include "MgaMetaPointerSpec.h"
00004 #include "MgaMetaPointerItem.h"
00005 
00006 // --------------------------- CMgaMetaPointerSpec
00007 
00008 STDMETHODIMP CMgaMetaPointerSpec::get_Parent(IDispatch **p)
00009 {
00010         CHECK_OUT(p);
00011 
00012         {
00013                 CComObjPtr<IMgaMetaReference> self;
00014                 if( SUCCEEDED(::QueryInterface(GetUnknown(), self)) )
00015                         return ::QueryInterface(GetUnknown(), p);
00016         }
00017 
00018         {
00019                 CComObjPtr<IMgaMetaSet> self;
00020                 if( SUCCEEDED(::QueryInterface(GetUnknown(), self)) )
00021                         return ::QueryInterface(GetUnknown(), p);
00022         }
00023 
00024         return ComGetPointerValue(GetUnknown(), ATTRID_PTRSPECS_COLL,p);
00025 }
00026 
00027 // ------- Methods
00028 
00029 void CMgaMetaPointerSpec::Traverse(CMgaMetaProject *metaproject, CCoreObjectPtr &me)
00030 {
00031         ASSERT( metaproject != NULL );
00032         ASSERT( me != NULL );
00033 
00034         TraverseCollection(metaproject, me, ATTRID_PTRITEMS_COLL);
00035 }
00036 
00037 bool CMgaMetaPointerSpec::CheckPath(CCoreObjectPtr &self, pathitems_type &pathitems, bool global)
00038 {
00039         ASSERT( self != NULL );
00040 
00041         coreobjects_type coreobjects;
00042         self.GetCollectionValue(ATTRID_PTRITEMS_COLL, coreobjects);
00043 
00044         coreobjects_iterator i = coreobjects.begin();
00045         coreobjects_iterator e = coreobjects.end();
00046         while( i != e )
00047         {
00048                 if( CMgaMetaPointerItem::CheckPath(*i, pathitems, global) )
00049                         return true;
00050 
00051                 ++i;
00052         }
00053 
00054         return false;
00055 }
00056