OmniSciDB  c1a53651b2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
shared::ColumnKey Struct Reference

#include <DbObjectKeys.h>

Public Member Functions

 ColumnKey (int32_t db_id, int32_t table_id, int32_t column_id)
 
 ColumnKey (const TableKey &table_key, int32_t column_id)
 
bool operator== (const ColumnKey &other) const
 
bool operator!= (const ColumnKey &other) const
 
bool operator< (const ColumnKey &other) const
 
size_t hash () const
 

Public Attributes

int32_t db_id
 
int32_t table_id
 
int32_t column_id
 

Friends

std::ostream & operator<< (std::ostream &os, const ColumnKey &column_key)
 

Detailed Description

Definition at line 68 of file DbObjectKeys.h.

Constructor & Destructor Documentation

shared::ColumnKey::ColumnKey ( int32_t  db_id,
int32_t  table_id,
int32_t  column_id 
)
inline

Definition at line 69 of file DbObjectKeys.h.

shared::ColumnKey::ColumnKey ( const TableKey table_key,
int32_t  column_id 
)
inline

Definition at line 72 of file DbObjectKeys.h.

73  : ColumnKey(table_key.db_id, table_key.table_id, column_id) {}
ColumnKey(int32_t db_id, int32_t table_id, int32_t column_id)
Definition: DbObjectKeys.h:69

Member Function Documentation

size_t shared::ColumnKey::hash ( ) const

Definition at line 101 of file DbObjectKeys.cpp.

References column_id, shared::compute_hash(), db_id, and table_id.

Referenced by std::hash< shared::ColumnKey >::operator()().

101  {
103  boost::hash_combine(hash, db_id);
104  return hash;
105 }
size_t hash() const
size_t compute_hash(int32_t item_1, int32_t item_2)
Definition: misc.cpp:141

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool shared::ColumnKey::operator!= ( const ColumnKey other) const

Definition at line 81 of file DbObjectKeys.cpp.

81  {
82  return !(*this == other);
83 }
bool shared::ColumnKey::operator< ( const ColumnKey other) const

Definition at line 85 of file DbObjectKeys.cpp.

References column_id, db_id, and table_id.

85  {
86  if (db_id != other.db_id) {
87  return db_id < other.db_id;
88  }
89  if (table_id != other.table_id) {
90  return table_id < other.table_id;
91  }
92  return column_id < other.column_id;
93 }
bool shared::ColumnKey::operator== ( const ColumnKey other) const

Definition at line 76 of file DbObjectKeys.cpp.

References column_id, db_id, and table_id.

76  {
77  return db_id == other.db_id && table_id == other.table_id &&
78  column_id == other.column_id;
79 }

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const ColumnKey column_key 
)
friend

Definition at line 95 of file DbObjectKeys.cpp.

95  {
96  os << "(db_id: " << column_key.db_id << ", table_id: " << column_key.table_id
97  << ", column_id: " << column_key.column_id << ")";
98  return os;
99 }

Member Data Documentation


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