OpenMS
ACTrieState Struct Reference

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

Collaboration diagram for ACTrieState:
[legend]

Public Member Functions

void setQuery (const std::string &haystack)
 
size_t textPos () const
 Where in the text are we currently? More...
 
std::string::const_iterator textPosIt () const
 Where in the text are we currently? More...
 
const std::string & getQuery () const
 The current query. More...
 
AA nextValidAA ()
 

Public Attributes

friend ACSpawn
 
std::vector< Hithits
 current hits found More...
 
Index tree_pos
 position in trie (for the master) More...
 
std::queue< ACSpawnspawns
 initial spawn points which are currently active and need processing More...
 

Private Attributes

std::string query_
 current query ( = haystack = text) More...
 
std::string::const_iterator it_q_
 position in query More...
 

Detailed Description

A state object for an ACTrie, i.e. dynamic information when traversing the trie (which is 'const' after construction) Useful when using multi-threading; each thread can walk the trie and keep track of its state using an instance of this class

Member Function Documentation

◆ getQuery()

const std::string& getQuery ( ) const

The current query.

◆ nextValidAA()

AA nextValidAA ( )

Return the next valid AA in the query. If the query was fully traversed, an invalid AA is returned. This moves the internal iterator for the query forwards.

◆ setQuery()

void setQuery ( const std::string &  haystack)

Set a haystack (query) where the needles (patterns) are to be searched This also resets the current trie-node to ROOT, and voids the hits

◆ textPos()

size_t textPos ( ) const

Where in the text are we currently?

◆ textPosIt()

std::string::const_iterator textPosIt ( ) const

Where in the text are we currently?

Member Data Documentation

◆ ACSpawn

friend ACSpawn

◆ hits

std::vector<Hit> hits

current hits found

◆ it_q_

std::string::const_iterator it_q_
private

position in query

◆ query_

std::string query_
private

current query ( = haystack = text)

◆ spawns

std::queue<ACSpawn> spawns

initial spawn points which are currently active and need processing

◆ tree_pos

Index tree_pos

position in trie (for the master)