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


C++ OCRepresentation::addChild方法代码示例

本文整理汇总了C++中OCRepresentation::addChild方法的典型用法代码示例。如果您正苦于以下问题:C++ OCRepresentation::addChild方法的具体用法?C++ OCRepresentation::addChild怎么用?C++ OCRepresentation::addChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OCRepresentation的用法示例。


在下文中一共展示了OCRepresentation::addChild方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getRoomRepresentation

    OCRepresentation getRoomRepresentation(void)
    {
        m_roomRep.clearChildren();

        m_roomRep.addChild(getLightRepresentation());
        m_roomRep.addChild(getFanRepresentation());
        return m_roomRep;
    }
开发者ID:iotk,项目名称:iochibity-cxx,代码行数:8,代码来源:roomserver.cpp

示例2: parseGetSetCallback

    OCRepresentation parseGetSetCallback(OCClientResponse* clientResponse)
    {
        if(clientResponse->payload == nullptr ||
                (
                    clientResponse->payload->type != PAYLOAD_TYPE_DEVICE &&
                    clientResponse->payload->type != PAYLOAD_TYPE_PLATFORM &&
                    clientResponse->payload->type != PAYLOAD_TYPE_REPRESENTATION
                )
          )
        {
            //OCPayloadDestroy(clientResponse->payload);
            return OCRepresentation();
        }

        MessageContainer oc;
        oc.setPayload(clientResponse->payload);
        //OCPayloadDestroy(clientResponse->payload);

        std::vector<OCRepresentation>::const_iterator it = oc.representations().begin();
        if(it == oc.representations().end())
        {
            return OCRepresentation();
        }

        // first one is considered the root, everything else is considered a child of this one.
        OCRepresentation root = *it;
        ++it;

        std::for_each(it, oc.representations().end(),
                [&root](const OCRepresentation& repItr)
                {root.addChild(repItr);});
        return root;

    }
开发者ID:yanghyunjin,项目名称:IoTAR,代码行数:34,代码来源:InProcClientWrapper.cpp

示例3: parseRDResponseCallback

    OCRepresentation parseRDResponseCallback(OCClientResponse* clientResponse)
    {
        if (nullptr == clientResponse || nullptr == clientResponse->payload ||
                    PAYLOAD_TYPE_RD != clientResponse->payload->type)
        {
            return OCRepresentation();
        }

        MessageContainer oc;
        oc.setPayload(clientResponse->payload);

        std::vector<OCRepresentation>::const_iterator it = oc.representations().begin();
        if (it == oc.representations().end())
        {
            return OCRepresentation();
        }

        // first one is considered the root, everything else is considered a child of this one.
        OCRepresentation root = *it;
        root.setDevAddr(clientResponse->devAddr);
        root.setUri(clientResponse->resourceUri);
        ++it;

        std::for_each(it, oc.representations().end(),
                [&root](const OCRepresentation& repItr)
                {root.addChild(repItr);});
        return root;

    }
开发者ID:stjong,项目名称:iotivity,代码行数:29,代码来源:InProcServerWrapper.cpp

示例4: parseGetSetCallback

OCRepresentation parseGetSetCallback(OCClientResponse* clientResponse)
{
    if(clientResponse->resJSONPayload == nullptr || clientResponse->resJSONPayload[0] == '\0')
    {
        return OCRepresentation();
    }

    MessageContainer oc;
    oc.setJSONRepresentation(clientResponse->resJSONPayload);

    std::vector<OCRepresentation>::const_iterator it = oc.representations().begin();
    if(it == oc.representations().end())
    {
        return OCRepresentation();
    }

    // first one is considered the root, everything else is considered a child of this one.
    OCRepresentation root = *it;
    ++it;

    std::for_each(it, oc.representations().end(),
                  [&root](const OCRepresentation& repItr)
    {
        root.addChild(repItr);
    });
    return root;

}
开发者ID:TizenTeam,项目名称:iotivity,代码行数:28,代码来源:InProcClientWrapper.cpp

示例5: LOGD

/*
* Class:     org_iotivity_base_OcRepresentation
* Method:    addChild
* Signature: (Lorg/iotivity/base/OcRepresentation;)V
*/
JNIEXPORT void JNICALL Java_org_iotivity_base_OcRepresentation_addChild
(JNIEnv *env, jobject thiz, jobject jOcRepresentation)
{
    LOGD("OcRepresentation_addChild");
    OCRepresentation *rep = JniOcRepresentation::getOCRepresentationPtr(env, thiz);
    if (!rep) return;

    OCRepresentation *child = JniOcRepresentation::getOCRepresentationPtr(env, jOcRepresentation);
    if (!child) return;

    rep->addChild(*child);
}
开发者ID:TianyouLi,项目名称:iotivity,代码行数:17,代码来源:JniOcRepresentation.cpp


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