本文整理汇总了C++中CVariable::getFlag方法的典型用法代码示例。如果您正苦于以下问题:C++ CVariable::getFlag方法的具体用法?C++ CVariable::getFlag怎么用?C++ CVariable::getFlag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CVariable
的用法示例。
在下文中一共展示了CVariable::getFlag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: storeAsRestrictedType
/***************************************************************************
* Convert var and store to type constraint var
* Src is on the top of eval stack
***************************************************************************/
void CCilVm::storeAsRestrictedType( CVariable& varDest )
{
assert( varDest.getFlag() & OPERAND_FLAG_STRICT );
switch( varDest.iOperandType )
{
case OPERAND_UNDEFINED:
case OPERAND_NULL:
case OPERAND_NAN:
//Throw TypeError
ThrowExceptionFromVm( &wstring( ERRORSTRING_TYPEERROR_STORESTATICFIELD ),
&wstring( NAME_BUILTIN_ERROR_OBJECT ),
ERROR_TYPEERROR_STORESTATICFIELD );
break;
case OPERAND_INT:
varDest.iValue = getEvalStackFirstEntry().toInt();
break;
case OPERAND_INT64:
varDest.i64Value = getEvalStackFirstEntry().toInt64();
break;
case OPERAND_FLOAT:
varDest.fValue = getEvalStackFirstEntry().toFloat();
break;
case OPERAND_DOUBLE:
varDest.dValue = getEvalStackFirstEntry().toDouble();
break;
case OPERAND_BOOLEAN:
varDest.bValue = getEvalStackFirstEntry().toBoolean();
break;
case OPERAND_STRING:
varDest.pString = getEvalStackFirstEntry().toString( this );
break;
case OPERAND_OBJECTREF:
{
//Try object conversion
CObjectTypeInfo& info = getMetaData().getObject( varDest.GetConstraintRid() );
RID ridCtor = info.getConstructor();
CVariable vars[ 2 ];
vars[ 0 ] = varDest;
vars[ 1 ] = getEvalStackFirstEntry();
CVariable* pVar = invokeMethod( ridCtor, 2, vars );
delete( pVar );
}
break;
case OPERAND_UNSIGNEDINT:
case OPERAND_UNSIGNEDINT64:
case OPERAND_SYSTEM_DELETION:
default:
Debug_Fatal( "Unhandled type constraint");
break;
}
}