Esempio n. 1
0
        /// <inheritdoc/>
        public unsafe ICellAccessor UseGenericCell(Trinity.Storage.LocalMemoryStorage storage, long cellId, CellAccessOptions options, string cellType)
        {
            switch (cellType)
            {
            case "Graph": return(Graph_Accessor._get()._Lock(cellId, options));

            default:
                Throw.invalid_cell_type();
                return(null);
            }
        }
Esempio n. 2
0
        public unsafe ICellAccessor UseGenericCell(long cellId, byte *cellBuffer, int entryIndex, ushort cellType, CellAccessOptions options)
        {
            switch ((CellType)cellType)
            {
            case CellType.Graph:
                return(Graph_Accessor._get()._Setup(cellId, cellBuffer, entryIndex, options));

            default:
                throw new CellTypeNotMatchException("Cannot determine cell type.");
            }
        }
Esempio n. 3
0
        /// <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.Graph:
                return(Graph_Accessor._get()._Setup(cellId, cellPtr, entryIndex, CellAccessOptions.ThrowExceptionOnCellNotFound));

            default:
                storage.ReleaseCellLock(cellId, entryIndex);
                throw new CellTypeNotMatchException("Cannot determine cell type.");
            }
        }