OmniSciDB  72c90bc290
 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
 
virtual size_t toHash () const
 

Private Attributes

size_t field_
 
SortDirection sort_dir_
 
NullSortedPosition nulls_pos_
 

Friends

std::size_t hash_value (SortField const &)
 

Detailed Description

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

540  : field_(field), sort_dir_(sort_dir), nulls_pos_(nulls_pos) {}
NullSortedPosition nulls_pos_
Definition: RelAlgDag.h:571
const rapidjson::Value & field(const rapidjson::Value &obj, const char field[]) noexcept
Definition: JsonAccessors.h:33
size_t field_
Definition: RelAlgDag.h:569
SortDirection sort_dir_
Definition: RelAlgDag.h:570

Member Function Documentation

size_t SortField::getField ( ) const
inline

Definition at line 547 of file RelAlgDag.h.

References field_.

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

547 { return field_; }
size_t field_
Definition: RelAlgDag.h:569

+ Here is the caller graph for this function:

NullSortedPosition SortField::getNullsPosition ( ) const
inline

Definition at line 551 of file RelAlgDag.h.

References nulls_pos_.

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

551 { return nulls_pos_; }
NullSortedPosition nulls_pos_
Definition: RelAlgDag.h:571

+ Here is the caller graph for this function:

SortDirection SortField::getSortDir ( ) const
inline

Definition at line 549 of file RelAlgDag.h.

References sort_dir_.

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

549 { return sort_dir_; }
SortDirection sort_dir_
Definition: RelAlgDag.h:570

+ Here is the caller graph for this function:

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

Definition at line 542 of file RelAlgDag.h.

References field_, nulls_pos_, and sort_dir_.

542  {
543  return field_ == that.field_ && sort_dir_ == that.sort_dir_ &&
544  nulls_pos_ == that.nulls_pos_;
545  }
NullSortedPosition nulls_pos_
Definition: RelAlgDag.h:571
size_t field_
Definition: RelAlgDag.h:569
SortDirection sort_dir_
Definition: RelAlgDag.h:570
virtual size_t SortField::toHash ( ) const
inlinevirtual

Definition at line 564 of file RelAlgDag.h.

References hash_value.

564 { return hash_value(*this); }
friend std::size_t hash_value(SortField const &)
Definition: RelAlgDag.cpp:3591
std::string SortField::toString ( ) const
inline

Definition at line 553 of file RelAlgDag.h.

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

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

+ Here is the call graph for this function:

Friends And Related Function Documentation

std::size_t hash_value ( SortField const &  sort_field)
friend

Definition at line 3591 of file RelAlgDag.cpp.

Referenced by toHash().

3591  {
3592  auto hash = boost::hash_value(sort_field.field_);
3593  boost::hash_combine(hash, sort_field.sort_dir_ == SortDirection::Ascending ? "a" : "d");
3594  boost::hash_combine(hash,
3595  sort_field.nulls_pos_ == NullSortedPosition::First ? "f" : "l");
3596  return hash;
3597 }
std::size_t hash_value(RexAbstractInput const &rex_ab_input)
Definition: RelAlgDag.cpp:3525

Member Data Documentation

size_t SortField::field_
private

Definition at line 569 of file RelAlgDag.h.

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

NullSortedPosition SortField::nulls_pos_
private

Definition at line 571 of file RelAlgDag.h.

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

SortDirection SortField::sort_dir_
private

Definition at line 570 of file RelAlgDag.h.

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


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