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


C++ MamaMsgField::getType方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:OpenMAMA,项目名称:OpenMAMA,代码行数:26,代码来源:MamdaFundamentalListener.cpp

示例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();
     }
 }
开发者ID:MattMulhern,项目名称:OpenMamaCassandra,代码行数:12,代码来源:MamdaQuoteToBookListener.cpp

示例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;
}
开发者ID:dmaguire,项目名称:financial,代码行数:82,代码来源:MamaRecordedMessageCodec.cpp


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