Wombat.MamaMsg.getField C# (CSharp) Method

getField() public method

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.
public getField ( Wombat.MamaFieldDescriptor descriptor ) : Wombat.MamaMsgField
descriptor Wombat.MamaFieldDescriptor
return Wombat.MamaMsgField
        public MamaMsgField getField(
			MamaFieldDescriptor descriptor)
        {
            return getField (null, (ushort)descriptor.getFid());
        }

Same methods

MamaMsg::getField ( Wombat.MamaFieldDescriptor descriptor, Wombat.MamaMsgField valueIfMissing ) : Wombat.MamaMsgField
MamaMsg::getField ( string name, ushort fid ) : Wombat.MamaMsgField
MamaMsg::getField ( string name, ushort fid, Wombat.MamaMsgField valueIfMissing ) : Wombat.MamaMsgField

Usage Example

        private void updateOrderImbalanceFields(
			MamdaSubscription	subscription,
			MamaMsg				msg,
			mamaMsgType			msgType)
		{
			string securityStatus = null;
			lock (this)
			{
				MamaMsgField msgField = null;
	            
				/*The wSecStatusQual will not always be in the message 
				so you need to account for this by checking for it.
				*/
				try
				{
					msgField = msg.getField(MamdaOrderImbalanceFields.SECURITY_STATUS_QUAL, null);
				}
				catch (MamdaDataException ex)
				{
					throw new MamaException(MamaStatus.mamaStatus.MAMA_STATUS_PLATFORM, ex.Message);
				}
				if (msgField == null) //does not exist
					return;

				securityStatus = msgField.getString();

				if (isImbalanceType(securityStatus))
				{
					clearCache(mOrderImbalanceCache);
				}
				msg.iterateFields(mFieldIterator, null,null);
			}

			switch (msgType)
			{
				case mamaMsgType.MAMA_MSG_TYPE_INITIAL:
				case mamaMsgType.MAMA_MSG_TYPE_RECAP:
					handleRecap(subscription, msg);
					break;
				case mamaMsgType.MAMA_MSG_TYPE_UPDATE:
				{
					int value = 0;
					if (securityStatus != null)
					{
						value = MamdaOrderImbalanceType.stringToValue(securityStatus);
						if (MamdaOrderImbalanceType.isMamdaImbalanceOrder(value))
						{
							handleOrderImbalance(subscription,msg); 
						}
						else
						{
							handleNoOrderImbalance(subscription, msg); 
						}
					}
				}
				break;
			default:
				break;
			}
	        
		}
MamaMsg