本文整理汇总了C++中MamaMsgField::getFid方法的典型用法代码示例。如果您正苦于以下问题:C++ MamaMsgField::getFid方法的具体用法?C++ MamaMsgField::getFid怎么用?C++ MamaMsgField::getFid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MamaMsgField
的用法示例。
在下文中一共展示了MamaMsgField::getFid方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onField
void MamdaQuoteToBookListenerImpl::onField (const MamaMsg& msg,
const MamaMsgField& field,
void* closure)
{
uint16_t fid = field.getFid();
if (fid <= mFieldUpdatersSize)
{
QuoteToBookFieldUpdate* updater = mFieldUpdaters[fid];
if (updater)
{
updater->onUpdate (*this, field);
}
}
}
示例2:
void MamdaFundamentalListener::MamdaFundamentalListenerImpl::onField (
const MamaMsg& msg,
const MamaMsgField& field,
void* closure)
{
uint16_t fid = field.getFid();
if (fid <= mFieldUpdatersSize)
{
FundamentalFieldUpdate* updater = mFieldUpdaters[fid];
if (updater)
{
updater->onUpdate (*this, field);
}
}
}
示例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;
}