本文整理汇总了C++中defaultBlock函数的典型用法代码示例。如果您正苦于以下问题:C++ defaultBlock函数的具体用法?C++ defaultBlock怎么用?C++ defaultBlock使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了defaultBlock函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: defaultTemplate
void LLTemplateMessageBuilderTestObject::test<12>()
// Vector4
{
LLMessageTemplate messageTemplate = defaultTemplate();
messageTemplate.addBlock(defaultBlock(MVT_LLVector4, 16));
LLVector4 outValue, inValue = LLVector4(1,2,3,4);
LLTemplateMessageBuilder* builder = defaultBuilder(messageTemplate);
builder->addVector4(_PREHASH_Test0, inValue);
LLTemplateMessageReader* reader = setReader(messageTemplate, builder);
reader->getVector4(_PREHASH_Test0, _PREHASH_Test0, outValue);
ensure_equals("Ensure LLVector4", inValue, outValue);
delete reader;
}
示例2: defaultTemplate
void LLTemplateMessageBuilderTestObject::test<17>()
// IPPort
{
LLMessageTemplate messageTemplate = defaultTemplate();
messageTemplate.addBlock(defaultBlock(MVT_IP_PORT, 2));
U16 outValue, inValue = 80;
LLTemplateMessageBuilder* builder = defaultBuilder(messageTemplate);
builder->addIPPort(_PREHASH_Test0, inValue);
LLTemplateMessageReader* reader = setReader(messageTemplate, builder);
reader->getIPPort(_PREHASH_Test0, _PREHASH_Test0, outValue);
ensure_equals("Ensure IPPort", inValue, outValue);
delete reader;
}
示例3: defaultTemplate
void LLTemplateMessageBuilderTestObject::test<37>()
// non-zero offset with Vector3d
{
LLMessageTemplate messageTemplate = defaultTemplate();
messageTemplate.addBlock(defaultBlock(MVT_LLVector3d, 24));
LLVector3d outValue, inValue = LLVector3d(1,2,3);
LLTemplateMessageBuilder* builder = defaultBuilder(messageTemplate);
builder->addVector3d(_PREHASH_Test0, inValue);
LLTemplateMessageReader* reader = setReader(
messageTemplate, builder, 64);
reader->getVector3d(_PREHASH_Test0, _PREHASH_Test0, outValue);
ensure_equals("Ensure LLVector3d", inValue, outValue);
delete reader;
}