当前位置: 首页>>代码示例>>C++>>正文


C++ JoynrMessage::setType方法代码示例

本文整理汇总了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;
}
开发者ID:HSchroeder,项目名称:joynr,代码行数:33,代码来源:LibJoynrDbusCommunicationTests.cpp

示例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;
}
开发者ID:zabela,项目名称:joynr,代码行数:10,代码来源:JoynrMessageFactory.cpp

示例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;
}
开发者ID:zabela,项目名称:joynr,代码行数:11,代码来源:JoynrMessageFactory.cpp

示例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;
}
开发者ID:zabela,项目名称:joynr,代码行数:14,代码来源:JoynrMessageFactory.cpp

示例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;
}
开发者ID:zabela,项目名称:joynr,代码行数:15,代码来源:JoynrMessageFactory.cpp

示例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;
}
开发者ID:zabela,项目名称:joynr,代码行数:15,代码来源:JoynrMessageFactory.cpp


注:本文中的JoynrMessage::setType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。