Adding a struct iterator example in test

parent 445edd4d
......@@ -27,13 +27,6 @@ int main()
s[ "ch1" ] = v;
}
for( size_t i = 0; i < 10e6; i++ )
{
CVAStruct s;
CVAStructValue v = CVAStructValue( &vcSomeData[ 0 ], sizeof( char ) * vcSomeData.size() );
s[ "ch1" ] = v;
}
CVAStruct s;
s[ "a" ] = CVAStruct();
s[ string( "a" ) ][ string( "b" ) ] = 24;
......@@ -43,6 +36,24 @@ int main()
s.GetValue( "a/c/d", '/' );
cout << s << endl;
// Iteration example
const CVAStruct& t = s[ "a" ];
auto cit = t.Begin();
while( cit != t.End() )
{
std::string sKey = cit->first;
const CVAStructValue& oValue = cit->second;
cout << sKey << ": " << oValue << std::endl;
++cit;
}
for( size_t i = 0; i < 10e2; i++ )
{
CVAStruct s;
CVAStructValue v = CVAStructValue( &vcSomeData[ 0 ], sizeof( char ) * vcSomeData.size() );
s[ "ch1" ] = v;
}
CVASampleBuffer oBuf( 1024 );
oBuf.GetData()[ 0 ] = -1.0f;
oBuf.GetData()[ 1023 ] = 1023.0f;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment