Пример #1
0
        public void Start(Type type)
        {
            Contract.RequiresNotNull(type);
            int typeId = BuildXLWriterStats.GetTypeId(type);

            Start(typeId);
        }
Пример #2
0
        public void Start <T>()
        {
            if (m_debug)
            {
                int  typeId = BuildXLWriterStats.GetTypeId(typeof(T));
                uint marker = ReadUInt32();
                Contract.Assume(marker == BuildXLWriter.ItemStartMarker);
                int s = ReadInt32();
                if (s != typeId)
                {
                    Contract.Assume(false, "Expected " + typeId + " for start of type " + typeof(T).FullName + ". Instead retrieved " + s + " corresponding to type" + BuildXLWriterStats.GetTypeName(s));
                }

                m_starts.Push(typeId);
            }
        }
Пример #3
0
        public void End()
        {
            if (m_logStats)
            {
                Entry entry = m_starts.Pop();

                if (m_debug)
                {
                    Write(ItemEndMarker);
                    Write(entry.TypeId);
                }

                Flush();
                long end  = BaseStream.Position;
                long diff = end - entry.Offset;
                BuildXLWriterStats.Add(entry.TypeId, diff);
            }
        }
Пример #4
0
 public void End()
 {
     if (m_debug)
     {
         int  typeId = m_starts.Pop();
         uint marker = ReadUInt32();
         Contract.Assume(marker == BuildXLWriter.ItemEndMarker);
         int e = ReadInt32();
         if (e != typeId)
         {
             Contract.Assume(false, "Expected " + typeId + " for end of type " + BuildXLWriterStats.GetTypeName(typeId) + ". Instead retrieved " + e + " corresponding to type" + BuildXLWriterStats.GetTypeName(e));
         }
     }
 }
Пример #5
0
        public void Start <T>()
        {
            int typeId = BuildXLWriterStats.GetTypeId(typeof(T));

            Start(typeId);
        }