Match< Int > Class Reference

#include <algorithms.h>

Detailed Description

Match specialization for index position type.

Public Member Functions

 Match ()=default
 
 Match (const Match &)=default
 
Matchoperator= (Match &)=default
 
MAXON_IMPLICIT Match (NO_MATCH_TYPE)
 
Matchoperator= (NO_MATCH_TYPE)
 
MAXON_IMPLICIT Match (Int index)
 
 Match (Int index, Int length)
 
Int GetPosition () const
 
 operator Int () const
 
Int GetLength () const
 
Bool IsFound () const
 
 operator Bool () const
 

Private Attributes

Int _index
 
Int _length
 

Constructor & Destructor Documentation

◆ Match() [1/5]

Match ( )
default

Constructs a match that is NO_MATCH.

◆ Match() [2/5]

Match ( const Match< Int > &  )
default

Copy constructor.

◆ Match() [3/5]

Implicit construction from NO_MATCH.

◆ Match() [4/5]

MAXON_IMPLICIT Match ( Int  index)

Construction from a index position with a default length of 1.

◆ Match() [5/5]

Match ( Int  index,
Int  length 
)

Construction from a index position and length.

Member Function Documentation

◆ operator=() [1/2]

Match& operator= ( Match< Int > &  )
default

Copy assignment.

◆ operator=() [2/2]

Match& operator= ( NO_MATCH_TYPE  )

Assignment of NO_MATCH.

◆ GetPosition()

Int GetPosition ( ) const

Returns the first position of the match.

◆ operator Int()

operator Int ( ) const

Returns the first position of the match.

◆ GetLength()

Int GetLength ( ) const

Implicit to index type Int. Equivalent to GetPosition().

◆ IsFound()

Bool IsFound ( ) const

Returns, if this match represents a valid position, or if it is a NO_MATCH.

◆ operator Bool()

operator Bool ( ) const
explicit

Conversion to Bool in conditional expressions (i.e. if statements). Equivalent to IsFound().

Member Data Documentation

◆ _index

Int _index
private

◆ _length

Int _length
private