OpenMS
Index Class Reference

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

Collaboration diagram for Index:
[legend]

Public Types

using T = uint32_t
 

Public Member Functions

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

constexpr Index ( )
constexprdefault

default C'tor; creates an invalid index

◆ Index() [2/2]

constexpr Index ( T  val)
inlineconstexpr

C'tor from T.

Member Function Documentation

◆ isInvalid()

constexpr bool isInvalid ( ) const
inlineconstexpr

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

◆ isValid()

constexpr bool isValid ( ) const
inlineconstexpr

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

◆ operator()()

constexpr T operator() ( ) const
inlineconstexpr

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

◆ operator==()

constexpr bool operator== ( const Index  other) const
inlineconstexpr

equality operator

References Index::i_.

◆ pos() [1/2]

constexpr T& pos ( )
inlineconstexpr

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

◆ pos() [2/2]

constexpr T pos ( ) const
inlineconstexpr

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

Referenced by Index::operator==().