本文整理汇总了C++中MamaMsgField::getType方法的典型用法代码示例。如果您正苦于以下问题:C++ MamaMsgField::getType方法的具体用法?C++ MamaMsgField::getType怎么用?C++ MamaMsgField::getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MamaMsgField
的用法示例。
在下文中一共展示了MamaMsgField::getType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onUpdate
void onUpdate (MamdaFundamentalListener::MamdaFundamentalListenerImpl& impl,
const MamaMsgField& field)
{
switch (field.getType())
{
case MAMA_FIELD_TYPE_I8:
case MAMA_FIELD_TYPE_U8:
case MAMA_FIELD_TYPE_I16:
case MAMA_FIELD_TYPE_U16:
case MAMA_FIELD_TYPE_I32:
case MAMA_FIELD_TYPE_U32:
impl.mDivFreq = impl.getDividendFrequency (field.getU32());
impl.mDivFreqFieldState = MODIFIED;
break;
case MAMA_FIELD_TYPE_STRING:
impl.mDivFreq = impl.getDividendFrequency (field.getString());
impl.mDivFreqFieldState = MODIFIED;
break;
default:
mama_log (MAMA_LOG_LEVEL_FINE,
"Unhandled type %d for wDivFreq. "
"Expected string or integer.",
field.getType());
break;
}
}
示例2: onUpdate
void onUpdate (MamdaQuoteToBookListenerImpl& impl,
const MamaMsgField& field)
{
if (field.getType () == MAMA_FIELD_TYPE_STRING)
{
impl.mQuoteCache.mQuoteQualNative = field.getString();
}
else if (field.getType () == MAMA_FIELD_TYPE_CHAR)
{
impl.mQuoteCache.mQuoteQualNative = field.getChar();
}
}
示例3: encodeField
uint32_t MamaRecordedMessageCodec::encodeField(char*& buffer, MamaMsgField& mmf)
{
uint32_t r = 0;
mamaFieldType mft = mmf.getType();
// These modifications will be applied regardless of data type
mama_fid_t mff = mmf.getFid();
memcpy(buffer, &mff, 2);
buffer += 2;
memcpy(buffer, &mft, 4);
buffer += 4;
r += 6;
switch(mft)
{
case MAMA_FIELD_TYPE_BOOL:
r += encodeBool(buffer, mmf);
break;
case MAMA_FIELD_TYPE_CHAR:
r += encodeChar(buffer, mmf);
break;
case MAMA_FIELD_TYPE_I8:
r += encodeI8(buffer, mmf);
break;
case MAMA_FIELD_TYPE_U8:
r += encodeU8(buffer, mmf);
break;
case MAMA_FIELD_TYPE_I16:
r += encodeI16(buffer, mmf);
break;
case MAMA_FIELD_TYPE_U16:
r += encodeU16(buffer, mmf);
break;
case MAMA_FIELD_TYPE_I32:
r += encodeI32(buffer, mmf);
break;
case MAMA_FIELD_TYPE_U32:
r += encodeU32(buffer, mmf);
break;
case MAMA_FIELD_TYPE_I64:
r += encodeI64(buffer, mmf);
break;
case MAMA_FIELD_TYPE_U64:
r += encodeU64(buffer, mmf);
break;
case MAMA_FIELD_TYPE_F32:
r += encodeF32(buffer, mmf);
break;
case MAMA_FIELD_TYPE_F64:
r += encodeF64(buffer, mmf);
break;
case MAMA_FIELD_TYPE_TIME:
r += encodeTime(buffer, mmf);
break;
case MAMA_FIELD_TYPE_PRICE:
r += encodePrice(buffer, mmf);
break;
case MAMA_FIELD_TYPE_STRING:
r += encodeString(buffer, mmf);
break;
case MAMA_FIELD_TYPE_VECTOR_STRING:
r += encodeVectorString(buffer, mmf);
break;
case MAMA_FIELD_TYPE_VECTOR_I32:
r += encodeVectorI32(buffer, mmf);
break;
case MAMA_FIELD_TYPE_VECTOR_F64:
r += encodeVectorF64(buffer, mmf);
break;
case MAMA_FIELD_TYPE_MSG:
r += encodeMsgField(buffer, mmf);
break;
case MAMA_FIELD_TYPE_VECTOR_MSG:
r += encodeVectorMsg(buffer, mmf);
break;
default:
break;
}
return r;
}