GME
13
|
00001 00002 #include "stdafx.h" 00003 #include "MgaMetaConstraint.h" 00004 00005 // --------------------------- CMgaMetaConstraint 00006 00007 STDMETHODIMP CMgaMetaConstraint::get_Depth(constraint_depth_enum *p) 00008 { 00009 CHECK_OUT(p); 00010 00011 COMTRY 00012 { 00013 CCoreObjectPtr me(GetUnknown()); 00014 *p = static_cast<constraint_depth_enum>(me.GetLongValue(ATTRID_CONSDEPTH)); 00015 00016 if( *p != CONSTRAINT_DEPTH_ZERO && 00017 *p != CONSTRAINT_DEPTH_ANY ) 00018 *p = CONSTRAINT_DEPTH_ONE; 00019 } 00020 COMCATCH(;) 00021 } 00022 00023 STDMETHODIMP CMgaMetaConstraint::get_Type(constraint_type_enum *p) 00024 { 00025 CHECK_OUT(p); 00026 00027 COMTRY 00028 { 00029 CCoreObjectPtr me(GetUnknown()); 00030 *p = static_cast<constraint_type_enum>(me.GetLongValue(ATTRID_CONSTYPE)); 00031 00032 if( *p != CONSTRAINT_TYPE_EVENTBASED && 00033 *p != CONSTRAINT_TYPE_FUNCTION ) 00034 *p = CONSTRAINT_TYPE_ONDEMAND; 00035 } 00036 COMCATCH(;) 00037 } 00038 00039 STDMETHODIMP CMgaMetaConstraint::SetDefinedForNamespace( BSTR pStr) 00040 { 00041 return ComPutAttrValue(GetUnknown(), ATTRID_CONSNAMESPC, pStr); 00042 } 00043 00044 STDMETHODIMP CMgaMetaConstraint::GetDefinedForNamespace( BSTR * pStr) 00045 { 00046 return ComGetAttrValue(GetUnknown(), ATTRID_CONSNAMESPC, pStr); 00047 }