OmniSciDB  cde582ebc3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SortField Class Reference

#include <RelAlgDag.h>

Public Member Functions

 SortField (const size_t field, const SortDirection sort_dir, const NullSortedPosition nulls_pos)
 
bool operator== (const SortField &that) const
 
size_t getField () const
 
SortDirection getSortDir () const
 
NullSortedPosition getNullsPosition () const
 
std::string toString () const
 
size_t toHash () const
 

Private Attributes

const size_t field_
 
const SortDirection sort_dir_
 
const NullSortedPosition nulls_pos_
 

Detailed Description

Definition at line 484 of file RelAlgDag.h.

Constructor & Destructor Documentation

SortField::SortField ( const size_t  field,
const SortDirection  sort_dir,
const NullSortedPosition  nulls_pos 
)
inline

Definition at line 486 of file RelAlgDag.h.

489  : field_(field), sort_dir_(sort_dir), nulls_pos_(nulls_pos) {}
const rapidjson::Value & field(const rapidjson::Value &obj, const char field[]) noexcept
Definition: JsonAccessors.h:31
const NullSortedPosition nulls_pos_
Definition: RelAlgDag.h:523
const SortDirection sort_dir_
Definition: RelAlgDag.h:522
const size_t field_
Definition: RelAlgDag.h:521

Member Function Documentation

size_t SortField::getField ( ) const
inline

Definition at line 496 of file RelAlgDag.h.

References field_.

Referenced by anonymous_namespace{RelAlgOptimizer.cpp}::renumber_sort_field().

496 { return field_; }
const size_t field_
Definition: RelAlgDag.h:521

+ Here is the caller graph for this function:

NullSortedPosition SortField::getNullsPosition ( ) const
inline

Definition at line 500 of file RelAlgDag.h.

References nulls_pos_.

Referenced by anonymous_namespace{RelAlgOptimizer.cpp}::renumber_sort_field().

500 { return nulls_pos_; }
const NullSortedPosition nulls_pos_
Definition: RelAlgDag.h:523

+ Here is the caller graph for this function:

SortDirection SortField::getSortDir ( ) const
inline

Definition at line 498 of file RelAlgDag.h.

References sort_dir_.

Referenced by anonymous_namespace{RelAlgOptimizer.cpp}::renumber_sort_field().

498 { return sort_dir_; }
const SortDirection sort_dir_
Definition: RelAlgDag.h:522

+ Here is the caller graph for this function:

bool SortField::operator== ( const SortField that) const
inline

Definition at line 491 of file RelAlgDag.h.

References field_, nulls_pos_, and sort_dir_.

491  {
492  return field_ == that.field_ && sort_dir_ == that.sort_dir_ &&
493  nulls_pos_ == that.nulls_pos_;
494  }
const NullSortedPosition nulls_pos_
Definition: RelAlgDag.h:523
const SortDirection sort_dir_
Definition: RelAlgDag.h:522
const size_t field_
Definition: RelAlgDag.h:521
size_t SortField::toHash ( ) const
inline

Definition at line 513 of file RelAlgDag.h.

References Ascending, field_, First, nulls_pos_, and sort_dir_.

513  {
514  auto hash = boost::hash_value(field_);
515  boost::hash_combine(hash, sort_dir_ == SortDirection::Ascending ? "a" : "d");
516  boost::hash_combine(hash, nulls_pos_ == NullSortedPosition::First ? "f" : "l");
517  return hash;
518  }
const NullSortedPosition nulls_pos_
Definition: RelAlgDag.h:523
const SortDirection sort_dir_
Definition: RelAlgDag.h:522
const size_t field_
Definition: RelAlgDag.h:521
std::string SortField::toString ( ) const
inline

Definition at line 502 of file RelAlgDag.h.

References Ascending, cat(), field_, First, nulls_pos_, sort_dir_, to_string(), and typeName().

502  {
503  return cat(::typeName(this),
504  "(",
506  ", sort_dir=",
507  (sort_dir_ == SortDirection::Ascending ? "asc" : "desc"),
508  ", null_pos=",
509  (nulls_pos_ == NullSortedPosition::First ? "nulls_first" : "nulls_last"),
510  ")");
511  }
std::string cat(Ts &&...args)
std::string to_string(char const *&&v)
const NullSortedPosition nulls_pos_
Definition: RelAlgDag.h:523
std::string typeName(const T *v)
Definition: toString.h:102
const SortDirection sort_dir_
Definition: RelAlgDag.h:522
const size_t field_
Definition: RelAlgDag.h:521

+ Here is the call graph for this function:

Member Data Documentation

const size_t SortField::field_
private

Definition at line 521 of file RelAlgDag.h.

Referenced by getField(), operator==(), toHash(), and toString().

const NullSortedPosition SortField::nulls_pos_
private

Definition at line 523 of file RelAlgDag.h.

Referenced by getNullsPosition(), operator==(), toHash(), and toString().

const SortDirection SortField::sort_dir_
private

Definition at line 522 of file RelAlgDag.h.

Referenced by getSortDir(), operator==(), toHash(), and toString().


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