lichao
2021-04-20 ca319178f45ce6256aed7913565d445571f6db22
src/proto.h
@@ -22,16 +22,16 @@
#include "bhome_msg_api.pb.h"
#include <chrono>
using namespace bhome::msg;
using namespace bhome_msg;
template <class Msg>
struct MsgToType {
};
#define BHOME_MAP_MSG_AND_TYPE(mSG, tYPE)              \
   template <>                                        \
   struct MsgToType<mSG> {                            \
      static const bhome::msg::MsgType value = tYPE; \
#define BHOME_MAP_MSG_AND_TYPE(mSG, tYPE)  \
   template <>                            \
   struct MsgToType<mSG> {                \
      static const MsgType value = tYPE; \
   };
#define BHOME_SIMPLE_MAP_MSG(name) BHOME_MAP_MSG_AND_TYPE(Msg##name, kMsgType##name)
@@ -52,7 +52,7 @@
#undef BHOME_MAP_MSG_AND_TYPE
template <class Msg>
constexpr inline bhome::msg::MsgType GetType(const Msg &)
constexpr inline MsgType GetType(const Msg &)
{
   return MsgToType<Msg>::value;
}