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, CellAccessOptions options, string cellType) { switch (cellType) { case "TripleStore": return(TripleStore_Accessor._get()._Lock(cellId, options)); default: Throw.invalid_cell_type(); return(null); } }
/// <inheritdoc/> public IEnumerable <ICellAccessor> EnumerateGenericCellAccessors(LocalMemoryStorage storage) { foreach (var cellInfo in Global.LocalStorage) { switch ((CellType)cellInfo.CellType) { case CellType.TripleStore: { var TripleStore_accessor = TripleStore_Accessor.AllocIterativeAccessor(cellInfo, null); yield return(TripleStore_accessor); TripleStore_accessor.Dispose(); break; } default: continue; } } yield break; }
/// <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."); } }
public IEnumerator <TripleStore> GetEnumerator() { if (m_filter_set == null) { if (m_filter_predicate == null) { foreach (var cellInfo in m_storage) { if (cellInfo.CellType == (ushort)CellType.TripleStore) { var accessor = TripleStore_Accessor.AllocIterativeAccessor(cellInfo, m_tx); yield return(accessor); accessor.Dispose(); } } } else { foreach (var cellInfo in m_storage) { if (cellInfo.CellType == (ushort)CellType.TripleStore) { var accessor = TripleStore_Accessor.AllocIterativeAccessor(cellInfo, m_tx); if (m_filter_predicate(accessor)) { yield return(accessor); } accessor.Dispose(); } } } } else if (m_is_positive_filtering) { if (m_filter_predicate == null) { foreach (var cellID in m_filter_set) { using (var accessor = m_storage.UseTripleStore(cellID)) { yield return(accessor); } } } else { foreach (var cellID in m_filter_set) { using (var accessor = m_storage.UseTripleStore(cellID)) { if (m_filter_predicate(accessor)) { yield return(accessor); } } } } } else { throw new NotImplementedException("Negative filtering not supported."); } }