8 #include <boost/assert.hpp> 9 #include <boost/format.hpp> 22 BOOST_ASSERT_MSG(functor,
"Provided functor should not be a nullptr");
25 registry[key] = functor;
30 BOOST_ASSERT_MSG(functor,
"Provided functor should not be a nullptr");
40 if (registry.find(key) == registry.end())
43 boost::str(boost::format(
"Functor with requested PacketId=%1% and Version=%2% does not exist")
49 if (commandHandlerFunctor ==
nullptr)
52 boost::str(boost::format(
"Invalid functor registered for PacketId=%1% and Version=%2%")
57 return commandHandlerFunctor;
CommandHandlerFunctor * GetFunctor(uint32_t familyId, uint32_t packetId, uint32_t version) const
void RegisterFunctor(CommandHandlerFunctor *functor, uint32_t familyId, uint32_t packetId, uint32_t version)
uint32_t GetVersion() const
uint32_t GetFamilyId() const
uint32_t GetPacketId() const