示例#1
0
        public void Add(long objectId, int generationNumber, long offset)
        {
            CosObjectKey objKey = new CosObjectKey(objectId, generationNumber);

            if (!objects.ContainsKey(objKey))
            {
                objects[objKey] = offset;
            }
        }
示例#2
0
        public CosObject GetOrCreateDefault(CosObjectKey key)
        {
            if (!objects.TryGetValue(key, out CosObject obj))
            {
                obj = new CosObject(null);
            }

            return(obj);
        }
示例#3
0
        public CosObject Get(CosObjectKey key)
        {
            if (key != null)
            {
                if (objects.TryGetValue(key, out var value))
                {
                    return(value);
                }
            }

            // this was a forward reference, make "proxy" object
            var obj = new CosObject(null);

            if (key != null)
            {
                obj.SetObjectNumber(key.Number);
                obj.SetGenerationNumber((int)key.Generation);
                objects[key] = obj;
            }

            return(obj);
        }
示例#4
0
 public void UpdateOffset(CosObjectKey key, long offset)
 {
     objectOffsets[key] = offset;
 }