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; } }
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(); } }
uint32_t MamaRecordedMessageCodec::encodeString(char*& buffer, MamaMsgField& mmf) { const char* mfv = mmf.getString(); mama_u16_t s = (mama_u16_t)strlen(mfv); // Add the size to the buffer as this is a non-fixed width field type memcpy(buffer, &s, 2); buffer += 2; memcpy(buffer, mfv, s); buffer += s; //printf("Encoding String Field[%d] = %s...\n", s, mfv); return (s+2); }
void onUpdate (MamdaFundamentalListener::MamdaFundamentalListenerImpl& impl, const MamaMsgField& field) { const char* marketSegment; int segment; 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: segment = field.getU32(); if (0 == segment) { impl.mMarketSegment = MamdaFundamentalFields::MRKT_SEGMENT_NONE; impl.mMarketSegmentFieldState = MODIFIED; } else { ostringstream stringbuilder; stringbuilder << segment; impl.mMarketSegment = stringbuilder.str(); impl.mMarketSegmentFieldState = MODIFIED; } break; case MAMA_FIELD_TYPE_STRING: marketSegment = field.getString(); if (strcmp (marketSegment, "0") == 0) { // No market segment is known/available for this security impl.mMarketSegment = MamdaFundamentalFields::MRKT_SEGMENT_NONE; impl.mMarketSegmentFieldState = MODIFIED; } else { // Already a string; impl.mMarketSegment = marketSegment; impl.mMarketSegmentFieldState = MODIFIED; } break; default: mama_log (MAMA_LOG_LEVEL_FINE, "Unhandled type %d for wMarketSegment. " "Expected string or integer.", field.getType()); break; } }
void onUpdate (MamdaQuoteToBookListenerImpl& impl, const MamaMsgField& field) { if (impl.mFullBook && impl.mFullBook->getSymbol()[0]=='\0') { const char* result = NULL; result = field.getString(); if (result) { impl.mFullBook->setSymbol (result); } } }
void onUpdate (MamdaQuoteToBookListenerImpl& impl, const MamaMsgField& field) { impl.mQuoteCache.mQuoteQualStr = field.getString(); }
void onUpdate (MamdaFundamentalListener::MamdaFundamentalListenerImpl& impl, const MamaMsgField& field) { impl.mDivCurrency = field.getString(); impl.mDivCurrencyFieldState = MODIFIED; }
void onUpdate (MamdaFundamentalListener::MamdaFundamentalListenerImpl& impl, const MamaMsgField& field) { impl.mCorpActType = field.getString(); impl.mCorpActTypeFieldState = MODIFIED; }
void onUpdate (MamdaFundamentalListener::MamdaFundamentalListenerImpl& impl, const MamaMsgField& field) { impl.mMrktSectNative = field.getString(); impl.mMrktSectNativeFieldState = MODIFIED; }