Match< ITERATOR > Class Template Reference

#include <algorithms.h>

Detailed Description

template<typename ITERATOR>
class maxon::Match< ITERATOR >

A Match represents a part of a sequence, consisting of start position and length. Depending on the operation, the position type may be either an iterator or an index.

Public Member Functions

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

Private Attributes

ITERATOR _position
 
Int _length
 

Constructor & Destructor Documentation

◆ Match() [1/6]

Match ( )
default

Constructs a match that is NO_MATCH.

◆ Match() [2/6]

Match ( const Match< ITERATOR > &  )
default

Copy constructor.

◆ Match() [3/6]

Match ( Match< ITERATOR > &&  src)

Move constructor.

◆ Match() [4/6]

Implicit construction from NO_MATCH.

◆ Match() [5/6]

MAXON_IMPLICIT Match ( ITERATOR  position)

Construction from a position with a default length of 1.

◆ Match() [6/6]

Match ( ITERATOR  position,
Int  length 
)

Construction from a position and length.

Member Function Documentation

◆ operator=() [1/3]

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

Copy assignment.

◆ operator=() [2/3]

Match& operator= ( Match< ITERATOR > &&  src)

Move assignment.

◆ operator=() [3/3]

Match& operator= ( NO_MATCH_TYPE  )

Assignment of NO_MATCH.

◆ GetPosition()

ITERATOR GetPosition ( ) const

Returns the first position of the match.

◆ operator ITERATOR()

operator ITERATOR ( ) const

Implicit conversion to position type. Equivalent to GetPosition().

◆ GetLength()

Int GetLength ( ) const

Returns the length of the match.

◆ 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

◆ _position

ITERATOR _position
private

◆ _length

Int _length
private