OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
shared::TableKey Struct Reference

#include <DbObjectKeys.h>

Public Member Functions

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

Public Attributes

int32_t db_id
 
int32_t table_id
 

Friends

std::ostream & operator<< (std::ostream &os, const TableKey &table_key)
 
size_t hash_value (const TableKey &table_key)
 

Detailed Description

Definition at line 51 of file DbObjectKeys.h.

Constructor & Destructor Documentation

shared::TableKey::TableKey ( )
inline

Definition at line 52 of file DbObjectKeys.h.

52 : db_id(0), table_id(0) {}
shared::TableKey::TableKey ( int32_t  db_id,
int32_t  table_id 
)
inline

Definition at line 54 of file DbObjectKeys.h.

Member Function Documentation

size_t shared::TableKey::hash ( ) const

Definition at line 75 of file DbObjectKeys.cpp.

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

Referenced by DataRecyclerUtil::getAlternativeTableKeys(), InputDescriptor::hash(), shared::hash_value(), and std::hash< shared::TableKey >::operator()().

75  {
77 }
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::TableKey::operator!= ( const TableKey other) const

Definition at line 59 of file DbObjectKeys.cpp.

59  {
60  return !(*this == other);
61 }
bool shared::TableKey::operator< ( const TableKey other) const

Definition at line 63 of file DbObjectKeys.cpp.

References db_id, and table_id.

63  {
64  if (db_id != other.db_id) {
65  return db_id < other.db_id;
66  }
67  return table_id < other.table_id;
68 }
bool shared::TableKey::operator== ( const TableKey other) const

Definition at line 55 of file DbObjectKeys.cpp.

References db_id, and table_id.

55  {
56  return db_id == other.db_id && table_id == other.table_id;
57 }

Friends And Related Function Documentation

size_t hash_value ( const TableKey table_key)
friend

Definition at line 79 of file DbObjectKeys.cpp.

79  {
80  return table_key.hash();
81 }
std::ostream& operator<< ( std::ostream &  os,
const TableKey table_key 
)
friend

Definition at line 70 of file DbObjectKeys.cpp.

70  {
71  os << "(db_id: " << table_key.db_id << ", table_id: " << table_key.table_id << ")";
72  return os;
73 }

Member Data Documentation


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