Ejemplo n.º 1
0
 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);
}
Ejemplo n.º 4
0
        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();
 }
Ejemplo n.º 7
0
 void onUpdate (MamdaFundamentalListener::MamdaFundamentalListenerImpl&  impl,
                const MamaMsgField&                                      field)
 {
     impl.mDivCurrency = field.getString();
     impl.mDivCurrencyFieldState = MODIFIED;
 }
Ejemplo n.º 8
0
 void onUpdate (MamdaFundamentalListener::MamdaFundamentalListenerImpl&  impl,
                const MamaMsgField&                                      field)
 {
     impl.mCorpActType = field.getString();
     impl.mCorpActTypeFieldState = MODIFIED;
 }
Ejemplo n.º 9
0
 void onUpdate (MamdaFundamentalListener::MamdaFundamentalListenerImpl&  impl,
                const MamaMsgField&                                      field)
 {
     impl.mMrktSectNative = field.getString();
     impl.mMrktSectNativeFieldState = MODIFIED;
 }