MCPcopy Create free account
hub / github.com/carbonengine/trinity / GetDesc

Function GetDesc

trinity/Tr2RenderContext_Blue.cpp:350–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348PyObject* result;
349
350void GetDesc( Tr2ALMemoryType, const Tr2DeviceResourceDescriptionAL& description )
351{
352 std::string key = "";
353 auto found = description.find( "type" );
354 if( found != end( description ) )
355 {
356 key = found->second;
357 }
358 PyObject* list = PyDict_GetItemString( result, key.c_str() );
359 if( !list )
360 {
361 list = PyList_New( 0 );
362 PyDict_SetItemString( result, key.c_str(), list );
363 Py_DECREF( list );
364 }
365
366 PyObject* item = PyDict_New();
367 if( item )
368 {
369 for( auto it = description.begin(); it != description.end(); ++it )
370 {
371 PyObject* value = ToPython( it->second.c_str() );
372 PyDict_SetItemString( item, it->first.c_str(), value );
373 Py_DECREF( value );
374 }
375 PyList_Append( list, item );
376 Py_DECREF( item );
377 }
378};
379
380// --------------------------------------------------------------------------------------
381// Description:

Callers 3

DescribeMethod · 0.85
DescribeMethod · 0.85
GetSizeMethod · 0.85

Calls 4

ToPythonFunction · 0.85
endFunction · 0.70
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected