本文整理汇总了C++中JoynrMessage::setType方法的典型用法代码示例。如果您正苦于以下问题:C++ JoynrMessage::setType方法的具体用法?C++ JoynrMessage::setType怎么用?C++ JoynrMessage::setType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JoynrMessage
的用法示例。
在下文中一共展示了JoynrMessage::setType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ccMessagingAddress
TEST_F(LibJoynrDbusCommunicationTests, transmit_message) {
QString ccMessagingAddress("local:joynr.messaging:cc.message6");
// register skeletons
MockMessaging* msgMock = new MockMessaging();
EXPECT_CALL(*msgMock, transmit(A<JoynrMessage&>())).Times(1);
auto msgSkeleton = new IDbusSkeletonWrapper<DbusMessagingSkeleton, IMessaging>(*msgMock, ccMessagingAddress);
// get stub
DbusMessagingStubAdapter* msgStub = new DbusMessagingStubAdapter(ccMessagingAddress);
ASSERT_TRUE(msgStub->isProxyAvailable());
// create message
JoynrMessage msg;
msg.setType(JoynrMessage::VALUE_MESSAGE_TYPE_ONE_WAY);
msg.setHeaderTo(QString("local"));
msg.setPayload("This is a test");
// create messaging qos
msgStub->transmit(msg);
// delete skeleton
delete msgSkeleton;
// error on transmission
msgStub->transmit(msg);
// stub not availabe
ASSERT_FALSE(msgStub->isProxyAvailable());
delete msgStub;
delete msgMock;
}
示例2: createOneWay
JoynrMessage JoynrMessageFactory::createOneWay(const std::string& senderId,
const std::string& receiverId,
const MessagingQos& qos,
const Reply& payload) const
{
JoynrMessage msg;
msg.setType(JoynrMessage::VALUE_MESSAGE_TYPE_ONE_WAY);
initMsg(msg, senderId, receiverId, qos.getTtl(), JsonSerializer::serialize<Reply>(payload));
return msg;
}
示例3: createRequest
JoynrMessage JoynrMessageFactory::createRequest(const std::string& senderId,
const std::string& receiverId,
const MessagingQos& qos,
const Request& payload) const
{
// create message and set type
JoynrMessage msg;
msg.setType(JoynrMessage::VALUE_MESSAGE_TYPE_REQUEST);
initMsg(msg, senderId, receiverId, qos.getTtl(), JsonSerializer::serialize<Request>(payload));
return msg;
}
示例4: createSubscriptionStop
JoynrMessage JoynrMessageFactory::createSubscriptionStop(const std::string& senderId,
const std::string& receiverId,
const MessagingQos& qos,
const SubscriptionStop& payload) const
{
JoynrMessage msg;
msg.setType(JoynrMessage::VALUE_MESSAGE_TYPE_SUBSCRIPTION_STOP);
initMsg(msg,
senderId,
receiverId,
qos.getTtl(),
JsonSerializer::serialize<SubscriptionStop>(payload));
return msg;
}
示例5: createSubscriptionPublication
JoynrMessage JoynrMessageFactory::createSubscriptionPublication(
const std::string& senderId,
const std::string& receiverId,
const MessagingQos& qos,
const SubscriptionPublication& payload) const
{
JoynrMessage msg;
msg.setType(JoynrMessage::VALUE_MESSAGE_TYPE_PUBLICATION);
initMsg(msg,
senderId,
receiverId,
qos.getTtl(),
JsonSerializer::serialize<SubscriptionPublication>(payload));
return msg;
}
示例6: createBroadcastSubscriptionRequest
JoynrMessage JoynrMessageFactory::createBroadcastSubscriptionRequest(
const std::string& senderId,
const std::string& receiverId,
const MessagingQos& qos,
const BroadcastSubscriptionRequest& payload) const
{
JoynrMessage msg;
msg.setType(JoynrMessage::VALUE_MESSAGE_TYPE_BROADCAST_SUBSCRIPTION_REQUEST);
initMsg(msg,
senderId,
receiverId,
qos.getTtl(),
JsonSerializer::serialize<BroadcastSubscriptionRequest>(payload));
return msg;
}