GME  13
MgaMetaPart.cpp
Go to the documentation of this file.
00001 
00002 #include "stdafx.h"
00003 #include "MgaMetaPart.h"
00004 
00005 
00006 // --------------------------- CMgaMetaPart
00007 
00008 #define MGAMETAPART_PRIMARY             0x0001
00009 #define MGAMETAPART_LINKED              0x0002
00010 
00011 STDMETHODIMP CMgaMetaPart::get_IsPrimary(VARIANT_BOOL *p)
00012 {
00013         COMTRY
00014         {
00015                 CCoreObjectPtr self(GetUnknown());
00016                 ASSERT( self != NULL );
00017 
00018                 long a = self.GetLongValue(ATTRID_PARTDATA);
00019 
00020                 *p = (a & MGAMETAPART_PRIMARY) ? VARIANT_TRUE : VARIANT_FALSE;
00021         }
00022         COMCATCH(;)
00023 }
00024 
00025 STDMETHODIMP CMgaMetaPart::get_IsLinked(VARIANT_BOOL *p)
00026 {
00027         COMTRY
00028         {
00029                 CCoreObjectPtr self(GetUnknown());
00030                 ASSERT( self != NULL );
00031 
00032                 long a = self.GetLongValue(ATTRID_PARTDATA);
00033 
00034                 *p = (a & MGAMETAPART_LINKED) ? VARIANT_TRUE : VARIANT_FALSE;
00035         }
00036         COMCATCH(;)
00037 }
00038 
00039 STDMETHODIMP CMgaMetaPart::put_IsPrimary(VARIANT_BOOL p)
00040 {
00041         COMTRY
00042         {
00043                 CCoreObjectPtr self(GetUnknown());
00044                 ASSERT( self != NULL );
00045 
00046                 long a = self.GetLongValue(ATTRID_PARTDATA);
00047 
00048                 if( p == VARIANT_FALSE )
00049                         a &= (~MGAMETAPART_PRIMARY);
00050                 else
00051                         a |= MGAMETAPART_PRIMARY;
00052 
00053                 self.PutLongValue(ATTRID_PARTDATA, a);
00054         }
00055         COMCATCH(;)
00056 }
00057 
00058 STDMETHODIMP CMgaMetaPart::put_IsLinked(VARIANT_BOOL p)
00059 {
00060         COMTRY
00061         {
00062                 CCoreObjectPtr self(GetUnknown());
00063                 ASSERT( self != NULL );
00064 
00065                 long a = self.GetLongValue(ATTRID_PARTDATA);
00066 
00067                 if( p == VARIANT_FALSE )
00068                         a &= (~MGAMETAPART_LINKED);
00069                 else
00070                         a |= MGAMETAPART_LINKED;
00071 
00072                 self.PutLongValue(ATTRID_PARTDATA, a);
00073         }
00074         COMCATCH(;)
00075 }
00076 
00077 // ------- Traverse
00078 
00079 void CMgaMetaPart::Traverse(CMgaMetaProject *metaproject, CCoreObjectPtr &me)
00080 {
00081         ASSERT( metaproject != NULL );
00082         ASSERT( me != NULL );
00083 
00084         CMgaMetaBase::Traverse(metaproject, me);
00085 
00086         TraverseCollection(metaproject, me, ATTRID_REGNODES_COLL);
00087 }