本文整理汇总了C++中property::Array::Size方法的典型用法代码示例。如果您正苦于以下问题:C++ Array::Size方法的具体用法?C++ Array::Size怎么用?C++ Array::Size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类property::Array
的用法示例。
在下文中一共展示了Array::Size方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UtcDaliPropertyArrayPushBackP
int UtcDaliPropertyArrayPushBackP(void)
{
Property::Array array;
DALI_TEST_CHECK( 0 == array.Size() );
array.PushBack( 1 );
DALI_TEST_CHECK( 1 == array.Size() );
DALI_TEST_CHECK( array[0].Get<int>() == 1 );
END_TEST;
}
示例2: NewActor
Actor NewActor( const Property::Map& map )
{
BaseHandle handle;
// First find type and create Actor
Property::Value* typeValue = map.Find( "type" );
if ( typeValue )
{
TypeInfo type = TypeRegistry::Get().GetTypeInfo( typeValue->Get< std::string >() );
if ( type )
{
handle = type.CreateInstance();
}
}
if ( !handle )
{
DALI_LOG_ERROR( "Actor type not provided\n" );
return Actor();
}
Actor actor( Actor::DownCast( handle ) );
if ( actor )
{
// Now set the properties, or create children
for ( unsigned int i = 0, mapCount = map.Count(); i < mapCount; ++i )
{
const StringValuePair& pair( map.GetPair( i ) );
const std::string& key( pair.first );
if ( key == "type" )
{
continue;
}
const Property::Value& value( pair.second );
if ( key == "actors" )
{
// Create children
Property::Array actorArray = value.Get< Property::Array >();
for ( Property::Array::SizeType i = 0; i < actorArray.Size(); ++i)
{
actor.Add( NewActor( actorArray[i].Get< Property::Map >() ) );
}
}
else
{
Property::Index index( actor.GetPropertyIndex( key ) );
if ( index != Property::INVALID_INDEX )
{
actor.SetProperty( index, value );
}
}
}
}
return actor;
}
示例3: UtcDaliPropertyArraySizeP
int UtcDaliPropertyArraySizeP(void)
{
Property::Array array;
DALI_TEST_CHECK( 0 == array.Capacity() );
DALI_TEST_CHECK( 0 == array.Size() );
array.Reserve(3);
DALI_TEST_CHECK( 3 == array.Capacity() );
DALI_TEST_CHECK( 0 == array.Size() );
array.PushBack( 1 );
array.PushBack( "world" );
array.PushBack( 3 );
DALI_TEST_CHECK( 3 == array.Size() );
END_TEST;
}