| 369 | } |
| 370 | |
| 371 | bool KernelSML::HandleGetConnections(AgentSML* /*pAgentSML*/, char const* /*pCommandName*/, Connection* /*pCallingConnection*/, AnalyzeXML* /*pIncoming*/, soarxml::ElementXML* pResponse) |
| 372 | { |
| 373 | // Create the result tag |
| 374 | TagResult* pTagResult = new TagResult() ; |
| 375 | pTagResult->AddAttribute(sml_Names::kCommandOutput, sml_Names::kStructuredOutput) ; |
| 376 | |
| 377 | // Walk the list of connections and return their info |
| 378 | int index = 0 ; |
| 379 | Connection* pConnection = m_pConnectionManager->GetConnectionByIndex(index) ; |
| 380 | |
| 381 | while (pConnection) |
| 382 | { |
| 383 | // Create the connection tag |
| 384 | soarxml::ElementXML* pTagConnection = new soarxml::ElementXML() ; |
| 385 | pTagConnection->SetTagName(sml_Names::kTagConnection) ; |
| 386 | |
| 387 | // Fill in the info |
| 388 | pTagConnection->AddAttribute(sml_Names::kConnectionId, pConnection->GetID()) ; |
| 389 | pTagConnection->AddAttribute(sml_Names::kConnectionName, pConnection->GetName()) ; |
| 390 | pTagConnection->AddAttribute(sml_Names::kConnectionStatus, pConnection->GetStatus()) ; |
| 391 | pTagConnection->AddAttribute(sml_Names::kAgentStatus, pConnection->GetAgentStatus()) ; |
| 392 | |
| 393 | // Add the connection into the result |
| 394 | pTagResult->AddChild(pTagConnection) ; |
| 395 | |
| 396 | // Get the next connection. Returns null when go beyond limit. |
| 397 | // (This provides thread safe access to the list, in case it changes during this enumeration) |
| 398 | index++ ; |
| 399 | pConnection = m_pConnectionManager->GetConnectionByIndex(index) ; |
| 400 | } |
| 401 | |
| 402 | // Add the result tag to the response |
| 403 | pResponse->AddChild(pTagResult) ; |
| 404 | |
| 405 | // Return true to indicate we've filled in all of the result tag we need |
| 406 | return true ; |
| 407 | |
| 408 | } |
| 409 | |
| 410 | bool KernelSML::HandleDestroyAgent(AgentSML* pAgentSML, char const* /*pCommandName*/, Connection* /*pConnection*/, AnalyzeXML* /*pIncoming*/, soarxml::ElementXML* /*pResponse*/) |
| 411 | { |
nothing calls this directly
no test coverage detected