Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. void RPCServer::GetPortCoreCountInfo( IxServerType::PortAddressList const & ports, IxServerType::PortCoreCountInfoVector & count )
  2. {
  3. MILESTONE_RPF_METHOD
  4.  
  5. CBackplane* theBackplane = CDoc::GetDocument()->GetBackplane();
  6. CHECK (theBackplane);
  7.  
  8. std::string& serverIp = m_connectedServerIP;
  9. std::for_each(ports.begin(), ports.end(),
  10. [&theBackplane, &serverIp, &count](const boost::shared_ptr<IxServerType::PortAddress>& port)
  11. {
  12. IxConcurrencyUtils::IxStLocker<CBackplane> lk(*theBackplane);
  13. CPort* pPort = CDoc::GetDocument()->Chassis().GetPort(port->cardId, port->portId);
  14.  
  15. if (pPort && pPort->IsValidFeature(CPort::kFeatureCpuCoreCount))
  16. {
  17. ICpuCoreCount* cpuCoreCount = dynamic_cast<ICpuCoreCount*>(pPort);
  18. if(cpuCoreCount)
  19. {
  20. boost::shared_ptr<IxServerType::PortCoreCountInfo> portCoreCountInfo(new IxServerType::PortCoreCountInfo());
  21. portCoreCountInfo->portId.chassisIP = serverIp;
  22. portCoreCountInfo->portId.cardId = pPort->Id().wCard;
  23. portCoreCountInfo->portId.portId = pPort->Id().wPort;
  24. portCoreCountInfo->coreCount = cpuCoreCount->GetCoreCount();
  25. portCoreCountInfo->reservedCoreCount = cpuCoreCount->GetReservedCoreCount();
  26. count.push_back(portCoreCountInfo);
  27. }
  28. }
  29. });
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement