本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}