Example #1
0
        public CTFERecord GetEvent(MemoryBitReader r)
        {
            r.Align(streamEventHeader.Align());
            if (r.IsEmpty())
            {
                return(null);
            }

            CTFRecord eh   = streamEventHeader.Read(r);
            CTFRecord ec   = streamEventContext.Read(r);
            uint      id   = (uint)eh.GetValue("id");
            object    o    = eh.GetValue("timestamp");
            ulong     time = 0;

            if (o is uint)
            {
                ulong value = (uint)o;
                ulong mask  = (1L << 27) - 1;

                if (value < (r.prev & mask))
                {
                    value = value + (1L << 27);
                }

                r.prev = r.prev & ~mask;

                r.prev = r.prev + value;
                time   = r.prev;
            }
            else
            {
                time = (ulong)o;
            }

            r.prev = time;
            CTFTEvent e      = events[id];
            CTFRecord er     = e.Fields.Read(r);
            ulong     evLost = r.GetEvsLost();
            ulong     TSs    = 0;
            ulong     TSe    = 0;

            if (r.evDisc != evLost)
            {
                IsEvDiscarded = true;
                r.evDisc      = evLost;
                TSs           = r.GetTSs();
                TSe           = r.GetTSe();
                EvDiscarded   = new CTFELostRecord(evLost, r.GetTSs(), r.GetTSe(), ec);
            }

            return(new CTFERecord(e, time, ec, er));
        }
Example #2
0
 internal void Close()
 {
     r.Close(); r = null; mb = null;
 }
Example #3
0
 public void Open(string filename)
 {
     r  = new BinaryReader(File.Open(filename, FileMode.Open));
     mb = new MemoryBitReader(new FileBitReader(r), packetReader);
 }