本文整理汇总了C++中I_Value类的典型用法代码示例。如果您正苦于以下问题:C++ I_Value类的具体用法?C++ I_Value怎么用?C++ I_Value使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了I_Value类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Compare
int Value_money_null::Compare(
const I_Value& inOther,
COMPARE_TYPE inCompareType ) const
{
argused1( inCompareType );
FBL_CHECK( get_Type() == inOther.get_Type() );
// If one of values (this or inOther) have null...
if( get_IsNull() )
{
if( inOther.get_IsNull() )
return 0; // Both are NULL
else
return -1; // Any NULL is less then NOT NULL
}
else
{
if( inOther.get_IsNull() )
return 1; // Any NOT NULL is greater then NULL
else
{
// ... have not null values - compare them.
return Value_money::Compare( inOther );
}
}
}
示例2: CreateValue
I_Value* CreateValue(
VALUE_TYPE inType,
vuint16 inFlags,
void* inParam1,
void* inParam2,
bool inIsRemote )
{
TVALUE_FACTORY::iterator p = gValueFactory.find( inType );
if( p == gValueFactory.end() )
return nullptr;
MAKE_VALUE_FUNC_PTR pFactory = (*p).second;
bool Nullable = bool(inFlags & fNullable);
I_Value* pValue = pFactory( Nullable, inParam1, inParam2 );
// on default value has inIsRemote = false,
// so we need to assign it only if it is really remote.
if( inIsRemote )
pValue->put_IsRemote( inIsRemote );
return pValue;
}
示例3: CreateValue_Enum
I_Value* CreateValue_Enum(
I_Type_Enumerated_Ptr inpType,
vuint16 inFlags,
bool inIsRemote )
{
FBL_CHECK( inpType );
I_Value* pValue = nullptr;
switch( inpType->get_MaxIdentCount() )
{
case ENUM_8_IDENT_COUNT:
{
pValue = (bool(inFlags & fNullable)) ?
new Value_enum_null8( inpType ) : new Value_enum8( inpType );
} break;
case ENUM_16_IDENT_COUNT:
{
pValue = (bool(inFlags & fNullable)) ?
new Value_enum_null16( inpType ) : new Value_enum16( inpType );
} break;
default:
{
FBL_Throw( xFeatureError( ERR_FEATURE_NOT_SUPPORTED, "Not enum8 or enum16" ) );
}
}
if( inIsRemote )
pValue->put_IsRemote( inIsRemote );
return pValue;
}
示例4: toValue_long
I_Value* toValue_long( vint32 inValue )
{
I_Value* pValue = new FBL::Value_long();
pValue->put_Long( inValue );
return pValue;
}
示例5: toValue_umedium
I_Value* toValue_umedium( vuint32 inValue )
{
I_Value* pValue = new FBL::Value_umedium();
pValue->put_ULong( inValue );
return pValue;
}
示例6: toValue_ushort
I_Value* toValue_ushort( vuint16 inValue )
{
I_Value* pValue = new FBL::Value_ushort();
pValue->put_UShort( inValue );
return pValue;
}
示例7: toValue_byte
I_Value* toValue_byte( vuint8 inValue )
{
I_Value* pValue = new FBL::Value_byte();
pValue->put_Byte( inValue );
return pValue;
}
示例8: toValue_text
I_Value* toValue_text( const FBL::String& inStrObject )
{
I_Value* pValue = new FBL::Value_text_null();
pValue->put_String( inStrObject.begin(), inStrObject.end() );
return pValue;
}
示例9: toValue_varchar
I_Value* toValue_varchar( const FBL::String& inStrObject )
{
I_Value* pValue = new FBL::Value_varchar( inStrObject.length() + 1 );
pValue->put_String( inStrObject.begin(), inStrObject.end() ); // not nullable
return pValue;
}
示例10: toValue_double
I_Value* toValue_double( double inValue )
{
I_Value* pValue = new FBL::Value_double();
pValue->put_Double( inValue );
return pValue;
}
示例11: toValue_float
I_Value* toValue_float( float inValue )
{
I_Value* pValue = new FBL::Value_float();
pValue->put_Float( inValue );
return pValue;
}
示例12: toValue_ullong
I_Value* toValue_ullong( vuint64 inValue )
{
I_Value* pValue = new FBL::Value_ullong();
pValue->put_ULLong( inValue );
return pValue;
}
示例13: toValue_bool
FBL_Begin_Namespace
/**********************************************************************************************/
I_Value* toValue_bool( vuint32 inValue )
{
I_Value* pValue = new FBL::Value_bool();
pValue->put_Boolean( inValue );
return pValue;
}
示例14: Assign
void Value_Raw::Assign( const I_Value& inValue )
{
if( inValue.get_IsNull() )
{
put_IsNull( true );
}
else
{
if( get_Type() == inValue.get_Type() )
{
vuint32 Len = static_cast<vuint32>(inValue.end() - inValue.begin());
put_Data( (vuint8*)inValue.begin(), Len );
}
else
{
ConvertValue( &inValue, this );
}
}
}