LLVM 22.0.0git
Public Types | Public Member Functions | Static Public Attributes | List of all members
llvm::SuffixTreeNode Struct Referenceabstract

A node in a suffix tree which represents a substring or suffix. More...

#include "llvm/Support/SuffixTreeNode.h"

Inheritance diagram for llvm::SuffixTreeNode:
[legend]

Public Types

enum class  NodeKind { ST_Leaf , ST_Internal }
 

Public Member Functions

NodeKind getKind () const
 
LLVM_ABI unsigned getStartIdx () const
 
virtual unsigned getEndIdx () const =0
 
LLVM_ABI unsigned getLeftLeafIdx () const
 
LLVM_ABI unsigned getRightLeafIdx () const
 
LLVM_ABI void setLeftLeafIdx (unsigned Idx)
 Set the index of the left most leaf node of this node to Idx.
 
LLVM_ABI void setRightLeafIdx (unsigned Idx)
 Set the index of the right most leaf node of this node to Idx.
 
LLVM_ABI void incrementStartIdx (unsigned Inc)
 Advance this node's StartIdx by Inc.
 
LLVM_ABI void setConcatLen (unsigned Len)
 Set the length of the string from the root to this node to Len.
 
LLVM_ABI unsigned getConcatLen () const
 
 SuffixTreeNode (NodeKind Kind, unsigned StartIdx)
 
virtual ~SuffixTreeNode ()=default
 

Static Public Attributes

static const unsigned EmptyIdx = -1
 Represents an undefined index in the suffix tree.
 

Detailed Description

A node in a suffix tree which represents a substring or suffix.

Definition at line 34 of file SuffixTreeNode.h.

Member Enumeration Documentation

◆ NodeKind

enum class llvm::SuffixTreeNode::NodeKind
strong
Enumerator
ST_Leaf 
ST_Internal 

Definition at line 38 of file SuffixTreeNode.h.

Constructor & Destructor Documentation

◆ SuffixTreeNode()

llvm::SuffixTreeNode::SuffixTreeNode ( NodeKind  Kind,
unsigned  StartIdx 
)
inline

Definition at line 92 of file SuffixTreeNode.h.

◆ ~SuffixTreeNode()

virtual llvm::SuffixTreeNode::~SuffixTreeNode ( )
virtualdefault

Member Function Documentation

◆ getConcatLen()

unsigned SuffixTreeNode::getConcatLen ( ) const
Returns
the length of the string from the root to this node.

Definition at line 21 of file SuffixTreeNode.cpp.

◆ getEndIdx()

virtual unsigned llvm::SuffixTreeNode::getEndIdx ( ) const
pure virtual
Returns
the end index of this node.

Implemented in llvm::SuffixTreeInternalNode, and llvm::SuffixTreeLeafNode.

◆ getKind()

NodeKind llvm::SuffixTreeNode::getKind ( ) const
inline

Definition at line 63 of file SuffixTreeNode.h.

◆ getLeftLeafIdx()

unsigned SuffixTreeNode::getLeftLeafIdx ( ) const
Returns
the index of this node's left most leaf node.

Definition at line 41 of file SuffixTreeNode.cpp.

◆ getRightLeafIdx()

unsigned SuffixTreeNode::getRightLeafIdx ( ) const
Returns
the index of this node's right most leaf node.

Definition at line 42 of file SuffixTreeNode.cpp.

◆ getStartIdx()

unsigned SuffixTreeNode::getStartIdx ( ) const
Returns
the start index of this node's substring in the entire string.

Definition at line 18 of file SuffixTreeNode.cpp.

Referenced by llvm::SuffixTreeInternalNode::isRoot().

◆ incrementStartIdx()

void SuffixTreeNode::incrementStartIdx ( unsigned  Inc)

Advance this node's StartIdx by Inc.

Definition at line 19 of file SuffixTreeNode.cpp.

◆ setConcatLen()

void SuffixTreeNode::setConcatLen ( unsigned  Len)

Set the length of the string from the root to this node to Len.

Definition at line 20 of file SuffixTreeNode.cpp.

◆ setLeftLeafIdx()

void SuffixTreeNode::setLeftLeafIdx ( unsigned  Idx)

Set the index of the left most leaf node of this node to Idx.

Definition at line 43 of file SuffixTreeNode.cpp.

References Idx.

◆ setRightLeafIdx()

void SuffixTreeNode::setRightLeafIdx ( unsigned  Idx)

Set the index of the right most leaf node of this node to Idx.

Definition at line 44 of file SuffixTreeNode.cpp.

References Idx.

Member Data Documentation

◆ EmptyIdx

const unsigned llvm::SuffixTreeNode::EmptyIdx = -1
static

Represents an undefined index in the suffix tree.

Definition at line 37 of file SuffixTreeNode.h.

Referenced by llvm::SuffixTreeInternalNode::isRoot().


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