/// <inheritdoc/> public unsafe ICellAccessor UseGenericCell(Trinity.Storage.LocalMemoryStorage storage, long cellId, CellAccessOptions options, string cellType) { switch (cellType) { case "TripleStore": return(TripleStore_Accessor._get()._Lock(cellId, options)); default: Throw.invalid_cell_type(); return(null); } }
public unsafe ICellAccessor UseGenericCell(long cellId, byte *cellBuffer, int entryIndex, ushort cellType, CellAccessOptions options) { switch ((CellType)cellType) { case CellType.TripleStore: return(TripleStore_Accessor._get()._Setup(cellId, cellBuffer, entryIndex, options)); default: throw new CellTypeNotMatchException("Cannot determine cell type."); } }
/// <inheritdoc/> public unsafe ICellAccessor UseGenericCell(Trinity.Storage.LocalMemoryStorage storage, long cellId) { ushort type; int size; byte * cellPtr; int entryIndex; var err = storage.GetLockedCellInfo(cellId, out size, out type, out cellPtr, out entryIndex); if (err != TrinityErrorCode.E_SUCCESS) { throw new CellNotFoundException("Cannot access the cell."); } switch ((CellType)type) { case CellType.TripleStore: return(TripleStore_Accessor._get()._Setup(cellId, cellPtr, entryIndex, CellAccessOptions.ThrowExceptionOnCellNotFound)); default: storage.ReleaseCellLock(cellId, entryIndex); throw new CellTypeNotMatchException("Cannot determine cell type."); } }