// **********************************************************************

    public StockStream(DataReader dr)
      : base(StreamType.Stock, dr)
    {
      Security = new Security(dr.ReadString());
      rawQuotes = new RawQuotes();
    }
Example #2
0
        // **********************************************************************

        public OwnOrdersStream(DataReader dr)
            : base(StreamType.OwnOrders, dr)
        {
            Security = new Security(dr.ReadString());
        }
    // **********************************************************************

    public OrdLogStream(DataReader dr)
      : base(StreamType.OrdLog, dr)
    {
      Security = new Security(dr.ReadString());
      rawQuotes = new RawQuotes();
    }
Example #4
0
        // **********************************************************************

        public TradesStream(DataReader dr)
            : base(StreamType.Trades, dr)
        {
            Security = new Security(dr.ReadString());
        }
Example #5
0
        // **********************************************************************

        public DealsStream(DataReader dr)
            : base(StreamType.Deals, dr)
        {
            Security = new Security(dr.ReadString());
        }
Example #6
0
        // **********************************************************************

        public QuotesStream(DataReader dr)
            : base(StreamType.Quotes, dr)
        {
            Security  = new Security(dr.ReadString());
            rawQuotes = new RawQuotes();
        }
    // **********************************************************************

    public AuxInfoStream(DataReader dr)
      : base(StreamType.AuxInfo, dr)
    {
      Security = new Security(dr.ReadString());
    }
    // **********************************************************************

    public TradesStream(DataReader dr)
      : base(StreamType.Trades, dr)
    {
      Security = new Security(dr.ReadString());
    }
    // **********************************************************************

    public QshReaderImpl(FileStream fs, Stream ds)
      : base(fs)
    {
      dr = new DataReader(ds);

      AppName = dr.ReadString();
      Comment = dr.ReadString();
      RecDateTime = new DateTime(dr.ReadInt64(), DateTimeKind.Utc);

      lastMilliseconds = DateTimeHelper.ToMs(RecDateTime);

      int streamCount = dr.ReadByte();

      if(streamCount == 0)
        throw new Exception("Нет потоков данных");

      streams = new QshStream[streamCount];

      for(int i = 0; i < streams.Length; i++)
      {
        StreamType st = (StreamType)dr.ReadByte();

        switch(st)
        {
          case StreamType.Stock:
            streams[i] = new StockStream(dr);
            break;

          case StreamType.Deals:
            streams[i] = new DealsStream(dr);
            break;

          case StreamType.Orders:
            streams[i] = new OrdersStream(dr);
            break;

          case StreamType.Trades:
            streams[i] = new TradesStream(dr);
            break;

          case StreamType.Messages:
            streams[i] = new MessagesStream(dr);
            break;

          case StreamType.AuxInfo:
            streams[i] = new AuxInfoStream(dr);
            break;

          case StreamType.OrdLog:
            streams[i] = new OrdLogStream(dr);
            break;

          default:
            throw new FormatException("Неизвестный тип данных: " + st);
        }
      }

      if(streams.Length == 1)
        currentStream = streams[0];

      ReadNextRecordHeader();
    }
    // **********************************************************************

    public DealsStream(DataReader dr)
      : base(StreamType.Deals, dr)
    {
      Security = new Security(dr.ReadString());
    }
    // **********************************************************************

    public OrdersStream(DataReader dr)
      : base(StreamType.Orders, dr)
    {
      Security = new Security(dr.ReadString());
    }
Example #12
0
        // **********************************************************************

        public AuxInfoStream(DataReader dr)
            : base(StreamType.AuxInfo, dr)
        {
            Security = new Security(dr.ReadString());
        }