OpenTREP Logo  0.6.0
C++ Open Travel Request Parsing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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

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

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

Constructor.

Definition at line 23 of file ScoreType.cpp.

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

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.

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.

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.

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 66 of file ScoreType.cpp.

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

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

List the labels.

Definition at line 73 of file ScoreType.cpp.

References LAST_VALUE.

Referenced by ScoreType().

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().

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.

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().

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().

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().

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

Comparison operator.

Definition at line 119 of file ScoreType.cpp.

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 OPENTREP::StructAbstract::describe().

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::ScoreBoard, OPENTREP::StringPartition, OPENTREP::QuerySlices, OPENTREP::WordCombinationHolder, and OPENTREP::StringSet.

Definition at line 38 of file StructAbstract.hpp.

Referenced by operator>>().


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