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

Method GetLocalVariable

trinity/Tr2VariableStore.cpp:368–386  ·  view source on GitHub ↗

------------------------------------------------------------- Description: Searches for a variable the given name in this store. If the variable is not found the function registers it in this store (with type TRIVARIABLE_INVALID). Arguments: name - Name of the variable to unregister. Return Value: Variable with the given name. -------------------------------------------------------------

Source from the content-addressed store, hash-verified

366// Variable with the given name.
367// -------------------------------------------------------------
368TriVariable* Tr2VariableStore::GetLocalVariable( const char* name )
369{
370 if( !name )
371 {
372 return nullptr;
373 }
374 auto it = m_variableMap.find( name );
375 if( it != m_variableMap.end() )
376 {
377 return it->second;
378 }
379
380 TriVariablePtr var;
381 var.CreateInstance();
382 var->m_type = TRIVARIABLE_INVALID;
383 var->m_name = name;
384 m_variableMap[name] = var;
385 return var;
386}
387
388// -------------------------------------------------------------
389// Description:

Callers 1

PyGetLocalVariableFunction · 0.80

Calls 2

CreateInstanceMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected