本文整理汇总了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;
}
示例2: SetField
public void SetField(IntPtr pField)
{
if (mField == null)
mField = new MamaMsgField (pField);
mField.setNativeHandle(pField);
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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;
}
}
示例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;
}