OpenTREP Logo  0.07.18
C++ Open Travel Request Parsing Library
Loading...
Searching...
No Matches
OPENTREP::ScoreType Struct Reference

Enumeration of score types. More...

#include <opentrep/basic/ScoreType.hpp>

+ Inheritance diagram for OPENTREP::ScoreType:

Public Types

enum  EN_ScoreType {
  COMBINATION = 0 , XAPIAN_PCT , PAGE_RANK , PAX_NB ,
  HEURISTIC , ENV_ID , CODE_FULL_MATCH , LAST_VALUE
}
 

Public Member Functions

const std::string & getLongLabel () const
 
EN_ScoreType getType () const
 
std::string getTypeAsString () const
 
std::string describe () const
 
bool isIndividualScore () const
 
bool operator== (const EN_ScoreType &) const
 
 ScoreType (const EN_ScoreType &)
 
 ScoreType (const char iType)
 
void toStream (std::ostream &ioOut) const
 
virtual void fromStream (std::istream &ioIn)
 

Static Public Member Functions

static const std::string & getLabel (const EN_ScoreType &)
 
static char getTypeLabel (const EN_ScoreType &)
 
static std::string getTypeLabelAsString (const EN_ScoreType &)
 
static std::string describeLabels ()
 
static bool isIndividualScore (const EN_ScoreType &)
 

Detailed Description

Enumeration of score types.

Each type corresponds to a specific kind of matching:

  • Xapian full-text matching
  • Page-Rank from the schedule
  • Number of passengers registered for that airport/POR (point of reference)

Definition at line 25 of file ScoreType.hpp.

Member Enumeration Documentation

◆ EN_ScoreType

Enumerator
COMBINATION 
XAPIAN_PCT 
PAGE_RANK 
PAX_NB 
HEURISTIC 
ENV_ID 
CODE_FULL_MATCH 
LAST_VALUE 

Definition at line 27 of file ScoreType.hpp.

Constructor & Destructor Documentation

◆ ScoreType() [1/2]

OPENTREP::ScoreType::ScoreType ( const EN_ScoreType & iScoreType)

Constructor.

Definition at line 23 of file ScoreType.cpp.

Referenced by isIndividualScore().

◆ ScoreType() [2/2]

OPENTREP::ScoreType::ScoreType ( const char iType)

Constructor.

Definition at line 28 of file ScoreType.cpp.

References CODE_FULL_MATCH, COMBINATION, describeLabels(), ENV_ID, HEURISTIC, LAST_VALUE, PAGE_RANK, PAX_NB, and XAPIAN_PCT.

Member Function Documentation

◆ getLabel()

const std::string & OPENTREP::ScoreType::getLabel ( const EN_ScoreType & iType)
static

Get the label as a string (e.g., "Xapian Percentage" or "Page Rank").

Definition at line 55 of file ScoreType.cpp.

◆ getLongLabel()

const std::string & OPENTREP::ScoreType::getLongLabel ( ) const

Get the label as a string (e.g., "Xapian Percentage" or "Page Rank").

Definition at line 50 of file ScoreType.cpp.

◆ getTypeLabel()

char OPENTREP::ScoreType::getTypeLabel ( const EN_ScoreType & iType)
static

Get the label as a single char (e.g., 'X' or 'R').

Definition at line 60 of file ScoreType.cpp.

◆ getTypeLabelAsString()

std::string OPENTREP::ScoreType::getTypeLabelAsString ( const EN_ScoreType & iType)
static

Get the label as a single char (e.g., 'X' or 'R').

Definition at line 65 of file ScoreType.cpp.

Referenced by OPENTREP::ScoreBoard::describe().

◆ describeLabels()

std::string OPENTREP::ScoreType::describeLabels ( )
static

List the labels.

Definition at line 73 of file ScoreType.cpp.

References LAST_VALUE.

Referenced by ScoreType().

◆ getType()

ScoreType::EN_ScoreType OPENTREP::ScoreType::getType ( ) const

Get the enumerated value.

Definition at line 85 of file ScoreType.cpp.

Referenced by OPENTREP::ScoreBoard::getScore(), and OPENTREP::ScoreBoard::setScore().

◆ getTypeAsString()

std::string OPENTREP::ScoreType::getTypeAsString ( ) const

Get the enumerated value as a short string (e.g., 'X' or 'R').

Definition at line 90 of file ScoreType.cpp.

◆ describe()

std::string OPENTREP::ScoreType::describe ( ) const
virtual

Give a description of the structure (e.g., "Xapian Percentage" or "Page Rank").

Implements OPENTREP::StructAbstract.

Definition at line 97 of file ScoreType.cpp.

Referenced by OPENTREP::ScoreBoard::setScore().

◆ isIndividualScore() [1/2]

bool OPENTREP::ScoreType::isIndividualScore ( ) const

State whether that score type is valid and is an individual one, i.e., one that is neither COMBINATION nor LAST_VALUE.

Definition at line 104 of file ScoreType.cpp.

References COMBINATION, and LAST_VALUE.

Referenced by OPENTREP::ScoreBoard::calculateCombinedWeight(), and isIndividualScore().

◆ isIndividualScore() [2/2]

bool OPENTREP::ScoreType::isIndividualScore ( const EN_ScoreType & iTypeEnum)
static

State whether that score type is valid and is an individual one, i.e., one that is neither COMBINATION nor LAST_VALUE.

Definition at line 113 of file ScoreType.cpp.

References isIndividualScore(), and ScoreType().

◆ operator==()

bool OPENTREP::ScoreType::operator== ( const EN_ScoreType & iType) const

Comparison operator.

Definition at line 119 of file ScoreType.cpp.

◆ toStream()

void OPENTREP::StructAbstract::toStream ( std::ostream & ioOut) const
inlineinherited

Dump a Business Object into an output stream.

Parameters
ostream&the output stream.

Definition at line 29 of file StructAbstract.hpp.

References describe().

◆ fromStream()

virtual void OPENTREP::StructAbstract::fromStream ( std::istream & ioIn)
inlinevirtualinherited

Read a Business Object from an input stream.

Parameters
istream&the input stream.

Reimplemented in OPENTREP::QuerySlices, OPENTREP::ScoreBoard, OPENTREP::StringPartition, OPENTREP::StringSet, and OPENTREP::WordCombinationHolder.

Definition at line 38 of file StructAbstract.hpp.

Referenced by operator>>().


The documentation for this struct was generated from the following files: