[GME-commit]
GMESRC/GME/ConstraintManager OCLTypeExGMECM.cpp,1.25,1.26
OCLTypeExGMEEC.cpp,1.19,1.20
gme-commit at list.isis.vanderbilt.edu
gme-commit at list.isis.vanderbilt.edu
Fri Aug 27 10:16:34 CDT 2004
Update of /var/lib/gme/GMESRC/GME/ConstraintManager
In directory braindrain:/tmp/cvs-serv19898
Modified Files:
OCLTypeExGMECM.cpp OCLTypeExGMEEC.cpp
Log Message:
attrByDefault OCL function introduced for the checking of isAbstract
CVS User: bogyom
Index: OCLTypeExGMECM.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/ConstraintManager/OCLTypeExGMECM.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** OCLTypeExGMECM.cpp 18 May 2004 13:30:58 -0000 1.25
--- OCLTypeExGMECM.cpp 27 Aug 2004 14:16:31 -0000 1.26
***************
*** 1200,1203 ****
--- 1200,1234 ----
};
+ //---
+ GMEMETHOD( TFCO_AttrByDefault )
+ {
+ void operator()()
+ {
+ DECL_GMEFCO( spThis, GetThis() );
+ if ( ! spThis.p )
+ ThrowException( "Object is null." );
+ DECL_STRING( strName, GetArgument( 0 ) );
+
+ // Iterating through the FirstFCO's attributes
+ CComPtr<IMgaMetaFCO> metafco;
+ if ( ! SUCCEEDED( spThis->get_Meta(&metafco)))
+ ThrowException( "There is no IMgaMetaFCO interface." );
+ CComPtr<IMgaMetaAttribute> metaattrib;
+ if ( ! SUCCEEDED( metafco->get_AttributeByName(CComBSTR( OclCommonEx::Convert( strName ) ), &metaattrib)))
+ ThrowException( "Attribute [ " + strName + " ] does not exist." );
+ CComPtr<IMgaAttribute> attrib;
+ if ( ! SUCCEEDED( spThis->get_Attribute(metaattrib, &attrib)))
+ ThrowException( "There is no IMgaAttribute interface of attribute [ " + strName + " ]." );
+ long status;
+ if ( ! SUCCEEDED( attrib->get_Status(&status)))
+ ThrowException( "status cannot be read of attribute [ " + strName + " ]." );
+
+ // Check whether it is a default value (if it is defined in the meta it's default)
+ bool isDefault = (status < 0);
+ SetResult( CREATE_BOOLEAN( GetTypeManager(), isDefault) ); // boolean
+ }
+ };
+
+ //---
void TFCO_AttributeFactory::GetFeatures( const OclSignature::Attribute& signature, OclMeta::AttributeVector& vecFeatures )
***************
*** 1483,1491 ****
if ( ( strName == "attribute" ) && iCount == 1 ) {
! FPV vecParams; TS vecType;
vecParams.push_back( FP( "name", "ocl::String", true ) );
vecType.push_back( "ocl::Any" );
vecFeatures.push_back( new OclMeta::Method( strName, vecParams, vecType, new TFCO_Attribute(), false ) );
}
}
--- 1514,1530 ----
if ( ( strName == "attribute" ) && iCount == 1 ) {
! FPV vecParams; TS vecType;
vecParams.push_back( FP( "name", "ocl::String", true ) );
vecType.push_back( "ocl::Any" );
vecFeatures.push_back( new OclMeta::Method( strName, vecParams, vecType, new TFCO_Attribute(), false ) );
}
+ //----
+ if ( ( strName == "attrByDefault" ) && iCount == 1 ) {
+ FPV vecParams; TS vecType;
+ vecParams.push_back( FP( "name", "ocl::String", true ) );
+ vecType.push_back( "ocl::Boolean" );
+ vecFeatures.push_back( new OclMeta::Method( strName, vecParams, vecType, new TFCO_AttrByDefault(), false ) );
+ }
+ //----
}
Index: OCLTypeExGMEEC.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/ConstraintManager/OCLTypeExGMEEC.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** OCLTypeExGMEEC.cpp 18 May 2004 13:30:58 -0000 1.19
--- OCLTypeExGMEEC.cpp 27 Aug 2004 14:16:31 -0000 1.20
***************
*** 564,567 ****
--- 564,575 ----
vecFeatures.push_back( new OclMeta::Method( strName, vecParams, vecType, NULL, false ) );
}
+ //----
+ if ( ( strName == "attrByDefault" ) && iCount == 1 ) {
+ FPV vecParams; TS vecType;
+ vecParams.push_back( FP( "name", "ocl::String", true ) );
+ vecType.push_back( "ocl::Boolean" );
+ vecFeatures.push_back( new OclMeta::Method( strName, vecParams, vecType, NULL, false ) );
+ }
+ //----
}
More information about the GME-commit
mailing list