| 34 | } |
| 35 | |
| 36 | CommandHandlerFunctor* CommandHandlerRegistry::GetFunctor(uint32_t familyId,uint32_t packetId, uint32_t version) const |
| 37 | { |
| 38 | CommandHandlerKey key(familyId, packetId, version); |
| 39 | |
| 40 | // Check that the requested key exists |
| 41 | if (registry.find(key) == registry.end()) |
| 42 | { |
| 43 | std::stringstream ss; |
| 44 | ss << "Functor with requested PacketId=" << packetId << " and Version=" << version << " does not exist"; |
| 45 | throw ProfilingException(ss.str()); |
| 46 | } |
| 47 | |
| 48 | CommandHandlerFunctor* commandHandlerFunctor = registry.at(key); |
| 49 | if (commandHandlerFunctor == nullptr) |
| 50 | { |
| 51 | std::stringstream ss; |
| 52 | ss << "Invalid functor registered for PacketId=" << packetId << " and Version=" << version; |
| 53 | throw ProfilingException(ss.str()); |
| 54 | } |
| 55 | |
| 56 | return commandHandlerFunctor; |
| 57 | } |
| 58 | |
| 59 | } // namespace pipe |
| 60 |
no test coverage detected