------------------------------------------------------------- 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. -------------------------------------------------------------
| 366 | // Variable with the given name. |
| 367 | // ------------------------------------------------------------- |
| 368 | TriVariable* 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: |
no test coverage detected