OmniSciDB  c1a53651b2
 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

size_t field_
 
SortDirection sort_dir_
 
NullSortedPosition nulls_pos_
 

Detailed Description

Definition at line 534 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 536 of file RelAlgDag.h.

539  : field_(field), sort_dir_(sort_dir), nulls_pos_(nulls_pos) {}
NullSortedPosition nulls_pos_
Definition: RelAlgDag.h:573
const rapidjson::Value & field(const rapidjson::Value &obj, const char field[]) noexcept
Definition: JsonAccessors.h:31
size_t field_
Definition: RelAlgDag.h:571
SortDirection sort_dir_
Definition: RelAlgDag.h:572

Member Function Documentation

size_t SortField::getField ( ) const
inline

Definition at line 546 of file RelAlgDag.h.

References field_.

Referenced by anonymous_namespace{RelAlgOptimizer.cpp}::renumber_sort_field(), and boost::serialization::save_construct_data().

546 { return field_; }
size_t field_
Definition: RelAlgDag.h:571

+ Here is the caller graph for this function:

NullSortedPosition SortField::getNullsPosition ( ) const
inline

Definition at line 550 of file RelAlgDag.h.

References nulls_pos_.

Referenced by anonymous_namespace{RelAlgOptimizer.cpp}::renumber_sort_field(), and boost::serialization::save_construct_data().

550 { return nulls_pos_; }
NullSortedPosition nulls_pos_
Definition: RelAlgDag.h:573

+ Here is the caller graph for this function:

SortDirection SortField::getSortDir ( ) const
inline

Definition at line 548 of file RelAlgDag.h.

References sort_dir_.

Referenced by anonymous_namespace{RelAlgOptimizer.cpp}::renumber_sort_field(), and boost::serialization::save_construct_data().

548 { return sort_dir_; }
SortDirection sort_dir_
Definition: RelAlgDag.h:572

+ Here is the caller graph for this function:

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

Definition at line 541 of file RelAlgDag.h.

References field_, nulls_pos_, and sort_dir_.

541  {
542  return field_ == that.field_ && sort_dir_ == that.sort_dir_ &&
543  nulls_pos_ == that.nulls_pos_;
544  }
NullSortedPosition nulls_pos_
Definition: RelAlgDag.h:573
size_t field_
Definition: RelAlgDag.h:571
SortDirection sort_dir_
Definition: RelAlgDag.h:572
size_t SortField::toHash ( ) const
inline

Definition at line 563 of file RelAlgDag.h.

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

563  {
564  auto hash = boost::hash_value(field_);
565  boost::hash_combine(hash, sort_dir_ == SortDirection::Ascending ? "a" : "d");
566  boost::hash_combine(hash, nulls_pos_ == NullSortedPosition::First ? "f" : "l");
567  return hash;
568  }
NullSortedPosition nulls_pos_
Definition: RelAlgDag.h:573
size_t field_
Definition: RelAlgDag.h:571
SortDirection sort_dir_
Definition: RelAlgDag.h:572
std::string SortField::toString ( ) const
inline

Definition at line 552 of file RelAlgDag.h.

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

552  {
553  return cat(::typeName(this),
554  "(",
556  ", sort_dir=",
557  (sort_dir_ == SortDirection::Ascending ? "asc" : "desc"),
558  ", null_pos=",
559  (nulls_pos_ == NullSortedPosition::First ? "nulls_first" : "nulls_last"),
560  ")");
561  }
std::string cat(Ts &&...args)
NullSortedPosition nulls_pos_
Definition: RelAlgDag.h:573
std::string to_string(char const *&&v)
size_t field_
Definition: RelAlgDag.h:571
std::string typeName(const T *v)
Definition: toString.h:103
SortDirection sort_dir_
Definition: RelAlgDag.h:572

+ Here is the call graph for this function:

Member Data Documentation

size_t SortField::field_
private

Definition at line 571 of file RelAlgDag.h.

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

NullSortedPosition SortField::nulls_pos_
private

Definition at line 573 of file RelAlgDag.h.

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

SortDirection SortField::sort_dir_
private

Definition at line 572 of file RelAlgDag.h.

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


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