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


C++ LLTemplateMessageReader类代码示例

本文整理汇总了C++中LLTemplateMessageReader的典型用法代码示例。如果您正苦于以下问题:C++ LLTemplateMessageReader类的具体用法?C++ LLTemplateMessageReader怎么用?C++ LLTemplateMessageReader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: defaultTemplate

	void LLTemplateMessageBuilderTestObject::test<5>()
		 // U16
	{
		LLMessageTemplate messageTemplate = defaultTemplate();
		messageTemplate.addBlock(defaultBlock(MVT_U16, 2));
		U16 outValue, inValue = 3;
		LLTemplateMessageBuilder* builder = defaultBuilder(messageTemplate);
		builder->addU16(_PREHASH_Test0, inValue);
		LLTemplateMessageReader* reader = setReader(messageTemplate, builder);
		reader->getU16(_PREHASH_Test0, _PREHASH_Test0, outValue);
		ensure_equals("Ensure U16", inValue, outValue);
		delete reader;
	}
开发者ID:Boy,项目名称:rainbow,代码行数:13,代码来源:lltemplatemessagebuilder_tut.cpp

示例2: defaultTemplate

	void LLTemplateMessageBuilderTestObject::test<10>()
		 // F64
	{
		LLMessageTemplate messageTemplate = defaultTemplate();
		messageTemplate.addBlock(defaultBlock(MVT_F64, 8));
		F64 outValue, inValue = 3232143.33;
		LLTemplateMessageBuilder* builder = defaultBuilder(messageTemplate);
		builder->addF64(_PREHASH_Test0, inValue);
		LLTemplateMessageReader* reader = setReader(messageTemplate, builder);
		reader->getF64(_PREHASH_Test0, _PREHASH_Test0, outValue);
		ensure_equals("Ensure F64", inValue, outValue);
		delete reader;
	}
开发者ID:Krazy-Bish-Margie,项目名称:Thunderstorm,代码行数:13,代码来源:lltemplatemessagebuilder_tut.cpp

示例3: defaultTemplate

	void LLTemplateMessageBuilderTestObject::test<28>()
		 // non-zero offset with S16
	{
		LLMessageTemplate messageTemplate = defaultTemplate();
		messageTemplate.addBlock(defaultBlock(MVT_S16, 2));
		S16 outValue, inValue = 90;
		LLTemplateMessageBuilder* builder = defaultBuilder(messageTemplate);
		builder->addS16(_PREHASH_Test0, inValue);
		LLTemplateMessageReader* reader = setReader(
			messageTemplate, builder, 2);
		reader->getS16(_PREHASH_Test0, _PREHASH_Test0, outValue);
		ensure_equals("Ensure S16", inValue, outValue);
		delete reader;
	}
开发者ID:AlericInglewood,项目名称:SingularityViewer,代码行数:14,代码来源:lltemplatemessagebuilder_tut.cpp

示例4: setReader

		/** Takes ownership of builder */
		static LLTemplateMessageReader* setReader(
			LLMessageTemplate& messageTemplate,
			LLTemplateMessageBuilder* builder,
			U8 offset = 0)
		{
			numberMap[1] = &messageTemplate;
			const U32 bufferSize = 1024;
			U8 buffer[bufferSize];
			// zero out the packet ID field
			memset(buffer, 0, LL_PACKET_ID_SIZE);
			U32 builtSize = builder->buildMessage(buffer, bufferSize, offset);
			delete builder;
			LLTemplateMessageReader* reader = new LLTemplateMessageReader(numberMap);
			reader->validateMessage(buffer, builtSize, LLHost());
			reader->readMessage(buffer, LLHost());
			return reader;
		}
开发者ID:AlericInglewood,项目名称:SingularityViewer,代码行数:18,代码来源:lltemplatemessagebuilder_tut.cpp


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