Esempio n. 1
0
        private void displayField(MamaMsgField field)
        {
            Console.Write(String.Format("{0,20}{1,20}{2,20}",
                                        field.getName(),
                                        field.getFid(),
                                        field.getTypeName()));

            /*
             *      The most efficient way of extracting data while iterating
             *      fields is to obtain the field type and then call the
             *      associated strongly-typed accessor.
             *
             *      MamaMsgField.getAsString() will return a string version
             *      of the data but is considerably less efficient and is not
             *      recommended for production use.
             */

            switch (field.getType())
            {
            case mamaFieldType.MAMA_FIELD_TYPE_MSG:
                MamaMsg myMsg = field.getMsg();
                Console.WriteLine(" {");
                displayAllFields(myMsg);
                Console.WriteLine("}");
                break;

            default:
                Console.WriteLine(String.Format("{0,20}", field.getAsString()));
                break;
            }
            Console.Out.Flush();
        }
 public void onUpdate(MamdaSecurityStatusListener listener, MamaMsgField field)
 {
     if ((field != null) && (listener.mSecurityStatusCache.mShortSaleCircuitBreaker != field.getChar()))
     {
         listener.mSecurityStatusCache.mShortSaleCircuitBreaker           = field.getChar();
         listener.mSecurityStatusCache.mShortSaleCircuitBreakerFieldState = MamdaFieldState.MODIFIED;
         listener.mUpdated = true;
     }
 }
 public void onUpdate(MamdaSecurityStatusListener listener, MamaMsgField field)
 {
     if ((field != null) && (listener.mSecurityStatusCache.mLuldIndicator != field.getChar() || listener.mSecurityStatusCache.mLuldIndicatorFieldState == MamdaFieldState.NOT_INITIALISED))
     {
         listener.mSecurityStatusCache.mLuldIndicator           = field.getChar();
         listener.mSecurityStatusCache.mLuldIndicatorFieldState = MamdaFieldState.MODIFIED;
         listener.mUpdated = true;
     }
 }
 public void onUpdate(MamdaSecurityStatusListener listener, MamaMsgField field)
 {
     if (string.Compare(listener.mSecurityStatusCache.mSecStatusOrigStr, field.getString()) != 0)
     {
         listener.mSecurityStatusCache.mSecStatusOrigStr           = field.getString();
         listener.mSecurityStatusCache.mSecStatusOrigStrFieldState = MamdaFieldState.MODIFIED;
         listener.mUpdated = true;
     }
 }
Esempio n. 5
0
            public void onUpdate(MamdaAuctionListener listener, MamaMsgField field)
            {
                string indicator = listener.getFieldAsString(field);

                if (string.Compare(listener.mAuctionCache.mUncrossPriceIndStr, indicator) != 0)
                {
                    listener.mAuctionCache.mUncrossPriceIndStr           = indicator;
                    listener.mAuctionCache.mUncrossPriceIndStrFieldState = MamdaFieldState.MODIFIED;
                }
            }
Esempio n. 6
0
            public void onUpdate(MamdaAuctionListener listener, MamaMsgField field)
            {
                double volume = field.getF64();

                if (listener.mAuctionCache.mUncrossVolume != volume)
                {
                    listener.mAuctionCache.mUncrossVolume           = volume;
                    listener.mAuctionCache.mUncrossVolumeFieldState = MamdaFieldState.MODIFIED;
                }
            }
Esempio n. 7
0
            public void onUpdate(MamdaAuctionListener listener, MamaMsgField field)
            {
                MamaPrice price;

                price = field.getPrice();
                if (listener.mAuctionCache.mUncrossPrice.getValue() != price.getValue())
                {
                    listener.mAuctionCache.mUncrossPrice.copy(price);
                    listener.mAuctionCache.mUncrossPriceFieldState = MamdaFieldState.MODIFIED;
                }
            }
            public void onUpdate(MamdaSecurityStatusListener listener, MamaMsgField field)
            {
                string status = listener.getFieldAsString(field);

                if (string.Compare(listener.mSecurityStatusCache.mSecStatusStr, status) != 0)
                {
                    listener.mSecurityStatusCache.mSecStatusStr           = status;
                    listener.mSecurityStatusCache.mSecStatusStrFieldState = MamdaFieldState.MODIFIED;
                    listener.mUpdated = true;
                }
            }
        public string getFieldAsString(MamaMsgField field)
        {
            switch (field.getType())
            {
            case mamaFieldType.MAMA_FIELD_TYPE_I8:
            case mamaFieldType.MAMA_FIELD_TYPE_U8:
            case mamaFieldType.MAMA_FIELD_TYPE_I16:
            case mamaFieldType.MAMA_FIELD_TYPE_U16:
            case mamaFieldType.MAMA_FIELD_TYPE_I32:
            case mamaFieldType.MAMA_FIELD_TYPE_U32:
                return(field.getU32().ToString());

            case mamaFieldType.MAMA_FIELD_TYPE_STRING:
                return(field.getString());

            default:
                break;
            }
            return(null);
        }
 public void onField(
     MamaMsg msg,
     MamaMsgField field,
     object closure)
 {
     try
     {
         int fieldId = field.getFid();
         if (fieldId <= mMaxFid)
         {
             SecurityStatusUpdate updater = (SecurityStatusUpdate)mUpdaters[fieldId];
             if (updater != null)
             {
                 updater.onUpdate(mListener, field);
             }
         }
     }
     catch (Exception ex)
     {
         throw new MamdaDataException(ex.Message);
     }
 }
Esempio n. 11
0
 public void onUpdate(MamdaAuctionListener listener, MamaMsgField field)
 {
     listener.mAuctionCache.mSendTime           = field.getDateTime();
     listener.mAuctionCache.mSendTimeFieldState = MamdaFieldState.MODIFIED;
 }
Esempio n. 12
0
		private void displayField(MamaMsgField field)
			   {
				   Console.Write(String.Format("{0,20}{1,20}{2,20}",
					   field.getName(),
					   field.getFid(),
					   field.getTypeName()));
                
				   /*  
					   The most efficient way of extracting data while iterating 
					   fields is to obtain the field type and then call the 
					   associated strongly-typed accessor.

					   MamaMsgField.getAsString() will return a string version 
					   of the data but is considerably less efficient and is not 
					   recommended for production use.
				   */  
                        
				   switch(field.getType())
				   {
					   case mamaFieldType.MAMA_FIELD_TYPE_MSG:
						   MamaMsg myMsg = field.getMsg();
						   Console.WriteLine(" {");
						   displayAllFields(myMsg);
						   Console.WriteLine("}");
						   break;
					   default:
						   Console.WriteLine(String.Format("{0,20}",field.getAsString()));
						   break;
				   }
			   }
 public void onUpdate(MamdaSecurityStatusListener listener, MamaMsgField field)
 {
     listener.mSecurityStatusCache.mEventSeqNum           = field.getI64();
     listener.mSecurityStatusCache.mEventSeqNumFieldState = MamdaFieldState.MODIFIED;
 }
Esempio n. 14
0
        /// <summary>
        /// Try to get a MAMA msg field.
        /// The result contains the reusable field object of the 
        /// nativeHandle object. Applications calling this method will receive the same
        /// reusable object for repeated calls on same nativeHandle object.
        /// </summary>
        public bool tryField(
			string name,
			ushort fid,
			ref MamaMsgField result)
        {
            EnsurePeerCreated();

            IntPtr myP = IntPtr.Zero;
            int code = NativeMethods.mamaMsg_getField(nativeHandle, name, fid, ref myP);
            if (CheckResultCodeIgnoreNotFound(code) != MamaStatus.mamaStatus.MAMA_STATUS_OK)
            {
                return false;
            }

            if (mField == null)
            {
                mField = new MamaMsgField();
                mField.SelfManageLifeTime(false);
            }

            mField.setNativeHandle(myP);
            result = mField;
            return true;
        }
Esempio n. 15
0
 internal void OnField(IntPtr msg, IntPtr field, IntPtr closure)
 {
     if (mCallback != null)
     {
         if (mField == null)
         {
             mField = new MamaMsgField(field);
         }
         else
         {
             mField.setNativeHandle(field);
         }
         mCallback.onField(mSender, mField, mClosure);
     }
 }
Esempio n. 16
0
 public void onField(
     MamaMsg msg,
     MamaMsgField field,
     Object closure)
 {
     try
     {
         int fieldId = field.getFid();
         if (fieldId <= mMaxFid)
         {
             TradeUpdate updater = MamdaTradeListener.mUpdaters[fieldId];
             if (updater != null)
             {
                 updater.onUpdate(mListener, field);
             }
         }
     }
     catch (Exception ex)
     {
         throw new MamdaDataException(ex.Message, ex);
     }
 }
Esempio n. 17
0
        /// <summary>
        /// Get a MAMA msg field.
        /// The result contains the reusable field object of the 
        /// nativeHandle object. Applications calling this method will receive the same
        /// reusable object for repeated calls on same nativeHandle object.
        /// </summary>
        public MamaMsgField getField(
			string name,
			ushort fid,
			MamaMsgField valueIfMissing)
        {
            if (mField == null)
            {
                mField = new MamaMsgField ();
                mField.SelfManageLifeTime(false);
            }
            if (tryField (name, fid, ref mField))
                return mField;
            else
                return valueIfMissing;
        }
Esempio n. 18
0
 public void onUpdate(
     MamdaTradeListener listener,
     MamaMsgField field)
 {
     listener.mTradeCache.mCorrSellersSaleDays = field.getI64();
     listener.mTradeCache.mCorrSellersSaleDaysFieldState = MamdaFieldState.MODIFIED;
 }
Esempio n. 19
0
 public void onUpdate(
     MamdaTradeListener listener,
     MamaMsgField field)
 {
     listener.mTradeCache.mCancelTime = field.getDateTime();
     listener.mTradeCache.mCancelTimeFieldState = MamdaFieldState.MODIFIED;
 }
Esempio n. 20
0
 public void onUpdate(
     MamdaTradeListener listener,
     MamaMsgField field)
 {
     listener.mTradeCache.mCorrVolume = field.getF64();
     listener.mTradeCache.mCorrVolumeFieldState = MamdaFieldState.MODIFIED;
 }
Esempio n. 21
0
 public void onUpdate(
     MamdaTradeListener listener,
     MamaMsgField field)
 {
     listener.mTradeCache.mOrigPartId = field.getString();
     listener.mTradeCache.mOrigPartIdFieldState = MamdaFieldState.MODIFIED;
 }
Esempio n. 22
0
 public void onUpdate(
     MamdaTradeListener listener,
     MamaMsgField field)
 {
     listener.mTradeCache.mCurrencyCode = field.getString();
     listener.mTradeCache.mCurrencyCodeFieldState = MamdaFieldState.MODIFIED;
 }
 public void onUpdate(MamdaSecurityStatusListener listener, MamaMsgField field)
 {
     listener.mSecurityStatusCache.mLuldTime           = field.getDateTime();
     listener.mSecurityStatusCache.mLuldTimeFieldState = MamdaFieldState.MODIFIED;
     listener.mUpdated = true;
 }
 public void onUpdate(MamdaSecurityStatusListener listener, MamaMsgField field)
 {
     listener.mSecurityStatusCache.mReason           = listener.getFieldAsString(field);
     listener.mSecurityStatusCache.mReasonFieldState = MamdaFieldState.MODIFIED;
 }
Esempio n. 25
0
 public void onUpdate(
     MamdaTradeListener listener,
     MamaMsgField field)
 {
     listener.mTradeCache.mOrigSeqNum = field.getI64();
     listener.mTradeCache.mOrigSeqNumFieldState = MamdaFieldState.MODIFIED;
 }
 public void onUpdate(MamdaSecurityStatusListener listener, MamaMsgField field)
 {
     listener.mSecurityStatusCache.mLuldLowLimit.copy(field.getPrice());
     listener.mSecurityStatusCache.mLuldLowLimitFieldState = MamdaFieldState.MODIFIED;
     listener.mUpdated = true;
 }
Esempio n. 27
0
 public void onUpdate(
     MamdaTradeListener listener,
     MamaMsgField field)
 {
     listener.mTradeCache.mCorrPrice.copy(field.getPrice());
     listener.mTradeCache.mCorrPriceFieldState = MamdaFieldState.MODIFIED;
 }
Esempio n. 28
0
 public void onUpdate(
     MamdaTradeListener listener,
     MamaMsgField field)
 {
     listener.mTradeCache.mIrregPrice.copy(field.getPrice());
     listener.mTradeCache.mIrregPriceFieldState = MamdaFieldState.MODIFIED;
     if (listener.mTradeCache.mIrregPrice.getValue() != 0.0 && listener.mTradeCache.mIsIrregular == false)
     {
         listener.mTradeCache.mIsIrregular = true;
         listener.mTradeCache.mIsIrregularFieldState = MamdaFieldState.MODIFIED;
     }
     listener.mTradeCache.mGotTradePrice = true;
 }
Esempio n. 29
0
 public void onUpdate(
     MamdaTradeListener listener,
     MamaMsgField field)
 {
     listener.mTradeCache.mCorrCondStr = field.getString();
     listener.mTradeCache.mCorrCondStrFieldState = MamdaFieldState.MODIFIED;
 }
Esempio n. 30
0
 public void onUpdate(
     MamdaTradeListener listener,
     MamaMsgField field)
 {
     listener.mTradeCache.mIrregVolume = field.getI64();
     listener.mTradeCache.mIrregVolumeFieldState = MamdaFieldState.MODIFIED;
     if (listener.mTradeCache.mIrregVolume != 0 && listener.mTradeCache.mIsIrregular == false)
     {
         listener.mTradeCache.mIsIrregular = true;
         listener.mTradeCache.mIsIrregularFieldState = MamdaFieldState.MODIFIED;
     }
     listener.mTradeCache.mGotTradeSize = true;
 }
Esempio n. 31
0
 public void onUpdate(
     MamdaTradeListener listener,
     MamaMsgField field)
 {
     switch (field.getType())
     {
         case mamaFieldType.MAMA_FIELD_TYPE_CHAR:
             listener.mTradeCache.mCorrStopStockInd = field.getChar();
             listener.mTradeCache.mCorrStopStockIndFieldState = MamdaFieldState.MODIFIED;
             break;
         case mamaFieldType.MAMA_FIELD_TYPE_STRING:
             if (field.getString() != String.Empty)
             {
                 listener.mTradeCache.mCorrStopStockInd = field.getString()[0];
                 listener.mTradeCache.mCorrStopStockIndFieldState = MamdaFieldState.MODIFIED;
             }
             else
             {
                 listener.mTradeCache.mCorrStopStockInd = ' ';
                 listener.mTradeCache.mCorrStopStockIndFieldState = MamdaFieldState.MODIFIED;
             }
             break;
         default: break;
     }
 }
Esempio n. 32
0
 public void onUpdate(
     MamdaTradeListener listener,
     MamaMsgField field)
 {
     listener.mTradeCache.mIrregPartId = field.getString();
     listener.mTradeCache.mIrregPartIdFieldState = MamdaFieldState.MODIFIED;
     if (listener.mTradeCache.mIrregPartId != "" && listener.mTradeCache.mIsIrregular == false)
     {
         listener.mTradeCache.mIsIrregular = true;
         listener.mTradeCache.mIsIrregularFieldState = MamdaFieldState.MODIFIED;
     }
 }
Esempio n. 33
0
 public void onUpdate(
     MamdaTradeListener listener,
     MamaMsgField field)
 {
     listener.mTradeCache.mIsIrregular = field.getBool();
     listener.mTradeCache.mIsIrregularFieldState = MamdaFieldState.MODIFIED;
 }
Esempio n. 34
0
 public void onUpdate(
     MamdaTradeListener listener,
     MamaMsgField field)
 {
     listener.mTradeCache.mIrregTime = field.getDateTime();
     listener.mTradeCache.mIrregTimeFieldState = MamdaFieldState.MODIFIED;;
     listener.mTradeCache.mGotTradeTime = true;
 }
Esempio n. 35
0
        /// <summary>
        /// Get a MAMA msg field.
        /// The result contains the reusable field object of the 
        /// nativeHandle object. Applications calling this method will receive the same
        /// reusable object for repeated calls on same nativeHandle object.
        /// </summary>
        public MamaMsgField getField(
			string name,
			ushort fid)
        {
            EnsurePeerCreated();
            IntPtr field = IntPtr.Zero;
            int code = NativeMethods.mamaMsg_getField(nativeHandle, name, fid,ref field);
            CheckResultCode(code);

            if (mField == null)
            {
                //See MamaWrapper constructor - this is fine as ownsThePeer will be set false
                mField = new MamaMsgField (field);
            }
            else
            {
                mField.setNativeHandle(field);

            }
            return mField;
        }
Esempio n. 36
0
 public void onUpdate(
     MamdaTradeListener listener,
     MamaMsgField field)
 {
     listener.mTradeCache.mLastPrice.copy(field.getPrice());
     listener.mTradeCache.mLastPriceFieldState = MamdaFieldState.MODIFIED;
     listener.mTradeCache.mIsIrregular = false;
     listener.mTradeCache.mGotTradePrice = true;
 }
Esempio n. 37
0
        /// <summary>
        /// Get a MAMA msg field.
        /// The result contains the reusable field object of the 
        /// nativeHandle object. Applications calling this method will receive the same
        /// reusable object for repeated calls on same nativeHandle object.
        /// </summary>
        public MamaMsgField getField(
			MamaFieldDescriptor descriptor,
			MamaMsgField valueIfMissing)
        {
            return getField (null, (ushort)descriptor.getFid(), valueIfMissing);
        }
Esempio n. 38
0
 public void onUpdate(
     MamdaTradeListener listener,
     MamaMsgField field)
 {
     listener.mTradeCache.mLastVolume = field.getF64();
     listener.mTradeCache.mLastVolumeFieldState = MamdaFieldState.MODIFIED;
     listener.mTradeCache.mIsIrregular = false;
     listener.mTradeCache.mGotTradeSize = true;
 }
Esempio n. 39
0
        /// <summary>
        /// Try to get a MAMA msg field.
        /// The result contains the reusable field object of the 
        /// nativeHandle object. Applications calling this method will receive the same
        /// reusable object for repeated calls on same nativeHandle object.
        /// </summary>
        public bool tryField(
			MamaFieldDescriptor descriptor,
			ref MamaMsgField result)
        {
            return tryField (null, (ushort)descriptor.getFid(), ref result);
        }
Esempio n. 40
0
 public void onUpdate(
     MamdaTradeListener listener,
     MamaMsgField field)
 {
     switch (field.getType())
     {
         case mamaFieldType.MAMA_FIELD_TYPE_I8:
         case mamaFieldType.MAMA_FIELD_TYPE_U8:
         case mamaFieldType.MAMA_FIELD_TYPE_I16:
         case mamaFieldType.MAMA_FIELD_TYPE_U16:
         case mamaFieldType.MAMA_FIELD_TYPE_I32:
         case mamaFieldType.MAMA_FIELD_TYPE_U32:
             listener.mTradeCache.mTradeExecVenue = field.getU32().ToString();
             listener.mTradeCache.mTradeExecVenueFieldState = MamdaFieldState.MODIFIED;
             break;
         case mamaFieldType.MAMA_FIELD_TYPE_STRING:
             listener.mTradeCache.mTradeExecVenue = field.getString();
             listener.mTradeCache.mTradeExecVenueFieldState = MamdaFieldState.MODIFIED;
             break;
         default:
             break;
     }
 }
Esempio n. 41
0
        public void SetField(IntPtr pField)
        {
            if (mField == null)
                mField = new MamaMsgField (pField);

            mField.setNativeHandle(pField);
        }
Esempio n. 42
0
 public void onUpdate(
     MamdaTradeListener listener,
     MamaMsgField field)
 {
     long tempTradeCount = field.getI64();
     listener.mTmpTradeCount.Value = tempTradeCount;
     listener.mTmpTradeCountFieldState = MamdaFieldState.MODIFIED;
     listener.mTradeCache.mGotTradeCount = true;
 }
Esempio n. 43
0
 /// <summary>
 /// FieldIterator callback
 /// </summary>
 //////////////////////////////////////////////////////////////////////////////////////////////////
 public void onField(MamaMsg msg,
     MamaMsgField field,
     object closure)
 {
     MamaFieldDescriptor descriptor = field.getDescriptor();
     Console.WriteLine(descriptor.getName() + " : " + field.getAsString());
 }
Esempio n. 44
0
 public void onUpdate(
     MamdaTradeListener listener,
     MamaMsgField field)
 {
     listener.mTradeCache.mConflateCount = field.getU32();
     listener.mTradeCache.mConflateCountFieldState = MamdaFieldState.MODIFIED;
 }
Esempio n. 45
0
        public string getFieldAsString(MamaMsgField field)
        {
            switch (field.getType())
            {
                case mamaFieldType.MAMA_FIELD_TYPE_I8:
                case mamaFieldType.MAMA_FIELD_TYPE_U8:
                case mamaFieldType.MAMA_FIELD_TYPE_I16:
                case mamaFieldType.MAMA_FIELD_TYPE_U16:
                case mamaFieldType.MAMA_FIELD_TYPE_I32:
                case mamaFieldType.MAMA_FIELD_TYPE_U32:
                    return field.getU32().ToString();
                case mamaFieldType.MAMA_FIELD_TYPE_STRING:
                    return field.getString();
                default:
                    break;
            }
			
			return null;
        }
Esempio n. 46
0
 public void onUpdate(MamdaAuctionListener listener, MamaMsgField field)
 {
     listener.mAuctionCache.mPartId           = field.getString();
     listener.mAuctionCache.mPartIdFieldState = MamdaFieldState.MODIFIED;
 }