当前位置: 首页>>代码示例>>C#>>正文


C# Wombat.MamaMsgField类代码示例

本文整理汇总了C#中Wombat.MamaMsgField的典型用法代码示例。如果您正苦于以下问题:C# MamaMsgField类的具体用法?C# MamaMsgField怎么用?C# MamaMsgField使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MamaMsgField类属于Wombat命名空间,在下文中一共展示了MamaMsgField类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: onUpdate

 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;
 }
开发者ID:jacobraj,项目名称:MAMA,代码行数:13,代码来源:MamdaTradeListener.cs

示例2: SetField

        public void SetField(IntPtr pField)
        {
            if (mField == null)
                mField = new MamaMsgField (pField);

            mField.setNativeHandle(pField);
        }
开发者ID:OpenMAMA,项目名称:OpenMAMA,代码行数:7,代码来源:MamaMsg.cs

示例3: onField

 /// <summary>
 /// FieldIterator callback
 /// </summary>
 //////////////////////////////////////////////////////////////////////////////////////////////////
 public void onField(MamaMsg msg,
     MamaMsgField field,
     object closure)
 {
     MamaFieldDescriptor descriptor = field.getDescriptor();
     Console.WriteLine(descriptor.getName() + " : " + field.getAsString());
 }
开发者ID:jacobraj,项目名称:MAMA,代码行数:11,代码来源:MamaChurnCS.cs

示例4: getField

        /// <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);
        }
开发者ID:OpenMAMA,项目名称:OpenMAMA,代码行数:12,代码来源:MamaMsg.cs

示例5: tryField

        /// <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);
        }
开发者ID:OpenMAMA,项目名称:OpenMAMA,代码行数:12,代码来源:MamaMsg.cs

示例6: onField

 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);
     }
 }
开发者ID:jacobraj,项目名称:MAMA,代码行数:22,代码来源:MamdaTradeListener.cs

示例7: OnField

 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);
     }
 }
开发者ID:OpenMAMA,项目名称:OpenMAMA,代码行数:15,代码来源:MamaMsg.cs

示例8: displayField

		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;
				   }
			   }
开发者ID:jacobraj,项目名称:MAMA,代码行数:30,代码来源:MamaMultiSubscriberCS.cs

示例9: getFieldAsString

        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;
        }
开发者ID:jacobraj,项目名称:MAMA,代码行数:19,代码来源:MamdaOptionChainListener.cs


注:本文中的Wombat.MamaMsgField类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。