| 305 | } |
| 306 | |
| 307 | OutputNameStruct *EntityOutputManager::FindOutputPointer(const char *classname, const char *outputname, bool create) |
| 308 | { |
| 309 | ClassNameStruct *pClassname; |
| 310 | |
| 311 | if (!ClassNames->Retrieve(classname, (void **)&pClassname)) |
| 312 | { |
| 313 | if (create) |
| 314 | { |
| 315 | pClassname = new ClassNameStruct; |
| 316 | ClassNames->Insert(classname, pClassname); |
| 317 | } |
| 318 | else |
| 319 | { |
| 320 | return NULL; |
| 321 | } |
| 322 | } |
| 323 | |
| 324 | OutputNameStruct *pOutputName; |
| 325 | |
| 326 | if (!pClassname->OutputList->Retrieve(outputname, (void **)&pOutputName)) |
| 327 | { |
| 328 | if (create) |
| 329 | { |
| 330 | pOutputName = new OutputNameStruct; |
| 331 | pClassname->OutputList->Insert(outputname, pOutputName); |
| 332 | strncpy(pOutputName->Name, outputname, sizeof(pOutputName->Name)); |
| 333 | pOutputName->Name[49] = 0; |
| 334 | } |
| 335 | else |
| 336 | { |
| 337 | return NULL; |
| 338 | } |
| 339 | } |
| 340 | |
| 341 | return pOutputName; |
| 342 | } |
| 343 | |
| 344 | // Iterate the datamap of pCaller/pActivator and look for output pointers with the same address as pOutput. |
| 345 | // Store the classname of the entity we found the output on in |entity_classname| if provided. |
no test coverage detected