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;
     }
 }
uint32_t MamaRecordedMessageCodec::encodeU32(char*& buffer, MamaMsgField& mmf)
{
	mama_u32_t mfv = mmf.getU32();
	size_t s = sizeof(mfv);
	memcpy(buffer, &mfv, s);
	buffer += s;
	//printf("Encoding U32 Field [%d] = %d...\n", s, mfv);
	return s;
}
        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)
 {
     impl.mQuoteCache.mTmpQuoteCount = field.getU32();
 }