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

Detailed Description

Definition at line 49 of file DbObjectKeys.h.

Constructor & Destructor Documentation

shared::TableKey::TableKey ( )
inline

Definition at line 50 of file DbObjectKeys.h.

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

Definition at line 52 of file DbObjectKeys.h.

Member Function Documentation

size_t shared::TableKey::hash ( ) const

Definition at line 72 of file DbObjectKeys.cpp.

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

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

72  {
74 }
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 56 of file DbObjectKeys.cpp.

56  {
57  return !(*this == other);
58 }
bool shared::TableKey::operator< ( const TableKey other) const

Definition at line 60 of file DbObjectKeys.cpp.

References db_id, and table_id.

60  {
61  if (db_id != other.db_id) {
62  return db_id < other.db_id;
63  }
64  return table_id < other.table_id;
65 }
bool shared::TableKey::operator== ( const TableKey other) const

Definition at line 52 of file DbObjectKeys.cpp.

References db_id, and table_id.

52  {
53  return db_id == other.db_id && table_id == other.table_id;
54 }

Friends And Related Function Documentation

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

Definition at line 67 of file DbObjectKeys.cpp.

67  {
68  os << "(db_id: " << table_key.db_id << ", table_id: " << table_key.table_id << ")";
69  return os;
70 }

Member Data Documentation


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