public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { foreach (var field in _fields) { a.Add(field); } }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { s.WriteInline(a, "swapTenor", _swapTenor); s.WriteInline(a, "optionExpiry", _optionExpiry); a.Add("relativeStrike", _relativeStrike); }
public static void WriteTypeHeader(this IFudgeSerializer s, IAppendingFudgeFieldContainer a, Type type) { //Unlike the java library this functionality is not exposed, so we have to duplicate it var map = (IFudgeTypeMappingStrategy)s.Context.GetProperty(ContextProperties.TypeMappingStrategyProperty); a.Add(0, map.GetName(type)); }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { foreach (var field in _fields) { a.Add(field); } }
public void ToFudgeMsg(IAppendingFudgeFieldContainer message, IFudgeSerializer s) { message.Add("name", Name); if (_uniqueID != null) { message.Add("uniqueId", _uniqueID.ToString()); } s.WriteInline(message, "identifier", PortfolioIdentifier); s.WriteInline(message, "user", User); s.WriteInline(message, "resultModelDefinition", ResultModelDefinition); if (DefaultCurrency != null) { message.Add("currency", DefaultCurrency.ISOCode); } WriteNullableTimeSpanField(message, "minDeltaCalcPeriod", MinDeltaCalcPeriod); WriteNullableTimeSpanField(message, "maxDeltaCalcPeriod", MaxDeltaCalcPeriod); WriteNullableTimeSpanField(message, "fullDeltaCalcPeriod", MinFullCalcPeriod); WriteNullableTimeSpanField(message, "maxFullCalcPeriod", MaxFullCalcPeriod); foreach (var calcConfig in CalculationConfigurationsByName.Values) { FudgeMsg calcConfigMsg = s.Context.NewMessage(); calcConfig.ToFudgeMsg(calcConfigMsg, s); message.Add("calculationConfiguration", calcConfigMsg); } }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { a.Add("target", Target.ToString()); a.Add("name", Name); a.Add("instrumentType", InstrumentType); a.Add("quoteType", QuoteType); a.Add("quoteUnits", QuoteUnits); }
public void Serialize(object obj, IAppendingFudgeFieldContainer msg, IFudgeSerializer serializer) { var address = (Address)obj; msg.AddIfNotNull("line1", address.Line1); msg.AddIfNotNull("line2", address.Line2); msg.AddIfNotNull("zip", address.Zip); }
public override void Serialize(IAppendingFudgeFieldContainer msg, IFudgeSerializer serializer) { // Add our parent's fields base.Serialize(msg, serializer); // Now tag on ours msg.AddAll("siblings", siblings); }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { a.Add("aggregatePositionOutputMode", EnumBuilder <ResultOutputMode> .GetJavaName(AggregatePositionOutputMode)); a.Add("positionOutputMode", EnumBuilder <ResultOutputMode> .GetJavaName(PositionOutputMode)); a.Add("tradeOutputMode", EnumBuilder <ResultOutputMode> .GetJavaName(TradeOutputMode)); a.Add("securityOutputMode", EnumBuilder <ResultOutputMode> .GetJavaName(SecurityOutputMode)); a.Add("primitiveOutputMode", EnumBuilder <ResultOutputMode> .GetJavaName(PrimitiveOutputMode)); }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { a.Add(SchemeFudgeFieldName, Scheme); a.Add(ValueFudgeFieldName, Value); if (Version != null) { a.Add(VersionFudgeFieldName, Version); } }
public static void AddMessageFields(IFudgeSerializer fudgeSerializer, IAppendingFudgeFieldContainer msg, ComputationTargetSpecification @object) { msg.Add("computationTargetType", EnumBuilder <ComputationTargetType> .GetJavaName(@object.Type)); UniqueId uid = @object.Uid; if (uid != null) { fudgeSerializer.WriteInline(msg, "computationTargetIdentifier", uid); } }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { a.Add("type", EnumBuilder <StripInstrumentType> .GetJavaName(InstrumentType)); s.WriteInline(a, "tenor", CurveNodePointTime); a.Add("conventionName", ConventionName); if (InstrumentType == StripInstrumentType.Future) { a.Add("numFutures", NthFutureFromTenor); } }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { WriteDocumentFields(a); if (_uniqueId != null) { a.Add("uniqueId", _uniqueId.ToString()); } a.Add("snapshot", _snapshot); }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { s.WriteTypeHeader(a, typeof(ManageableVolatilitySurfaceSnapshot)); var fudgeSerializer = new FudgeSerializer(s.Context); var valuesMessage = MapBuilder.ToFudgeMsg(s, _values, fudgeSerializer.SerializeToMsg, fudgeSerializer.SerializeToMsg); a.Add("values", valuesMessage); }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { WriteDocumentFields(a); if (UniqueId != null) { a.Add("uniqueId", UniqueId.ToString()); } a.Add("security", Security); }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { WriteDocumentFields(a); if (UniqueId != null) { a.Add("uniqueId", UniqueId.ToString()); } a.Add("yieldCurveDefinition", YieldCurveDefinition); }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { WriteDocumentFields(a); if (UniqueId != null) { a.Add("uniqueId", UniqueId.ToString()); } a.Add("yieldCurveDefinition", YieldCurveDefinition); }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { WriteDocumentFields(a); if (_uniqueId != null) { a.Add("uniqueId", _uniqueId.ToString()); } a.Add("snapshot", _snapshot); }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { WriteDocumentFields(a); if (UniqueId != null) { a.Add("uniqueId", UniqueId.ToString()); } a.Add("security", Security); }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { s.WriteTypeHeader(a, typeof(ManageableVolatilityCubeSnapshot)); var valuesMessage = MapBuilder.ToFudgeMsg(s, _values); a.Add("values", valuesMessage); s.WriteInline(a, "otherValues", _otherValues); var strikesMessage = MapBuilder.ToFudgeMsg(s, _strikes); a.Add("strikes", strikesMessage); }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { if (_valuationTime != default(DateTimeOffset)) { a.Add("valuation", _valuationTime); } if (_marketDataSpecification != null) { s.WriteInline(a, "marketDataSpecification", _marketDataSpecification); } }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { if (_valuationTime != default(DateTimeOffset)) { a.Add("valuation", _valuationTime); } if (_marketDataSpecification != null) { s.WriteInline(a, "marketDataSpecification", _marketDataSpecification); } }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { if (_overrideValue != null) { a.Add("overrideValue", _overrideValue); } if (_marketValue != null) { a.Add("marketValue", _marketValue); } }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { s.WriteTypeHeader(a, GetType()); var fudgeMsg = new FudgeMsg(s.Context); foreach (var viewCycleExecutionOptionse in _executionSequence) { FudgeMsg msg = ((OpenGammaFudgeContext)s.Context).GetSerializer().SerializeToMsg(viewCycleExecutionOptionse); fudgeMsg.Add(null, null, msg); } a.Add("sequence", fudgeMsg); }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { s.WriteTypeHeader(a, GetType()); var fudgeMsg = new FudgeMsg(s.Context); foreach (var viewCycleExecutionOptionse in _executionSequence) { FudgeMsg msg = ((OpenGammaFudgeContext)s.Context).GetSerializer().SerializeToMsg(viewCycleExecutionOptionse); fudgeMsg.Add(null, null, msg); } a.Add("sequence", fudgeMsg); }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { a.Add("currency", _currency.ISOCode); if (_region != null) { a.Add("region", _region); } a.Add("name", _name); a.Add("interpolatorName", _interpolatorName); foreach (var fixedIncomeStrip in Strips) { s.WriteInline(a, "strip", fixedIncomeStrip); } }
/// <summary> /// Serializes all the values as a sequence of submessages with the same field name and ordinal. /// </summary> /// <typeparam name="T">Type of objects.</typeparam> /// <param name="serializer">Serializer to write the fields.</param> /// <param name="msg">Parent message for the sub-message.</param> /// <param name="name">Name of the fields.</param> /// <param name="ordinal">Ordinal of the fields (may be <c>null</c>).</param> /// <param name="objects">Objects to serialize.</param> /// <remarks>See the remarks in <see cref="WriteInline"/> regarding the limitations of writing as an in-line sub-message.</remarks> /// <remarks><c>null</c>s in the sequence are written as Fudge <see cref="IndicatorType"/>s.</remarks> public static void WriteAllInline <T>(this IFudgeSerializer serializer, IAppendingFudgeFieldContainer msg, string name, int?ordinal, IEnumerable <T> objects) { foreach (T obj in objects) { if (obj != null) { serializer.WriteInline(msg, name, ordinal, obj); } else { msg.Add(name, ordinal, IndicatorType.Instance); } } }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { s.WriteInline(a, "globalValues", _globalValues); a.Add("name", Name); a.Add("basisViewName", _basisViewName); if (_uniqueId != null) { a.Add("uniqueId", _uniqueId); } a.Add("yieldCurves", MapBuilder.ToFudgeMsg(s, _yieldCurves)); a.Add("volatilityCubes", MapBuilder.ToFudgeMsg(s, _volatilityCubes)); a.Add("volatilitySurfaces", MapBuilder.ToFudgeMsg(s, _volatilitySurfaces)); }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { s.WriteInline(a, "pagingRequest", _pagingRequest); if (_name != null) { a.Add("name", _name); } if (_portfolioObjectIds != null) { s.WriteInline(a, "portfolioObjectIds", _portfolioObjectIds); } if (_nodeObjectIds != null) { s.WriteInline(a, "nodeObjectIds", _nodeObjectIds); } }
public void Serialize(object obj, IAppendingFudgeFieldContainer msg, IFudgeSerializer serializer) { beforeAfterMethodHelper.CallBeforeSerialize(obj); foreach (var entry in propMap) { string name = entry.Key; MorePropertyData prop = entry.Value; object val = prop.PropertyData.Getter(obj); if (val != null) { prop.Serializer(prop, val, msg, serializer); } } beforeAfterMethodHelper.CallAfterSerialize(obj); }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { s.WriteInline(a, "pagingRequest", _pagingRequest); if (_name != null) { a.Add("name", _name); } if (_portfolioObjectIds != null) { s.WriteInline(a, "portfolioObjectIds", _portfolioObjectIds); } if (_nodeObjectIds != null) { s.WriteInline(a, "nodeObjectIds", _nodeObjectIds); } }
public void Serialize(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { var context = s.Context; var withMessage = new FudgeMsg(context); var v = new string[1]; foreach (var property in PropertyValues) { if (property.Value == null) { var optMessage = new FudgeMsg(context) { { (string)null, IndicatorType.Instance } }; withMessage.Add(property.Key, optMessage); } else if (0 == property.Value.Count) { withMessage.Add(property.Key, IndicatorType.Instance); } else if (property.Value.Count == 1) { property.Value.CopyTo(v, 0); withMessage.Add(property.Key, v[0]); } else { var manyMesssage = new FudgeMsg(context); foreach (var val in property.Value) { manyMesssage.Add(property.Key, val); } withMessage.Add(property.Key, manyMesssage); } } if (_optional != null) { foreach (var optional in _optional) { withMessage.Add(optional, new FudgeMsg(context, new Field("optional", IndicatorType.Instance))); } } a.Add("with", withMessage); }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { Type type = typeof(ManageableUnstructuredMarketDataSnapshot); s.WriteTypeHeader(a, type); foreach (var value in Values) { foreach (var valueSnapshot in value.Value) { var openGammaFudgeContext = (OpenGammaFudgeContext)s.Context; var newMessage = s.Context.NewMessage(); newMessage.Add("valueSpec", openGammaFudgeContext.GetSerializer().SerializeToMsg(value.Key)); newMessage.Add("valueName", valueSnapshot.Key); newMessage.Add("value", openGammaFudgeContext.GetSerializer().SerializeToMsg(valueSnapshot.Value)); a.Add(1, newMessage); } } }
public void ToFudgeMsg(IAppendingFudgeFieldContainer calcConfigMsg, IFudgeSerializer s) { var context = s.Context; var fudgeSerializer = new FudgeSerializer(context); calcConfigMsg.Add("name", Name); foreach (var securityTypeRequirements in PortfolioRequirementsBySecurityType) { FudgeMsg securityTypeRequirementsMsg = new FudgeMsg(context); securityTypeRequirementsMsg.Add("securityType", securityTypeRequirements.Key); foreach (var requirement in securityTypeRequirements.Value) { var newMessage = context.NewMessage(); newMessage.Add("requiredOutput", requirement.Item1); newMessage.Add("constraints", fudgeSerializer.SerializeToMsg(requirement.Item2)); securityTypeRequirementsMsg.Add("portfolioRequirement", newMessage); } calcConfigMsg.Add("portfolioRequirementsBySecurityType", securityTypeRequirementsMsg); } foreach (var specificRequirement in SpecificRequirements) { var sReqMsg = fudgeSerializer.SerializeToMsg(specificRequirement); calcConfigMsg.Add("specificRequirement", sReqMsg); } var defaultPropsMessage = fudgeSerializer.SerializeToMsg(DefaultProperties); calcConfigMsg.Add("defaultProperties", defaultPropsMessage); var deltaDefnMessage = fudgeSerializer.SerializeToMsg(_deltaDefinition); calcConfigMsg.Add("deltaDefinition", deltaDefnMessage); if (ResolutionRuleTransform != null) { var transformMessage = fudgeSerializer.SerializeToMsg(ResolutionRuleTransform); calcConfigMsg.Add("resolutionRuleTransform", transformMessage); } }
public static FudgeMsg ToFudgeMsg <TKey, TValue>(IFudgeSerializer s, IDictionary <TKey, TValue> dict, Func <TKey, object> keyMsgGen = null, Func <TValue, object> valueMsgGen = null) where TValue : class { var fudgeSerializer = new FudgeSerializer(s.Context); keyMsgGen = keyMsgGen ?? (k => fudgeSerializer.SerializeToMsg(k)); valueMsgGen = valueMsgGen ?? (v => fudgeSerializer.SerializeToMsg(v)); var valuesMessage = new FudgeMsg(s.Context); foreach (var value in dict) { valuesMessage.Add(1, keyMsgGen(value.Key)); if (value.Value == null) { valuesMessage.Add(2, IndicatorType.Instance); } else { valuesMessage.Add(2, valueMsgGen(value.Value)); } } return(valuesMessage); }
protected override void SerializeImpl(ExternalIdBundle obj, IAppendingFudgeFieldContainer msg, IFudgeSerializer serializer) { foreach (var identifier in obj.Identifiers) { msg.Add("ID", identifier); } }
/// <inheritdoc/> public void Serialize(object obj, IAppendingFudgeFieldContainer msg, IFudgeSerializer serializer) { helper.Serialize(msg, obj, (o, si, sc) => {((ISerializable)o).GetObjectData(si, sc);}); }
public void ToFudgeMsg(IAppendingFudgeFieldContainer msg, IFudgeSerializer serializer) { msg.Add("number", number); }
public void ToFudgeMsg(IAppendingFudgeFieldContainer message, IFudgeSerializer s) { message.Add("name", Name); if (_uniqueID != null) { message.Add("uniqueId", _uniqueID.ToString()); } s.WriteInline(message, "identifier", PortfolioIdentifier); s.WriteInline(message, "user", User); s.WriteInline(message, "resultModelDefinition", ResultModelDefinition); if (DefaultCurrency != null) { message.Add("currency", DefaultCurrency.ISOCode); } WriteNullableTimeSpanField(message, "minDeltaCalcPeriod", MinDeltaCalcPeriod); WriteNullableTimeSpanField(message, "maxDeltaCalcPeriod", MaxDeltaCalcPeriod); WriteNullableTimeSpanField(message, "fullDeltaCalcPeriod", MinFullCalcPeriod); WriteNullableTimeSpanField(message, "maxFullCalcPeriod", MaxFullCalcPeriod); foreach (var calcConfig in CalculationConfigurationsByName.Values) { FudgeMsg calcConfigMsg = s.Context.NewMessage(); calcConfig.ToFudgeMsg(calcConfigMsg, s); message.Add("calculationConfiguration", calcConfigMsg); } }
public IFudgeFieldContainer ToFudgeMsg(IFudgeSerializer serializer) { return null; }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { s.WriteTypeHeader(a, typeof(MissingMarketDataSentinel)); }
/// <inheritdoc/> public void Serialize(object obj, IAppendingFudgeFieldContainer msg, IFudgeSerializer serializer) { helper.Serialize(msg, obj, surrogate.GetObjectData); }
public static IFudgeFieldContainer ToFudgeMsg(IFudgeSerializer serializer) { // Shouldn't be static return null; }
public void Serialize(object obj, IAppendingFudgeFieldContainer msg, IFudgeSerializer serializer) { var address = (Address)obj; msg.AddIfNotNull("line1", address.Line1); msg.AddIfNotNull("line2", address.Line2); msg.AddIfNotNull("zip", address.Zip); }
/// <inheritdoc/> public void Serialize(object obj, IAppendingFudgeFieldContainer msg, IFudgeSerializer serializer) { IFudgeSerializable ser = (IFudgeSerializable)obj; ser.Serialize(msg, serializer); }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { throw new NotImplementedException(); }
/// <inheritdoc/> public void Serialize(object obj, IAppendingFudgeFieldContainer msg, IFudgeSerializer serializer) { helper.Serialize(obj, msg, serializer); }
public void Serialize(object obj, IAppendingFudgeFieldContainer msg, IFudgeSerializer serializer) { throw new NotImplementedException(); }
public void Serialize(IAppendingFudgeFieldContainer msg, IFudgeSerializer serializer) { msg.Add("Bid", Bid); msg.Add("Ask", Ask); msg.Add("BidVolume", BidVolume); msg.Add("AskVolume", AskVolume); msg.Add("Timestamp", Timestamp); }
public void Serialize(IAppendingFudgeFieldContainer msg, IFudgeSerializer serializer) { msg.Add("ticker", Ticker); msg.Add("bid", Bid); msg.Add("offer", Offer); }
public virtual void Serialize(IAppendingFudgeFieldContainer msg, IFudgeSerializer serializer) { msg.Add("name", Name); msg.AddIfNotNull("mainAddress", MainAddress); }
public override void Serialize(IAppendingFudgeFieldContainer msg, IFudgeSerializer serializer) { // Add our parent's fields base.Serialize(msg, serializer); // Now tag on ours msg.AddAll("siblings", siblings); }
/// <inheritdoc/> public void Serialize(object obj, IAppendingFudgeFieldContainer msg, IFudgeSerializer serializer) { toFudgeMsgMethod.Invoke(obj, new object[] { msg, serializer }); }
public void Serialize(object obj, IAppendingFudgeFieldContainer msg, IFudgeSerializer serializer) { msg.Add(1, Enum.GetName(typeof(SurrogateEnumTest), obj)); }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { throw new NotImplementedException(); }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { s.WriteInline(a, "identifiers", _identifiers.ToList()); a.Add("searchType", EnumBuilder<ExternalIdSearchType>.GetJavaName(_searchType)); }
public void ToFudgeMsg(IAppendingFudgeFieldContainer msg, IFudgeSerializer s) { msg.Add("valueName", ValueName); ComputationTargetSpecificationBuilder.AddMessageFields(s, msg, TargetSpecification); s.WriteInline(msg, "constraints", Constraints); }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { a.Add("aggregatePositionOutputMode", EnumBuilder<ResultOutputMode>.GetJavaName(AggregatePositionOutputMode)); a.Add("positionOutputMode", EnumBuilder<ResultOutputMode>.GetJavaName(PositionOutputMode)); a.Add("tradeOutputMode", EnumBuilder<ResultOutputMode>.GetJavaName(TradeOutputMode)); a.Add("securityOutputMode", EnumBuilder<ResultOutputMode>.GetJavaName(SecurityOutputMode)); a.Add("primitiveOutputMode", EnumBuilder<ResultOutputMode>.GetJavaName(PrimitiveOutputMode)); }
public void Serialize(IAppendingFudgeFieldContainer msg, IFudgeSerializer serializer) { msg.AddIfNotNull("message", Message); msg.AddIfNotNull("other", Other); }
public void ToFudgeMsg(IAppendingFudgeFieldContainer a, IFudgeSerializer s) { if (_overrideValue != null) { a.Add("overrideValue", _overrideValue); } if (_marketValue != null) { a.Add("marketValue", _marketValue); } }