Albert
Loading...
Searching...
No Matches
albert::Match Class Referencefinal

#include <albert/matcher.h>

Detailed Description

Augmented match score.

Some nifty features:

  • The bool type conversion evaluates to isMatch()
  • The Score/double type conversion seamlessly uses the score()
See also
Matcher

Public Types

using Score = double
 

Public Member Functions

 Match ()
 Constructs an invalid match.
 
 Match (const Score score)
 Constructs a match with the given score.
 
 Match (const Match &o)=default
 Constructs a Match with the score of other.
 
Matchoperator= (const Match &o)=default
 Replaces the score with that of other.
 
bool isMatch () const
 Returns true if this is a match, otherwise returns false.
 
bool isEmptyMatch () const
 Returns true if this is a zero score match, otherwise returns false.
 
bool isExactMatch () const
 Returns true if this is a perfect match, otherwise returns false.
 
Score score () const
 Returns the score.
 
 operator bool () const
 Returns true if this is a match, otherwise returns false.
 
 operator Score () const
 Returns the score.
 

Member Typedef Documentation

◆ Score

using albert::Match::Score = double

Constructor & Destructor Documentation

◆ Match() [1/3]

albert::Match::Match ( )
inline

Constructs an invalid match.

◆ Match() [2/3]

albert::Match::Match ( const Score  score)
inline

Constructs a match with the given score.

◆ Match() [3/3]

albert::Match::Match ( const Match o)
default

Constructs a Match with the score of other.

Member Function Documentation

◆ isEmptyMatch()

bool albert::Match::isEmptyMatch ( ) const
inline

Returns true if this is a zero score match, otherwise returns false.

◆ isExactMatch()

bool albert::Match::isExactMatch ( ) const
inline

Returns true if this is a perfect match, otherwise returns false.

◆ isMatch()

bool albert::Match::isMatch ( ) const
inline

Returns true if this is a match, otherwise returns false.

◆ operator bool()

albert::Match::operator bool ( ) const
inline

Returns true if this is a match, otherwise returns false.

◆ operator Score()

albert::Match::operator Score ( ) const
inlineexplicit

Returns the score.

◆ operator=()

Match & albert::Match::operator= ( const Match o)
default

Replaces the score with that of other.

◆ score()

Score albert::Match::score ( ) const
inline

Returns the score.


The documentation for this class was generated from the following file: