Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TBtLeafNode Class Reference

Leaf node of a TBtree.

Definition at line 266 of file TBtree.h.

Public Member Functions

 TBtLeafNode (TBtInnerNode *p, const TObject *obj=nullptr, TBtree *t=nullptr)
 Constructor.
 
 ~TBtLeafNode ()
 Destructor.
 
void Add (const TObject *obj, Int_t idx) override
 Add the object OBJ to the leaf node, inserting it at location INDEX in the fItem array.
 
void Append (TObject *obj)
 Never called from anywhere where it might fill up THIS does NOT handle nofKeys.
 
void AppendFrom (TBtLeafNode *src, Int_t start, Int_t stop)
 A convenience function, does not worry about the element in the parent, simply moves elements from SRC[start] to SRC[stop] into the current array.
 
void BalanceWith (TBtLeafNode *n, Int_t idx)
 PITEM is the parent item whose key will change when keys are shifted from one LeafNode to the other.
 
void BalanceWithLeft (TBtLeafNode *l, Int_t idx)
 THIS has more than LEFTSIB; move some items from THIS to LEFTSIB.
 
void BalanceWithRight (TBtLeafNode *r, Int_t idx)
 THIS has more than RIGHTSIB; move some items from THIS to RIGHTSIB.
 
Int_t FindRank (const TObject *obj) const override
 WHAT was not in any inner node; it is either here, or it's not in the tree.
 
TBtLeafNodeFirstLeafNode () override
 Return the first node.
 
TObjectFound (const TObject *obj, TBtNode **which, Int_t *where) override
 WHAT was not in any inner node; it is either here, or it's not in the tree.
 
TObjectGetKey (Int_t idx)
 
Int_t IndexOf (const TObject *obj) const
 Returns a number in the range 0 to MaxIndex().
 
Int_t IsAlmostFull () const
 
Int_t IsFull () const
 
Int_t IsLow () const
 
TBtLeafNodeLastLeafNode () override
 return the last node.
 
Int_t MaxIndex () const
 
Int_t MaxPsize () const
 
void MergeWithRight (TBtLeafNode *r, Int_t idx)
 Merge.
 
Int_t NofKeys () const override
 Return the number of keys.
 
Int_t NofKeys (Int_t i) const
 Return the number of keys.
 
TObjectoperator[] (Int_t i) const override
 
Int_t Psize () const
 
void PushLeft (Int_t cnt, TBtLeafNode *l, Int_t parentIndex)
 noFromThis==1 => moves the parent item into the leftsib, and the first item in this's array into the parent item.
 
void PushRight (Int_t cnt, TBtLeafNode *r, Int_t parentIndex)
 noFromThis==1 => moves the parent item into the rightsib, and the last item in this's array into the parent item.
 
void Remove (Int_t idx) override
 Remove an element.
 
void RemoveItem (Int_t idx)
 
void SetKey (Int_t idx, TObject *obj)
 
void ShiftLeft (Int_t cnt)
 Shift.
 
void Split () override
 This function is called only when THIS is the only descendent of the root node, and THIS needs to be split.
 
void SplitWith (TBtLeafNode *r, Int_t idx)
 Split.
 
Int_t Vsize () const
 
- Public Member Functions inherited from TBtNode
 TBtNode (Int_t isleaf, TBtInnerNode *p, TBtree *t=nullptr)
 Create a B-tree node.
 
virtual ~TBtNode ()
 Delete a B-tree node.
 
virtual TBtreeGetParentTree () const
 

Private Attributes

TObject ** fItem
 

Friends

class TBtInnerNode
 

Additional Inherited Members

- Protected Attributes inherited from TBtNode
Int_t fIsLeaf
 
Int_t fLast
 
TBtInnerNodefParent
 
TBtreefTree
 

#include <TBtree.h>

Inheritance diagram for TBtLeafNode:
[legend]

Constructor & Destructor Documentation

◆ TBtLeafNode()

TBtLeafNode::TBtLeafNode ( TBtInnerNode p,
const TObject obj = nullptr,
TBtree t = nullptr 
)

Constructor.

Definition at line 1363 of file TBtree.cxx.

◆ ~TBtLeafNode()

TBtLeafNode::~TBtLeafNode ( )

Destructor.

Definition at line 1376 of file TBtree.cxx.

Member Function Documentation

◆ Add()

void TBtLeafNode::Add ( const TObject obj,
Int_t  idx 
)
overridevirtual

Add the object OBJ to the leaf node, inserting it at location INDEX in the fItem array.

Implements TBtNode.

Definition at line 1385 of file TBtree.cxx.

◆ Append()

void TBtLeafNode::Append ( TObject obj)

Never called from anywhere where it might fill up THIS does NOT handle nofKeys.

Definition at line 1442 of file TBtree.cxx.

◆ AppendFrom()

void TBtLeafNode::AppendFrom ( TBtLeafNode src,
Int_t  start,
Int_t  stop 
)

A convenience function, does not worry about the element in the parent, simply moves elements from SRC[start] to SRC[stop] into the current array.

This should never create a full node. That is, it is not used anywhere where THIS could possibly be near full. Does NOT handle nofKeys.

Definition at line 1426 of file TBtree.cxx.

◆ BalanceWith()

void TBtLeafNode::BalanceWith ( TBtLeafNode n,
Int_t  idx 
)

PITEM is the parent item whose key will change when keys are shifted from one LeafNode to the other.

Definition at line 1475 of file TBtree.cxx.

◆ BalanceWithLeft()

void TBtLeafNode::BalanceWithLeft ( TBtLeafNode l,
Int_t  idx 
)

THIS has more than LEFTSIB; move some items from THIS to LEFTSIB.

Definition at line 1452 of file TBtree.cxx.

◆ BalanceWithRight()

void TBtLeafNode::BalanceWithRight ( TBtLeafNode r,
Int_t  idx 
)

THIS has more than RIGHTSIB; move some items from THIS to RIGHTSIB.

Definition at line 1463 of file TBtree.cxx.

◆ FindRank()

Int_t TBtLeafNode::FindRank ( const TObject obj) const
overridevirtual

WHAT was not in any inner node; it is either here, or it's not in the tree.

Implements TBtNode.

Definition at line 1487 of file TBtree.cxx.

◆ FirstLeafNode()

TBtLeafNode * TBtLeafNode::FirstLeafNode ( )
overridevirtual

Return the first node.

Implements TBtNode.

Definition at line 1501 of file TBtree.cxx.

◆ Found()

TObject * TBtLeafNode::Found ( const TObject obj,
TBtNode **  which,
Int_t where 
)
overridevirtual

WHAT was not in any inner node; it is either here, or it's not in the tree.

Implements TBtNode.

Definition at line 1510 of file TBtree.cxx.

◆ GetKey()

TObject * TBtLeafNode::GetKey ( Int_t  idx)
inline

Definition at line 287 of file TBtree.h.

◆ IndexOf()

Int_t TBtLeafNode::IndexOf ( const TObject obj) const

Returns a number in the range 0 to MaxIndex().

Definition at line 1533 of file TBtree.cxx.

◆ IsAlmostFull()

Int_t TBtLeafNode::IsAlmostFull ( ) const
inline

Definition at line 315 of file TBtree.h.

◆ IsFull()

Int_t TBtLeafNode::IsFull ( ) const
inline

Definition at line 314 of file TBtree.h.

◆ IsLow()

Int_t TBtLeafNode::IsLow ( ) const
inline

Definition at line 316 of file TBtree.h.

◆ LastLeafNode()

TBtLeafNode * TBtLeafNode::LastLeafNode ( )
overridevirtual

return the last node.

Implements TBtNode.

Definition at line 1546 of file TBtree.cxx.

◆ MaxIndex()

Int_t TBtLeafNode::MaxIndex ( ) const
inline

Definition at line 309 of file TBtree.h.

◆ MaxPsize()

Int_t TBtLeafNode::MaxPsize ( ) const
inline

Definition at line 310 of file TBtree.h.

◆ MergeWithRight()

void TBtLeafNode::MergeWithRight ( TBtLeafNode r,
Int_t  idx 
)

Merge.

Definition at line 1554 of file TBtree.cxx.

◆ NofKeys() [1/2]

Int_t TBtLeafNode::NofKeys ( ) const
overridevirtual

Return the number of keys.

Implements TBtNode.

Definition at line 1575 of file TBtree.cxx.

◆ NofKeys() [2/2]

Int_t TBtLeafNode::NofKeys ( Int_t  i) const

Return the number of keys.

Definition at line 1567 of file TBtree.cxx.

◆ operator[]()

TObject * TBtLeafNode::operator[] ( Int_t  i) const
inlineoverridevirtual

Implements TBtNode.

Definition at line 421 of file TBtree.h.

◆ Psize()

Int_t TBtLeafNode::Psize ( ) const
inline

Definition at line 307 of file TBtree.h.

◆ PushLeft()

void TBtLeafNode::PushLeft ( Int_t  cnt,
TBtLeafNode l,
Int_t  parentIndex 
)

noFromThis==1 => moves the parent item into the leftsib, and the first item in this's array into the parent item.

Definition at line 1593 of file TBtree.cxx.

◆ PushRight()

void TBtLeafNode::PushRight ( Int_t  cnt,
TBtLeafNode r,
Int_t  parentIndex 
)

noFromThis==1 => moves the parent item into the rightsib, and the last item in this's array into the parent item.

Definition at line 1612 of file TBtree.cxx.

◆ Remove()

void TBtLeafNode::Remove ( Int_t  idx)
overridevirtual

Remove an element.

Implements TBtNode.

Definition at line 1656 of file TBtree.cxx.

◆ RemoveItem()

void TBtLeafNode::RemoveItem ( Int_t  idx)
inline

Definition at line 279 of file TBtree.h.

◆ SetKey()

void TBtLeafNode::SetKey ( Int_t  idx,
TObject obj 
)
inline

Definition at line 288 of file TBtree.h.

◆ ShiftLeft()

void TBtLeafNode::ShiftLeft ( Int_t  cnt)

Shift.

Definition at line 1679 of file TBtree.cxx.

◆ Split()

void TBtLeafNode::Split ( )
overridevirtual

This function is called only when THIS is the only descendent of the root node, and THIS needs to be split.

Assumes that idx of THIS in Parent is 0.

Implements TBtNode.

Definition at line 1693 of file TBtree.cxx.

◆ SplitWith()

void TBtLeafNode::SplitWith ( TBtLeafNode r,
Int_t  idx 
)

Split.

Definition at line 1706 of file TBtree.cxx.

◆ Vsize()

Int_t TBtLeafNode::Vsize ( ) const
inline

Definition at line 427 of file TBtree.h.

Friends And Related Symbol Documentation

◆ TBtInnerNode

friend class TBtInnerNode
friend

Definition at line 268 of file TBtree.h.

Member Data Documentation

◆ fItem

TObject** TBtLeafNode::fItem
private

Definition at line 271 of file TBtree.h.

Libraries for TBtLeafNode:

The documentation for this class was generated from the following files: