本文整理匯總了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;
}