LLVM 19.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:
Inheritance graph
[legend]

Public Types

enum class  NodeKind { ST_Leaf , ST_Internal }
 

Public Member Functions

NodeKind getKind () const
 
unsigned getStartIdx () const
 
virtual unsigned getEndIdx () const =0
 
void incrementStartIdx (unsigned Inc)
 Advance this node's StartIdx by Inc.
 
void setConcatLen (unsigned Len)
 Set the length of the string from the root to this node to Len.
 
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 33 of file SuffixTreeNode.h.

Member Enumeration Documentation

◆ NodeKind

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

Definition at line 37 of file SuffixTreeNode.h.

Constructor & Destructor Documentation

◆ SuffixTreeNode()

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

Definition at line 68 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 22 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 51 of file SuffixTreeNode.h.

◆ getStartIdx()

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

Definition at line 19 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 20 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 21 of file SuffixTreeNode.cpp.

Member Data Documentation

◆ EmptyIdx

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

Represents an undefined index in the suffix tree.

Definition at line 36 of file SuffixTreeNode.h.

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


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