Esempio n. 1
0
 public FudgeSerializationContext(FudgeContext context, SerializationTypeMap typeMap, IFudgeStreamWriter writer, IFudgeTypeMappingStrategy typeMappingStrategy)
 {
     this.context             = context;
     this.writer              = writer;
     this.typeMap             = typeMap;
     this.typeMappingStrategy = typeMappingStrategy;
 }
 public FudgeDeserializationContext(FudgeContext context, SerializationTypeMap typeMap, IFudgeTypeMappingStrategy typeMappingStrategy)
 {
     this.context             = context;
     this.typeMap             = typeMap;
     this.objectList          = new List <MsgAndObj>();
     this.stack               = new Stack <State>();
     this.typeMappingStrategy = typeMappingStrategy;
 }
        public MemoizingTypeMappingStrategy(IFudgeTypeMappingStrategy inner)
        {
            _inner = inner;
            _getNameCache = new Memoizer<Type, string>(GetNameImpl);
            _getTypeCache = new Memoizer<string, Type>(GetTypeImpl);

            var weakRef = new WeakReference(this);
            HookUpWeakClearingDelegate(weakRef);
        }
        public MemoizingTypeMappingStrategy(IFudgeTypeMappingStrategy inner)
        {
            _inner        = inner;
            _getNameCache = new Memoizer <Type, string>(GetNameImpl);
            _getTypeCache = new Memoizer <string, Type>(GetTypeImpl);

            var weakRef = new WeakReference(this);

            HookUpWeakClearingDelegate(weakRef);
        }
        /// <remarks>
        ///     See also <see cref="ComputedValueBuilder.GetValue"/>
        /// </remarks>
        private static object Deserialize(IFudgeDeserializer deserializer, IFudgeTypeMappingStrategy typeMap, string labelType, IFudgeField labelValue)
        {
            if (labelValue.Type != FudgeMsgFieldType.Instance)
            {
                return(labelValue.Value);
            }
            Type labelClass = typeMap.GetType(labelType);

            return(deserializer.FromField(labelValue, labelClass));
        }
 private StreamingFudgeDeserializationContext(FudgeContext context, SerializationTypeMap typeMap, IFudgeTypeMappingStrategy typeMappingStrategy, FudgeStreamReaderMsgWriter msgWriter)
     : base(context, typeMap, typeMappingStrategy, msgWriter.Map)
 {
     this.msgWriter = msgWriter;
     msgWriter.DeserializationContext = this;
 }
 public StreamingFudgeDeserializationContext(FudgeContext context, SerializationTypeMap typeMap, IFudgeStreamReader reader, IFudgeTypeMappingStrategy typeMappingStrategy)
     : this(context, typeMap, typeMappingStrategy, new FudgeStreamReaderMsgWriter(context, reader))
 {
 }
 public ReaderFudgeDeserializationContext(FudgeContext context, SerializationTypeMap typeMap, IFudgeStreamReader reader, IFudgeTypeMappingStrategy typeMappingStrategy)
     : base(context, typeMap, typeMappingStrategy)
 {
     this.msgWriter = new FudgeMsgStreamWriter(context);
     this.pipe = new FudgeStreamPipe(reader, msgWriter);
 }
 public MessageFudgeDeserializationContext(FudgeContext context, SerializationTypeMap typeMap, IFudgeTypeMappingStrategy typeMappingStrategy, FudgeMsg msg) : base(context, typeMap, typeMappingStrategy)
 {
     this.msg = msg;
 }
Esempio n. 10
0
 private StreamingFudgeDeserializationContext(FudgeContext context, SerializationTypeMap typeMap, IFudgeTypeMappingStrategy typeMappingStrategy, FudgeStreamReaderMsgWriter msgWriter)
     : base(context, typeMap, typeMappingStrategy, msgWriter.Map)
 {
     this.msgWriter = msgWriter;
     msgWriter.DeserializationContext = this;
 }
Esempio n. 11
0
 public StreamingFudgeDeserializationContext(FudgeContext context, SerializationTypeMap typeMap, IFudgeStreamReader reader, IFudgeTypeMappingStrategy typeMappingStrategy)
     : this(context, typeMap, typeMappingStrategy, new FudgeStreamReaderMsgWriter(context, reader))
 {
 }
 public ReaderFudgeDeserializationContext(FudgeContext context, SerializationTypeMap typeMap, IFudgeStreamReader reader, IFudgeTypeMappingStrategy typeMappingStrategy)
     : base(context, typeMap, typeMappingStrategy)
 {
     this.msgWriter = new FudgeMsgStreamWriter(context);
     this.pipe      = new FudgeStreamPipe(reader, msgWriter);
 }