OpenMS
Index Class Reference

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

Collaboration diagram for Index:
[legend]

Public Types

using T = uint32_t
 

Public Member Functions

 Index ()=default
 default C'tor; creates an invalid index More...
 
 Index (T val)
 C'tor from T. More...
 
bool isInvalid () const
 is this Index invalid, i.e. should not be dereferenced More...
 
bool isValid () const
 is this Index valid, i.e. an actual index into a vector? More...
 
T operator() () const
 convert to a number (might be invalid, check with .isValid() first) More...
 
bool operator== (const Index other) const
 equality operator More...
 
Tpos ()
 allows to set the index, using `index.pos() = 3;` or simply read its value More...
 
T pos () const
 allows to read the index, using `index.pos()` More...
 

Private Attributes

T i_ = std::numeric_limits<T>::max()
 internal number representation; invalid state by default More...
 

Detailed Description

An index with 32-bit representing the location of a node Allows to model invalid indices, see isInvalid() and isValid().

Member Typedef Documentation

◆ T

using T = uint32_t

Constructor & Destructor Documentation

◆ Index() [1/2]

Index ( )
default

default C'tor; creates an invalid index

◆ Index() [2/2]

Index ( T  val)
inline

C'tor from T.

Member Function Documentation

◆ isInvalid()

bool isInvalid ( ) const

is this Index invalid, i.e. should not be dereferenced

◆ isValid()

bool isValid ( ) const

is this Index valid, i.e. an actual index into a vector?

◆ operator()()

T operator() ( ) const

convert to a number (might be invalid, check with .isValid() first)

◆ operator==()

bool operator== ( const Index  other) const

equality operator

◆ pos() [1/2]

T& pos ( )

allows to set the index, using `index.pos() = 3;` or simply read its value

◆ pos() [2/2]

T pos ( ) const

allows to read the index, using `index.pos()`

Member Data Documentation

◆ i_

T i_ = std::numeric_limits<T>::max()
private

internal number representation; invalid state by default