本文整理汇总了C++中JoynrMessage::getHeaderMessageId方法的典型用法代码示例。如果您正苦于以下问题:C++ JoynrMessage::getHeaderMessageId方法的具体用法?C++ JoynrMessage::getHeaderMessageId怎么用?C++ JoynrMessage::getHeaderMessageId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JoynrMessage
的用法示例。
在下文中一共展示了JoynrMessage::getHeaderMessageId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processReceivedJsonObjects
void LongPollingMessageReceiver::processReceivedJsonObjects(const std::string& jsonObject)
{
JoynrMessage* msg = JsonSerializer::deserialize<JoynrMessage>(jsonObject);
if (msg == nullptr) {
JOYNR_LOG_ERROR(logger, "Unable to deserialize message. Raw message: {}", jsonObject);
return;
}
if (msg->getType().empty()) {
JOYNR_LOG_ERROR(logger, "received empty message - dropping Messages");
return;
}
if (!msg->containsHeaderExpiryDate()) {
JOYNR_LOG_ERROR(logger,
"received message [msgId=[{}] without decay time - dropping message",
msg->getHeaderMessageId());
}
if (msg->getType() == JoynrMessage::VALUE_MESSAGE_TYPE_REQUEST ||
msg->getType() == JoynrMessage::VALUE_MESSAGE_TYPE_SUBSCRIPTION_REQUEST ||
msg->getType() == JoynrMessage::VALUE_MESSAGE_TYPE_BROADCAST_SUBSCRIPTION_REQUEST) {
// TODO ca: check if replyTo header info is available?
std::string replyChannelId = msg->getHeaderReplyChannelId();
std::shared_ptr<system::RoutingTypes::ChannelAddress> address(
new system::RoutingTypes::ChannelAddress(replyChannelId));
messageRouter->addNextHop(msg->getHeaderFrom(), address);
}
// messageRouter.route passes the message reference to the MessageRunnable, which copies it.
// TODO would be nicer if the pointer would be passed to messageRouter, on to MessageRunnable,
// and runnable should delete it.
messageRouter->route(*msg);
delete msg;
}
示例2: transmit
void DbusMessagingStubAdapter::transmit(JoynrMessage& message)
{
logMethodCall(QString("transmit message with ID: %1 and payload: %2")
.arg(message.getHeaderMessageId())
.arg(QString(message.getPayload())));
// copy joynr message
joynr::messaging::IMessaging::JoynrMessage dbusMsg;
DbusMessagingUtil::copyJoynrMsgToDbusMsg(message, dbusMsg);
// call
CommonAPI::CallStatus status;
proxy->transmit(dbusMsg, status);
// print the status
printCallStatus(status, "transmit");
}