OpenMS  2.8.0
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
ACNode Struct Reference

#include <OpenMS/ANALYSIS/ID/AhoCorasickAmbiguous.h>

Collaboration diagram for ACNode:
[legend]

Classes

struct  DepthHits
 internal struct to steal one bit from depth to use as hit indicator More...
 

Public Types

using ChildCountType = uint8_t
 

Public Member Functions

 ACNode ()
 Default C'tor. More...
 
 ACNode (const AA label, const uint8_t depth)
 C'tor from an edge label (from parent to this node) and a depth in the tree. More...
 

Public Attributes

Index suffix {0}
 which node is our suffix? More...
 
Index first_child {0}
 which node contains our first child node (if tree is in BFS order) More...
 
AA edge {0}
 what is the edge label (from parent to this node) More...
 
ChildCountType nr_children = 0
 number of children (if tree is in BFS order); // we could also go with a bitfield of size 22, but that would cost extra 3 bytes per node More...
 
DepthHits depth_and_hits
 depth of node in the tree and one bit if a needle ends in this node or any of its suffices More...
 

Detailed Description

A node in the AhoCorasick trie. Internally manages the suffix link and an index where its children start (this relies on the trie being stored in BFS order)

Member Typedef Documentation

◆ ChildCountType

using ChildCountType = uint8_t

Constructor & Destructor Documentation

◆ ACNode() [1/2]

ACNode ( )
inline

Default C'tor.

◆ ACNode() [2/2]

ACNode ( const AA  label,
const uint8_t  depth 
)
inline

C'tor from an edge label (from parent to this node) and a depth in the tree.

Member Data Documentation

◆ depth_and_hits

DepthHits depth_and_hits

depth of node in the tree and one bit if a needle ends in this node or any of its suffices

◆ edge

AA edge {0}

what is the edge label (from parent to this node)

◆ first_child

Index first_child {0}

which node contains our first child node (if tree is in BFS order)

◆ nr_children

ChildCountType nr_children = 0

number of children (if tree is in BFS order); // we could also go with a bitfield of size 22, but that would cost extra 3 bytes per node

◆ suffix

Index suffix {0}

which node is our suffix?