Exemplo n.º 1
0
        // do nothing
        public virtual int NewId()
        {
            int id = _idGenerator.NewId();

            _ids = ((IdSlotTree)Tree.Add(_ids, new IdSlotTree(id, Slot.Zero)));
            return(id);
        }
Exemplo n.º 2
0
        public virtual Slot CommittedSlot(int id)
        {
            IdSlotTree idSlotMapping = (IdSlotTree)Tree.Find(_ids, new TreeInt(id));

            if (idSlotMapping == null)
            {
                throw new InvalidIDException(id);
            }
            return(idSlotMapping.Slot());
        }
Exemplo n.º 3
0
        private int EstimatedSlotLength(int estimatedCount)
        {
            IdSlotTree template = _ids;

            if (template == null)
            {
                template = new IdSlotTree(0, new Slot(0, 0));
            }
            return(template.MarshalledLength(estimatedCount) + _idGenerator.MarshalledLength(
                       ) + Const4.IdLength);
        }
Exemplo n.º 4
0
		private void ReadThis()
		{
			SystemData systemData = _container.SystemData();
			_slot = systemData.IdSystemSlot();
			if (!Slot.IsNull(_slot))
			{
				ByteArrayBuffer buffer = _container.ReadBufferBySlot(_slot);
				_childId = buffer.ReadInt();
				_idGenerator.Read(buffer);
				_ids = (IdSlotTree)new TreeReader(buffer, new IdSlotTree(0, null)).Read();
			}
		}
Exemplo n.º 5
0
        private void ReadThis()
        {
            SystemData systemData = _container.SystemData();

            _slot = systemData.IdSystemSlot();
            if (!Slot.IsNull(_slot))
            {
                ByteArrayBuffer buffer = _container.ReadBufferBySlot(_slot);
                _childId = buffer.ReadInt();
                _idGenerator.Read(buffer);
                _ids = (IdSlotTree) new TreeReader(buffer, new IdSlotTree(0, null)).Read();
            }
        }
		public override void MapId(int id, Slot slot)
		{
			IdSlotTree idSlotMapping = new IdSlotTree(id, slot);
			_idsToSlots = ((IdSlotTree)Tree.Add(_idsToSlots, idSlotMapping));
		}
Exemplo n.º 7
0
		// do nothing
		public virtual int NewId()
		{
			int id = _idGenerator.NewId();
			_ids = ((IdSlotTree)Tree.Add(_ids, new IdSlotTree(id, Slot.Zero)));
			return id;
		}
Exemplo n.º 8
0
		private int EstimatedSlotLength(int estimatedCount)
		{
			IdSlotTree template = _ids;
			if (template == null)
			{
				template = new IdSlotTree(0, new Slot(0, 0));
			}
			return template.MarshalledLength(estimatedCount) + _idGenerator.MarshalledLength(
				) + Const4.IdLength;
		}