本文整理汇总了C++中property::Array::Reserve方法的典型用法代码示例。如果您正苦于以下问题:C++ Array::Reserve方法的具体用法?C++ Array::Reserve怎么用?C++ Array::Reserve使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类property::Array
的用法示例。
在下文中一共展示了Array::Reserve方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDefaultProperty
Property::Value PathConstrainer::GetDefaultProperty( Property::Index index ) const
{
if( index == Dali::PathConstrainer::Property::FORWARD )
{
return Property::Value( mForward );
}
else
{
if( index == Dali::PathConstrainer::Property::POINTS )
{
Property::Value value( Property::ARRAY );
Property::Array* array = value.GetArray();
const Dali::Vector<Vector3>& point = mPath->GetPoints();
Property::Array::SizeType pointCount = point.Size();
if( array )
{
array->Reserve( pointCount );
for( Property::Array::SizeType i = 0; i < pointCount; ++i )
{
array->PushBack( point[i] );
}
}
return value;
}
else if( index == Dali::PathConstrainer::Property::CONTROL_POINTS )
{
Property::Value value( Property::ARRAY );
Property::Array* array = value.GetArray();
const Dali::Vector<Vector3>& point = mPath->GetControlPoints();
Property::Array::SizeType pointCount = point.Size();
if( array )
{
array->Reserve( pointCount );
for( Property::Array::SizeType i = 0; i < pointCount; ++i )
{
array->PushBack( point[i] );
}
}
return value;
}
}
return Property::Value();
}
示例2: UtcDaliPropertyArrayCapacityP
int UtcDaliPropertyArrayCapacityP(void)
{
Property::Array array;
DALI_TEST_CHECK( array.Empty() );
array.Reserve(3);
DALI_TEST_CHECK( 3 == array.Capacity() );
END_TEST;
}
示例3: GetDefaultProperty
Property::Value LinearConstrainer::GetDefaultProperty( Property::Index index ) const
{
if( index == Dali::LinearConstrainer::Property::VALUE )
{
Property::Value value( Property::ARRAY );
Property::Array* array = value.GetArray();
size_t count( mValue.Size() );
if( array )
{
array->Reserve( count );
for( size_t i( 0 ); i != count; ++i )
{
array->PushBack( mValue[i] );
}
}
return value;
}
else if( index == Dali::LinearConstrainer::Property::PROGRESS )
{
Property::Value value( Property::ARRAY );
Property::Array* array = value.GetArray();
size_t count( mValue.Size() );
if( array )
{
array->Reserve( count );
for( size_t i( 0 ); i != count; ++i )
{
array->PushBack( mProgress[i] );
}
}
return value;
}
return Property::Value();
}
示例4: UtcDaliPropertyArrayReserveP
int UtcDaliPropertyArrayReserveP(void)
{
Property::Array array;
DALI_TEST_CHECK( array.Empty() );
array.Reserve(3);
DALI_TEST_CHECK( 3 == array.Capacity() );
DALI_TEST_CHECK( 0 == array.Size() );
array.PushBack( 1 );
array.PushBack( "world" );
array.PushBack( 3 );
END_TEST;
}
示例5: UtcDaliPropertyArrayIndexOperatorP
int UtcDaliPropertyArrayIndexOperatorP(void)
{
Property::Array array;
array.Reserve(3);
array.PushBack( 1 );
array.PushBack( "world" );
array.PushBack( 3 );
DALI_TEST_CHECK( array[0].Get<int>() == 1 );
DALI_TEST_CHECK( array[1].Get<std::string>() == "world" );
DALI_TEST_CHECK( array[2].Get<int>() == 3 );
END_TEST;
}
示例6: UtcDaliPropertyArrayEmptyP
int UtcDaliPropertyArrayEmptyP(void)
{
Property::Array array;
DALI_TEST_CHECK( array.Empty() );
array.Reserve(3);
DALI_TEST_CHECK( array.Empty() );
array.PushBack( 1 );
array.PushBack( "world" );
array.PushBack( 3 );
DALI_TEST_CHECK( !array.Empty() );
END_TEST;
}