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


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

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


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

示例1: LOGD

/*
* Class:     org_iotivity_base_OcRepresentation
* Method:    size
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_org_iotivity_base_OcRepresentation_size
(JNIEnv *env, jobject thiz)
{
    LOGD("OcRepresentation_size");
    OCRepresentation *rep = JniOcRepresentation::getOCRepresentationPtr(env, thiz);
    if (!rep) return -1;

    return static_cast<jint>(rep->numberOfAttributes());
}
开发者ID:TianyouLi,项目名称:iotivity,代码行数:14,代码来源:JniOcRepresentation.cpp

示例2: onGet

void onGet(const HeaderOptions& /*headerOptions*/, const OCRepresentation& rep, const int eCode)
{
	try
	{
		if(eCode == OC_STACK_OK)
		{
			dlog_print(DLOG_INFO, LOG_TAG,  "GET request was successful %s", rep.getUri().c_str());
			std::cout << "Attributes : " << rep.numberOfAttributes() << std::endl;
			typedef std::map<std::string, int>::iterator it_type;
			for(it_type iterator = intprops.begin(); iterator != intprops.end(); iterator++) {
				std::cout << "Key  : " << iterator->first << " Value = "<<rep[iterator->first]<<std::endl;
				iterator->second = rep[iterator->first];
			}
			typedef std::map<std::string, double>::iterator itd_type;
			for(itd_type iterator = doubleprops.begin(); iterator != doubleprops.end(); iterator++) {
				std::cout << "Key  : " << iterator->first << " Value = "<<rep[iterator->first]<<std::endl;
				iterator->second = rep[iterator->first];
			}

			rvidata r;
			r.lt = rep["leftTemperature"];
			r.rt = rep["rightTemperature"];
			r.lhs = rep["leftSeatHeat"];
			r.rhs = rep["rightSeatHeat"];
			r.fs = rep["fanSpeed"];
			r.fd = rep["fanDown"];
			r.fr = rep["fanRight"];
			r.fu = rep["fanUp"];
			r.fac = rep["fanAC"];
			r.fa = rep["fanAuto"];
			r.fr = rep["fanRecirc"];
			r.dm = rep["defrostMax"];
			r.df = rep["defrostFront"];
			r.dr = rep["defrostRear"];

			send_message(&r);



		}
		else
		{
			dlog_print(DLOG_INFO, LOG_TAG,  "GET request was UNsuccessful");
		}
	}
	catch(std::exception& e)
	{
		std::cout << "Exception: " << e.what() << " in onPut" << std::endl;
	}
}
开发者ID:iamsanjeev,项目名称:practice,代码行数:50,代码来源:geniviocfs2.cpp


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