WebCFace 2.5.2
Web-based Communication Framework & Dashboard-like UI
Loading...
Searching...
No Matches
message.cc File Reference
Include dependency graph for message.cc:

Namespaces

namespace  webcface
 
namespace  webcface::message
 

Macros

#define MSG_PARSE(type)
 
#define MSG_PARSE_DATA(type)
 

Functions

static void printMsg (const std::shared_ptr< spdlog::logger > &logger, const std::string &message)
 
std::vector< std::pair< int, std::shared_ptr< void > > > unpack (const std::string &message, const std::shared_ptr< spdlog::logger > &logger)
 msgpackのメッセージをパースし返す
 

Macro Definition Documentation

◆ MSG_PARSE

#define MSG_PARSE (   type)
Value:
case type::kind: \
try { \
obj_u = \
std::make_shared<type>(obj.via.array.ptr[i + 1].as<type>()); \
} catch (const std::exception &e) { \
logger->error("unpack error: {} at index={}, kind={}", e.what(), \
i + 1, static_cast<int>(type::kind)); \
printMsg(logger, message); \
continue; \
} \
break;

◆ MSG_PARSE_DATA

#define MSG_PARSE_DATA (   type)
Value:
static_assert(type::kind < MessageKind::entry && \
type::kind < MessageKind::req && \
type::kind < MessageKind::res); \
MSG_PARSE(type) \
MSG_PARSE(Entry<type>) \
MSG_PARSE(Req<type>) \
MSG_PARSE(Res<type>)