OmniSciDB  72c90bc290
 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 73 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 74 of file DbObjectKeys.h.

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

Definition at line 77 of file DbObjectKeys.h.

78  : 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:74

Member Function Documentation

size_t shared::ColumnKey::hash ( ) const

Definition at line 108 of file DbObjectKeys.cpp.

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

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

108  {
110  boost::hash_combine(hash, db_id);
111  return hash;
112 }
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 88 of file DbObjectKeys.cpp.

88  {
89  return !(*this == other);
90 }
bool shared::ColumnKey::operator< ( const ColumnKey other) const

Definition at line 92 of file DbObjectKeys.cpp.

References column_id, db_id, and table_id.

92  {
93  if (db_id != other.db_id) {
94  return db_id < other.db_id;
95  }
96  if (table_id != other.table_id) {
97  return table_id < other.table_id;
98  }
99  return column_id < other.column_id;
100 }
bool shared::ColumnKey::operator== ( const ColumnKey other) const

Definition at line 83 of file DbObjectKeys.cpp.

References column_id, db_id, and table_id.

83  {
84  return db_id == other.db_id && table_id == other.table_id &&
85  column_id == other.column_id;
86 }

Friends And Related Function Documentation

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

Definition at line 102 of file DbObjectKeys.cpp.

102  {
103  os << "(db_id: " << column_key.db_id << ", table_id: " << column_key.table_id
104  << ", column_id: " << column_key.column_id << ")";
105  return os;
106 }

Member Data Documentation


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