Example #1
0
 private void WriteIndex(MarshallingContext context, int masterAddress, int position
                         )
 {
     if (_indexedField != null)
     {
         // for now this is a String index only, it takes the entire slot.
         StatefulBuffer buffer = new StatefulBuffer(context.Transaction(), UnblockedLength
                                                        ());
         int blockedPosition = context.Container().BlockConverter().BytesToBlocks(position
                                                                                  );
         int indexID = masterAddress + blockedPosition;
         buffer.SetID(indexID);
         buffer.Address(indexID);
         TransferContentTo(buffer, UnblockedLength());
         _indexedField.AddIndexEntry(context.Transaction(), context.ObjectID(), buffer);
     }
 }
        public virtual StatefulBuffer ReadStatefulBufferBySlot(Transaction trans, int id,
                                                               Slot slot)
        {
            if (Slot.IsNull(slot))
            {
                return(null);
            }
            if (DTrace.enabled)
            {
                DTrace.ReadSlot.LogLength(slot.Address(), slot.Length());
            }
            StatefulBuffer buffer = CreateStatefulBuffer(trans, slot.Address(), slot.Length()
                                                         );

            buffer.SetID(id);
            buffer.ReadEncrypt(this, slot.Address());
            return(buffer);
        }
Example #3
0
		private void WriteIndex(MarshallingContext context, int masterAddress, int position
			)
		{
			if (_indexedField != null)
			{
				// for now this is a String index only, it takes the entire slot.
				StatefulBuffer buffer = new StatefulBuffer(context.Transaction(), UnblockedLength
					());
				int blockedPosition = context.Container().BlockConverter().BytesToBlocks(position
					);
				int indexID = masterAddress + blockedPosition;
				buffer.SetID(indexID);
				buffer.Address(indexID);
				TransferContentTo(buffer, UnblockedLength());
				_indexedField.AddIndexEntry(context.Transaction(), context.ObjectID(), buffer);
			}
		}