9 #ifndef RAD_TOPIC_HANDLER_HPP
10 #define RAD_TOPIC_HANDLER_HPP
12 #include <rad/Logger.hpp>
13 #include <rad/Exceptions.hpp>
17 #include <unordered_map>
34 virtual void handle(
const std::string& topicTypeId,
47 template<
typename EventType>
55 std::string errMsg(
"Error topicName <" + topicName +
62 typename EventType::payload_t topicPayload;
64 if (topicPayload.ParseFromArray(pMsg, msgSize) ==
false) {
65 std::string errMsg(
"Error parsing <" + topicName +
"> payload.");
70 return EventType(topicPayload);
#define RAD_LOG_ERROR()
Definition: Logger.hpp:266
virtual void handle(const std::string &topicTypeId, const void *pData, size_t dataSize)=0
string id
Definition: requests.proto:15
Definition: Exceptions.hpp:44
virtual ~TopicHandler()
Definition: TopicHandler.hpp:26
#define RAD_LOG_TRACE()
Definition: Logger.hpp:319
EventType ParseTopicAndCreateEvent(const std::string &topicName, const void *pMsg, size_t msgSize)
Definition: TopicHandler.hpp:48
Definition: TopicHandler.hpp:24