C# Класс DBreeze.DataStructures.DataAsTree

Ierarchical DataStructure. Any node can have subnodes and own binary content
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
NodeContent byte[]
NodeId long
NodeName string
ParentNodeId long

Защищенные свойства (Protected)

Свойство Тип Описание
ContentRef byte[]
DBreezeTableName string
RootNode DataAsTree
Transaction DBreeze.Transactions.Transaction
maximalInsertSpeed bool
nt2Read DBreeze.DataTypes.NestedTable
nt2Write DBreeze.DataTypes.NestedTable
nt3Read DBreeze.DataTypes.NestedTable
nt3Write DBreeze.DataTypes.NestedTable

Открытые методы

Метод Описание
AddNode ( DataAsTree node ) : DataAsTree

Adding children to the node

Table, storing data structure, must be in tran.SynchronizeTables list. Then transaction must be Committed in the end by the programmer.

AddNodes ( IEnumerable nodes ) : void

Adding children to the node

Table, storing data structure, must be in tran.SynchronizeTables list. Then transaction must be Committed in the end by the programmer.

CheckTransaction ( ) : void

Internal

CopyInternals ( DataAsTree node ) : void

Internal

DataAsTree ( string DBreezeTableName, DBreeze tran, bool maximalInsertSpeed = false ) : System

Initializing Root Node

DataAsTree ( string name, byte content = null ) : System

Init nodes for insert under another node

GetChildren ( ) : IEnumerable

Reading all children nodes

GetContent ( ) : byte[]

GetContent of a node,

GetFirstLevelChildrenNodesByParentId ( long parentId ) : IEnumerable

Returns first level nodes by their parent. To go depper, for every returned node can be used ReadOutAllChildrenNodesFromCurrentRecursively

GetNodeByParentIdAndNodeId ( long parentNodeId, long nodeId ) : DataAsTree

Returns node by ParentIdAndNodeId

GetNodesByName ( string nameStartsWithPart ) : IEnumerable

Returns nodes with suppled StartsWith name or complete name

ReadOutAllChildrenNodesFromCurrentRecursively ( ) : IEnumerable

Recursively reads out all children nodes starting from this recursiverly

RemoveNode ( DataAsTree node ) : void

Removes node

RemoveNode ( long parentNodeId, long nodeId ) : void

Removes node

RemoveOldNodeFromNameIndex ( string oldNodeName, byte keyToRemove ) : void

Internal

SetupReadTables ( ) : void

Internal

SetupWriteTables ( ) : void

Internal

Защищенные методы

Метод Описание
DataAsTree ( ) : System

Internal

Приватные методы

Метод Описание
ReadOutNodes ( DataAsTree node ) : IEnumerable
SetupNodeFromRow ( byte[]>.DBreeze row ) : DataAsTree

Internal

SetupValueRowFromNode ( DataAsTree node, byte protocolVersion ) : byte[]

Internal

Описание методов

AddNode() публичный Метод

Adding children to the node

Table, storing data structure, must be in tran.SynchronizeTables list. Then transaction must be Committed in the end by the programmer.
public AddNode ( DataAsTree node ) : DataAsTree
node DataAsTree
Результат DataAsTree

AddNodes() публичный Метод

Adding children to the node

Table, storing data structure, must be in tran.SynchronizeTables list. Then transaction must be Committed in the end by the programmer.
public AddNodes ( IEnumerable nodes ) : void
nodes IEnumerable Nodes to add to current node
Результат void

CheckTransaction() публичный Метод

Internal
public CheckTransaction ( ) : void
Результат void

CopyInternals() публичный Метод

Internal
public CopyInternals ( DataAsTree node ) : void
node DataAsTree
Результат void

DataAsTree() защищенный Метод

Internal
protected DataAsTree ( ) : System
Результат System

DataAsTree() публичный Метод

Initializing Root Node
public DataAsTree ( string DBreezeTableName, DBreeze tran, bool maximalInsertSpeed = false ) : System
DBreezeTableName string Real table name in DBreeze, that will hold the structure, must be synchronized with other tables in transaction
tran DBreeze
maximalInsertSpeed bool will use DBreeze Technical_SetTable_OverwriteIsNotAllowed among transaction for DBreezeTableName
Результат System

DataAsTree() публичный Метод

Init nodes for insert under another node
public DataAsTree ( string name, byte content = null ) : System
name string
content byte optionaly can supply NodeContent
Результат System

GetChildren() публичный Метод

Reading all children nodes
public GetChildren ( ) : IEnumerable
Результат IEnumerable

GetContent() публичный Метод

GetContent of a node,
public GetContent ( ) : byte[]
Результат byte[]

GetFirstLevelChildrenNodesByParentId() публичный Метод

Returns first level nodes by their parent. To go depper, for every returned node can be used ReadOutAllChildrenNodesFromCurrentRecursively
public GetFirstLevelChildrenNodesByParentId ( long parentId ) : IEnumerable
parentId long
Результат IEnumerable

GetNodeByParentIdAndNodeId() публичный Метод

Returns node by ParentIdAndNodeId
public GetNodeByParentIdAndNodeId ( long parentNodeId, long nodeId ) : DataAsTree
parentNodeId long
nodeId long
Результат DataAsTree

GetNodesByName() публичный Метод

Returns nodes with suppled StartsWith name or complete name
public GetNodesByName ( string nameStartsWithPart ) : IEnumerable
nameStartsWithPart string
Результат IEnumerable

ReadOutAllChildrenNodesFromCurrentRecursively() публичный Метод

Recursively reads out all children nodes starting from this recursiverly
public ReadOutAllChildrenNodesFromCurrentRecursively ( ) : IEnumerable
Результат IEnumerable

RemoveNode() публичный Метод

Removes node
public RemoveNode ( DataAsTree node ) : void
node DataAsTree
Результат void

RemoveNode() публичный Метод

Removes node
public RemoveNode ( long parentNodeId, long nodeId ) : void
parentNodeId long
nodeId long
Результат void

RemoveOldNodeFromNameIndex() публичный Метод

Internal
public RemoveOldNodeFromNameIndex ( string oldNodeName, byte keyToRemove ) : void
oldNodeName string
keyToRemove byte
Результат void

SetupReadTables() публичный Метод

Internal
public SetupReadTables ( ) : void
Результат void

SetupWriteTables() публичный Метод

Internal
public SetupWriteTables ( ) : void
Результат void

Описание свойств

ContentRef защищенное свойство

Internal. Holds reference to DataBlock representing Content. node.GetContent must be used to read out content.
protected byte[] ContentRef
Результат byte[]

DBreezeTableName защищенное свойство

Real table name in DBreeze, that will hold the structure
protected string DBreezeTableName
Результат string

NodeContent публичное свойство

This can be filled via constructor or extra when we insert a node
public byte[] NodeContent
Результат byte[]

NodeId публичное свойство

public long NodeId
Результат long

NodeName публичное свойство

Node name
public string NodeName
Результат string

ParentNodeId публичное свойство

public long ParentNodeId
Результат long

RootNode защищенное свойство

protected DataAsTree,DBreeze.DataStructures RootNode
Результат DataAsTree

Transaction защищенное свойство

protected DBreeze.Transactions.Transaction Transaction
Результат DBreeze.Transactions.Transaction

maximalInsertSpeed защищенное свойство

protected bool maximalInsertSpeed
Результат bool

nt2Read защищенное свойство

protected DBreeze.DataTypes.NestedTable nt2Read
Результат DBreeze.DataTypes.NestedTable

nt2Write защищенное свойство

protected DBreeze.DataTypes.NestedTable nt2Write
Результат DBreeze.DataTypes.NestedTable

nt3Read защищенное свойство

protected DBreeze.DataTypes.NestedTable nt3Read
Результат DBreeze.DataTypes.NestedTable

nt3Write защищенное свойство

protected DBreeze.DataTypes.NestedTable nt3Write
Результат DBreeze.DataTypes.NestedTable