C# Class DBreeze.DataStructures.DataAsTree

Ierarchical DataStructure. Any node can have subnodes and own binary content
Afficher le fichier Open project: hhblaze/DBreeze Class Usage Examples

Méthodes publiques

Свойство Type Description
NodeContent byte[]
NodeId long
NodeName string
ParentNodeId long

Protected Properties

Свойство Type Description
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

Méthodes publiques

Méthode Description
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

Méthodes protégées

Méthode Description
DataAsTree ( ) : System

Internal

Private Methods

Méthode Description
ReadOutNodes ( DataAsTree node ) : IEnumerable
SetupNodeFromRow ( byte[]>.DBreeze row ) : DataAsTree

Internal

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

Internal

Method Details

AddNode() public méthode

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
Résultat DataAsTree

AddNodes() public méthode

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
Résultat void

CheckTransaction() public méthode

Internal
public CheckTransaction ( ) : void
Résultat void

CopyInternals() public méthode

Internal
public CopyInternals ( DataAsTree node ) : void
node DataAsTree
Résultat void

DataAsTree() protected méthode

Internal
protected DataAsTree ( ) : System
Résultat System

DataAsTree() public méthode

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
Résultat System

DataAsTree() public méthode

Init nodes for insert under another node
public DataAsTree ( string name, byte content = null ) : System
name string
content byte optionaly can supply NodeContent
Résultat System

GetChildren() public méthode

Reading all children nodes
public GetChildren ( ) : IEnumerable
Résultat IEnumerable

GetContent() public méthode

GetContent of a node,
public GetContent ( ) : byte[]
Résultat byte[]

GetFirstLevelChildrenNodesByParentId() public méthode

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
Résultat IEnumerable

GetNodeByParentIdAndNodeId() public méthode

Returns node by ParentIdAndNodeId
public GetNodeByParentIdAndNodeId ( long parentNodeId, long nodeId ) : DataAsTree
parentNodeId long
nodeId long
Résultat DataAsTree

GetNodesByName() public méthode

Returns nodes with suppled StartsWith name or complete name
public GetNodesByName ( string nameStartsWithPart ) : IEnumerable
nameStartsWithPart string
Résultat IEnumerable

ReadOutAllChildrenNodesFromCurrentRecursively() public méthode

Recursively reads out all children nodes starting from this recursiverly
public ReadOutAllChildrenNodesFromCurrentRecursively ( ) : IEnumerable
Résultat IEnumerable

RemoveNode() public méthode

Removes node
public RemoveNode ( DataAsTree node ) : void
node DataAsTree
Résultat void

RemoveNode() public méthode

Removes node
public RemoveNode ( long parentNodeId, long nodeId ) : void
parentNodeId long
nodeId long
Résultat void

RemoveOldNodeFromNameIndex() public méthode

Internal
public RemoveOldNodeFromNameIndex ( string oldNodeName, byte keyToRemove ) : void
oldNodeName string
keyToRemove byte
Résultat void

SetupReadTables() public méthode

Internal
public SetupReadTables ( ) : void
Résultat void

SetupWriteTables() public méthode

Internal
public SetupWriteTables ( ) : void
Résultat void

Property Details

ContentRef protected_oe property

Internal. Holds reference to DataBlock representing Content. node.GetContent must be used to read out content.
protected byte[] ContentRef
Résultat byte[]

DBreezeTableName protected_oe property

Real table name in DBreeze, that will hold the structure
protected string DBreezeTableName
Résultat string

NodeContent public_oe property

This can be filled via constructor or extra when we insert a node
public byte[] NodeContent
Résultat byte[]

NodeId public_oe property

public long NodeId
Résultat long

NodeName public_oe property

Node name
public string NodeName
Résultat string

ParentNodeId public_oe property

public long ParentNodeId
Résultat long

RootNode protected_oe property

protected DataAsTree,DBreeze.DataStructures RootNode
Résultat DataAsTree

Transaction protected_oe property

protected DBreeze.Transactions.Transaction Transaction
Résultat DBreeze.Transactions.Transaction

maximalInsertSpeed protected_oe property

protected bool maximalInsertSpeed
Résultat bool

nt2Read protected_oe property

protected DBreeze.DataTypes.NestedTable nt2Read
Résultat DBreeze.DataTypes.NestedTable

nt2Write protected_oe property

protected DBreeze.DataTypes.NestedTable nt2Write
Résultat DBreeze.DataTypes.NestedTable

nt3Read protected_oe property

protected DBreeze.DataTypes.NestedTable nt3Read
Résultat DBreeze.DataTypes.NestedTable

nt3Write protected_oe property

protected DBreeze.DataTypes.NestedTable nt3Write
Résultat DBreeze.DataTypes.NestedTable