Пример #1
0
 internal void Neuter()
 {
     idToObject                 = new IdToObject();
     typeNameToGcType           = new Dictionary <string, GcType>();
     typeIdToGcType             = new Dictionary <int, GcType>(intEqualityComparer);
     addressToForwardReferences = new Dictionary <ulong, ForwardReference>();
     roots   = null;
     rootIDs = null;
 }
Пример #2
0
        public T GetById(int id)
        {
            T existingObj = null;

            if (IdToObject.TryGetValue(id, out existingObj))
            {
                return(existingObj);
            }

            return(ReadThrough(id));
        }
Пример #3
0
        private T PassThrought(T obj, int id)
        {
            T existingObj = null;

            if (IdToObject.TryGetValue(id, out existingObj))
            {
                return(existingObj);
            }

            IdToObject[id] = obj;
            return(obj);
        }
Пример #4
0
 internal ObjectGraph(ReadNewLog readNewLog, int tickIndex)
 {
     //
     // TODO: Add constructor logic here
     //
     idToObject                 = new IdToObject();
     typeNameToGcType           = new Dictionary <string, GcType>();
     intEqualityComparer        = new IntEqualityComparer();
     typeIdToGcType             = new Dictionary <int, GcType>(intEqualityComparer);
     addressToForwardReferences = new Dictionary <ulong, ForwardReference>();
     unknownTypeId              = GetOrCreateGcType("<unknown type>");
     this.readNewLog            = readNewLog;
     this.tickIndex             = tickIndex;
     empty = true;
 }