本文整理汇总了C++中property::Map::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ Map::Clear方法的具体用法?C++ Map::Clear怎么用?C++ Map::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类property::Map
的用法示例。
在下文中一共展示了Map::Clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreatePropertyMap
void CreatePropertyMap( Actor actor, Property::Map& map )
{
map.Clear();
if ( actor )
{
map[ "type" ] = actor.GetTypeName();
// Default properties
Property::IndexContainer indices;
actor.GetPropertyIndices( indices );
const Property::IndexContainer::ConstIterator endIter = indices.End();
for ( Property::IndexContainer::Iterator iter = indices.Begin(); iter != endIter; ++iter )
{
map[ actor.GetPropertyName( *iter ) ] = actor.GetProperty( *iter );
}
// Children
unsigned int childCount( actor.GetChildCount() );
if ( childCount )
{
Property::Array childArray;
for ( unsigned int child = 0; child < childCount; ++child )
{
Property::Map childMap;
CreatePropertyMap( actor.GetChildAt( child ), childMap );
childArray.PushBack( childMap );
}
map[ "actors" ] = childArray;
}
}
}
示例2: UtcDaliPropertyMapPopulate
int UtcDaliPropertyMapPopulate(void)
{
Property::Map map;
DALI_TEST_CHECK( map.Empty() );
map[ "hello" ] = 1;
map[ "world" ] = "world";
map[ "world" ] = 3; // same item as line above
DALI_TEST_CHECK( !map.Empty() ); // Should no longer be empty
DALI_TEST_CHECK( map.Count() == 2 ); // Should only have two items, not three!!
DALI_TEST_CHECK( map["hello"].Get<int>() == 1 );
DALI_TEST_CHECK( map["world"].Get<int>() == 3 );
map.Clear();
DALI_TEST_CHECK( map.Empty() );
END_TEST;
}