internal unsafe SSSPCell_Accessor(long CellID, ActionOnCellNotFound action) { int tmp; CellPtr = Global.LocalStorage.GetLockedUnsafeCellLocation(CellID, out tmp, out CellEntryIndex); if (CellPtr == null) { if (action == ActionOnCellNotFound.ThrowException) { throw new CellNotFoundException("Cell with ID=" + CellID + " not found!"); } else if (action == ActionOnCellNotFound.CreateNew) { int size; byte[] defaultContent = construct(CellID); CellPtr = Global.LocalStorage.AddOrUse(CellID, out size, out CellEntryIndex, defaultContent, (ushort)CellType.SSSPCell); } else { this.CellID = -1; return; } } neighbors_Accessor_Field = new longList(null, (ptr, ptr_offset, delta) => { int substructure_offset = (int)(ptr - this.CellPtr); this.ResizeFunction(this.CellPtr, ptr_offset + substructure_offset, delta); return(this.CellPtr + substructure_offset); }); this.CellID = CellID; }
internal unsafe SSSPCell_Accessor(byte *_CellPtr) { CellPtr = _CellPtr; neighbors_Accessor_Field = new longList(null, (ptr, ptr_offset, delta) => { int substructure_offset = (int)(ptr - this.CellPtr); this.ResizeFunction(this.CellPtr, ptr_offset + substructure_offset, delta); return(this.CellPtr + substructure_offset); }); this.CellEntryIndex = -1; }
internal unsafe Result_Accessor_ReadOnly(byte *_CellPtr, ResizeFunctionPrototype func) { CellPtr = _CellPtr; ResizeFunction = func; matchPersons_Accessor_Field = new longList(null, (ptr, ptr_offset, delta) => { int substructure_offset = (int)(ptr - this.CellPtr); this.CellPtr = this.ResizeFunction(this.CellPtr, ptr_offset + substructure_offset, delta); return(this.CellPtr + substructure_offset); }); }
internal unsafe DistanceUpdatingMessage_Accessor_ReadOnly(byte *_CellPtr, ResizeFunctionPrototype func) { CellPtr = _CellPtr; ResizeFunction = func; recipients_Accessor_Field = new longList(null, (ptr, ptr_offset, delta) => { int substructure_offset = (int)(ptr - this.CellPtr); this.CellPtr = this.ResizeFunction(this.CellPtr, ptr_offset + substructure_offset, delta); return(this.CellPtr + substructure_offset); }); }
public SSSPCell_Accessor(long cellId, byte[] buffer) { this.CellID = cellId; handle = GCHandle.Alloc(buffer, GCHandleType.Pinned); this.CellPtr = (byte *)handle.AddrOfPinnedObject().ToPointer(); neighbors_Accessor_Field = new longList(null, (ptr, ptr_offset, delta) => { int substructure_offset = (int)(ptr - this.CellPtr); this.ResizeFunction(this.CellPtr, ptr_offset + substructure_offset, delta); return(this.CellPtr + substructure_offset); }); this.CellEntryIndex = -1; }
internal unsafe NameRequest_Accessor(byte *_CellPtr, ResizeFunctionPrototype func) { CellPtr = _CellPtr; ResizeFunction = func; name_Accessor_Field = new BlobString(null, (ptr, ptr_offset, delta) => { int substructure_offset = (int)(ptr - this.CellPtr); this.CellPtr = this.ResizeFunction(this.CellPtr, ptr_offset + substructure_offset, delta); return(this.CellPtr + substructure_offset); }); neighbours_Accessor_Field = new longList(null, (ptr, ptr_offset, delta) => { int substructure_offset = (int)(ptr - this.CellPtr); this.CellPtr = this.ResizeFunction(this.CellPtr, ptr_offset + substructure_offset, delta); return(this.CellPtr + substructure_offset); }); }
internal unsafe node_Accessor(byte *_CellPtr) { CellPtr = _CellPtr; name_Accessor_Field = new BlobString(null, (ptr, ptr_offset, delta) => { int substructure_offset = (int)(ptr - this.CellPtr); this.ResizeFunction(this.CellPtr, ptr_offset + substructure_offset, delta); return(this.CellPtr + substructure_offset); }); friends_Accessor_Field = new longList(null, (ptr, ptr_offset, delta) => { int substructure_offset = (int)(ptr - this.CellPtr); this.ResizeFunction(this.CellPtr, ptr_offset + substructure_offset, delta); return(this.CellPtr + substructure_offset); }); this.CellEntryIndex = -1; }