Exemplo n.º 1
0
 static Operator()
 {
     NONE = new NoneOperator("none");
     CONSTANT = new ConstantOperator("constant");
     DEFAULT = new DefaultOperator("default");
     COPY = new CopyOperator("copy");
     DELTA = new DeltaOperator("delta");
 }
        protected static void AssertComposedScalarField(ComposedScalar field, Type type, String name, Operator exponentOp,
            ScalarValue exponentValue, Operator mantissaOp, ScalarValue mantissaValue)
        {
            Assert.AreEqual(type, field.Type);
            Assert.AreEqual(name, field.Name);
            Scalar[] fields = field.Fields;
            Assert.AreEqual(exponentOp, fields[0].Operator);
            Assert.AreEqual(exponentValue, fields[0].DefaultValue);

            Assert.AreEqual(mantissaOp, fields[1].Operator);
            Assert.AreEqual(mantissaValue, fields[1].DefaultValue);
        }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
        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;
                }
            }
        }
Exemplo n.º 5
0
 internal bool Equals(Operator other)
 {
     return name.Equals(other.name);
 }
Exemplo n.º 6
0
 protected internal OptionallyPresentOperatorCodec(Operator operator_Renamed, FASTType[] types) : base(operator_Renamed, types)
 {
 }
 protected internal OptionallyPresentOperatorCodec(Operator operator_Renamed, FASTType[] types)
     : base(operator_Renamed, types)
 {
 }
Exemplo n.º 8
0
        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 DeltaIntegerOperatorCodec(Operator operator_Renamed, FASTType[] types)
     : base(operator_Renamed, types)
 {
 }
Exemplo n.º 10
0
 protected static void AssertScalarField(Scalar scalar, Type type, String name, String id, String namespace_ren, String dictionary,
     String key, Operator op, ScalarValue defaultVal, bool optional)
 {
     AssertScalarField(scalar, type, name, id, namespace_ren, dictionary, key, namespace_ren, op, defaultVal, optional);
 }
Exemplo n.º 11
0
 protected static void AssertScalarField(FieldSet fieldSet, int fieldIndex, Type type, String name, Operator operator_ren)
 {
     var field = (Scalar)fieldSet.GetField(fieldIndex);
     AssertScalarField(field, type, name);
     Assert.AreEqual(operator_ren, field.Operator);
 }
 internal NoneOperatorCodec(Operator operator_Renamed, FASTType[] types)
     : base(operator_Renamed, types)
 {
 }
Exemplo n.º 13
0
 internal ConstantOperatorCodec(Operator operator_Renamed, FASTType[] types) : base(operator_Renamed, types)
 {
 }
 protected internal AlwaysPresentOperatorCodec(Operator operator_Renamed, FASTType[] types)
     : base(operator_Renamed, types)
 {
 }
Exemplo n.º 15
0
 public Scalar(string name, FASTType type, Operator.Operator operator_Renamed, ScalarValue defaultValue, bool optional)
     : this(new QName(name), type, operator_Renamed, defaultValue, optional)
 {
 }
 internal IncrementIntegerOperatorCodec(Operator operator_Renamed, FASTType[] types)
     : base(operator_Renamed, types)
 {
 }
 internal ConstantOperatorCodec(Operator operator_Renamed, FASTType[] types)
     : base(operator_Renamed, types)
 {
 }
Exemplo n.º 18
0
 protected static void AssertScalarField(Scalar scalar, Type type, String name, String id, String namespace_ren, String dictionary,
     String key, String keyNamespace, Operator op, ScalarValue defaultVal, bool optional)
 {
     var qname = new QName(name, namespace_ren);
     Assert.AreEqual(type, scalar.Type);
     Assert.AreEqual(op, scalar.Operator);
     Assert.AreEqual(qname, scalar.QName);
     var keyName = new QName(key, keyNamespace);
     Assert.AreEqual(keyName, scalar.Key);
     Assert.AreEqual(id, scalar.Id);
     Assert.AreEqual(dictionary, scalar.Dictionary);
     Assert.AreEqual(defaultVal, scalar.DefaultValue);
     Assert.AreEqual(optional, scalar.Optional);
 }
 internal DefaultOperatorCodec(Operator operator_Renamed, FASTType[] types)
     : base(operator_Renamed, types)
 {
 }
Exemplo n.º 20
0
 protected static void AssertSequenceLengthField(Sequence sequence, String name, Type type, Operator operator_ren)
 {
     Assert.AreEqual(type, sequence.Length.Type);
     Assert.AreEqual(name, sequence.Length.Name);
     Assert.AreEqual(operator_ren, sequence.Length.Operator);
 }