public ComposedScalar(QName name, FASTType type, Scalar[] fields, bool optional, ComposedValueConverter valueConverter) : base(name, optional) { this.fields = fields; this.valueConverter = valueConverter; this.type = type; }
static OperatorCodec() { NONE_ALL = new NoneOperatorCodec(Operator.NONE, FASTType.ALL_TYPES()); CONSTANT_ALL = new ConstantOperatorCodec(Operator.CONSTANT, FASTType.ALL_TYPES()); DEFAULT_ALL = new DefaultOperatorCodec(Operator.DEFAULT, FASTType.ALL_TYPES()); INCREMENT_INTEGER = new IncrementIntegerOperatorCodec(Operator.INCREMENT, FASTType.INTEGER_TYPES); DELTA_INTEGER = new DeltaIntegerOperatorCodec(Operator.DELTA, FASTType.INTEGER_TYPES); TAIL = new TailOperatorCodec(Operator.TAIL, new[] { FASTType.ASCII, FASTType.STRING, FASTType.UNICODE, FASTType.BYTE_VECTOR }); }
public override bool ShouldConvert(Field field) { if (!field.GetType().Equals(typeof(Scalar))) { return(false); } Type type = ((Scalar)field).Type; return(type.Equals(Type.BYTE_VECTOR) || type.Equals(Type.UNICODE)); }
public Scalar(QName name, FASTType type, OperatorCodec operatorCodec, ScalarValue defaultValue, bool optional) : base(name, optional) { InitBlock(); operator_Renamed = operatorCodec.Operator; this.operatorCodec = operatorCodec; dictionary = "global"; this.defaultValue = defaultValue ?? ScalarValue.UNDEFINED; this.type = type; typeCodec = type.GetCodec(operator_Renamed, optional); initialValue = ((defaultValue == null) || defaultValue.Undefined)?this.type.DefaultValue:defaultValue; operator_Renamed.Validate(this); }
public static OperatorCodec GetCodec(Operator operator_Renamed, FASTType type) { var key = new Key(operator_Renamed, type); if (!OPERATOR_MAP.ContainsKey(key)) { Global.HandleError(Error.FastConstants.S2_OPERATOR_TYPE_INCOMP, "The operator \"" + operator_Renamed + "\" is not compatible with type \"" + type + "\""); throw new ArgumentException(); } return(OPERATOR_MAP[key]); }
protected internal OperatorCodec(Operator operator_Renamed, FASTType[] types) { this.operator_Renamed = operator_Renamed; for (int i = 0; i < types.Length; i++) { var key = new Key(operator_Renamed, types[i]); if (!OPERATOR_MAP.ContainsKey(key)) { OPERATOR_MAP[key] = this; } } }
public override Field Parse(System.Xml.XmlElement fieldNode, bool optional, ParsingContext context) { Operator.Operator operator_Renamed = Operator.Operator.NONE; string defaultValue = null; string key = null; string ns = ""; System.Xml.XmlElement operatorElement = GetOperatorElement(fieldNode); if (operatorElement != null) { if (operatorElement.HasAttribute("value")) { defaultValue = operatorElement.GetAttribute("value"); } operator_Renamed = Operator.Operator.GetOperator(operatorElement.Name); if (operatorElement.HasAttribute("key")) { key = operatorElement.GetAttribute("key"); } if (operatorElement.HasAttribute("ns")) { ns = operatorElement.GetAttribute("ns"); } if (operatorElement.HasAttribute("dictionary")) { context.Dictionary = operatorElement.GetAttribute("dictionary"); } } FASTType type = GetType(fieldNode, context); var scalar = new Scalar(GetName(fieldNode, context), type, operator_Renamed, type.GetValue(defaultValue), optional); if (fieldNode.HasAttribute("id")) { scalar.Id = fieldNode.GetAttribute("id"); } if (key != null) { scalar.Key = new QName(key, ns); } scalar.Dictionary = context.Dictionary; ParseExternalAttributes(fieldNode, scalar); return(scalar); }
internal DeltaIntegerOperatorCodec(Operator operator_Renamed, FASTType[] types) : base(operator_Renamed, types) { }
public Scalar(string name, FASTType type, Operator.Operator operator_Renamed, ScalarValue defaultValue, bool optional) : this(new QName(name), type, operator_Renamed, defaultValue, optional) { }
private static void ValidateDecodedValueIsCorrectForType(ScalarValue value_Renamed, FASTType type) { if (value_Renamed == null) { return; } type.ValidateValue(value_Renamed); }
protected internal OptionallyPresentOperatorCodec(Operator operator_Renamed, FASTType[] types) : base(operator_Renamed, types) { }
private static void ValidateDecodedValueIsCorrectForType(ScalarValue value_Renamed, FASTType type) { if (value_Renamed == null) return ; type.ValidateValue(value_Renamed); }
public ComposedScalar(string name, FASTType type, Scalar[] fields, bool optional, ComposedValueConverter valueConverter) : this(new QName(name), type, fields, optional, valueConverter) { }
public virtual OperatorCodec GetCodec(FASTType type) { return OperatorCodec.GetCodec(this, type); }
protected internal AlwaysPresentOperatorCodec(Operator operator_Renamed, FASTType[] types) : base(operator_Renamed, types) { }
public override OperatorCodec GetCodec(FASTType type) { return(OperatorCodec.COPY_ALL); }
public virtual OperatorCodec GetCodec(FASTType type) { return(OperatorCodec.GetCodec(this, type)); }
internal CopyOperatorCodec() : base(Operator.COPY, FASTType.ALL_TYPES()) { }
public static OperatorCodec GetCodec(Operator operator_Renamed, FASTType type) { var key = new Key(operator_Renamed, type); if (!OPERATOR_MAP.ContainsKey(key)) { Global.HandleError(Error.FastConstants.S2_OPERATOR_TYPE_INCOMP, "The operator \"" + operator_Renamed + "\" is not compatible with type \"" + type + "\""); throw new ArgumentException(); } return OPERATOR_MAP[key]; }
internal DefaultOperatorCodec(Operator operator_Renamed, FASTType[] types) : base(operator_Renamed, types) { }
internal IncrementIntegerOperatorCodec(Operator operator_Renamed, FASTType[] types) : base(operator_Renamed, types) { }
internal ConstantOperatorCodec(Operator operator_Renamed, FASTType[] types) : base(operator_Renamed, types) { }
private static void ValidateDictionaryTypeAgainstFieldType(ScalarValue previousValue, FASTType type) { if (previousValue == null || previousValue.Undefined) return ; if (!type.IsValueOf(previousValue)) { Global.HandleError(Error.FastConstants.D4_INVALID_TYPE, "The value \"" + previousValue + "\" is not valid for the type " + type); } }
private static void ValidateDictionaryTypeAgainstFieldType(ScalarValue previousValue, FASTType type) { if (previousValue == null || previousValue.Undefined) { return; } if (!type.IsValueOf(previousValue)) { Global.HandleError(Error.FastConstants.D4_INVALID_TYPE, "The value \"" + previousValue + "\" is not valid for the type " + type); } }
public override OperatorCodec GetCodec(FASTType type) { return OperatorCodec.COPY_ALL; }
internal NoneOperatorCodec(Operator operator_Renamed, FASTType[] types) : base(operator_Renamed, types) { }