SNAP Library 4.0, Developer Reference  2017-07-27 13:18:06
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
THash< TKey, TDat, THashFunc >::THashKeyDatCmp Class Reference

Public Member Functions

 THashKeyDatCmp (THash< TKey, TDat, THashFunc > &_Hash, const bool &_CmpKey, const bool &_Asc)
 
bool operator() (const int &KeyId1, const int &KeyId2) const
 

Public Attributes

const THash< TKey, TDat,
THashFunc > & 
Hash
 
bool CmpKey
 
bool Asc
 

Detailed Description

template<class TKey, class TDat, class THashFunc = TDefaultHashFunc<TKey>>
class THash< TKey, TDat, THashFunc >::THashKeyDatCmp

Definition at line 111 of file hash.h.

Constructor & Destructor Documentation

template<class TKey, class TDat, class THashFunc = TDefaultHashFunc<TKey>>
THash< TKey, TDat, THashFunc >::THashKeyDatCmp::THashKeyDatCmp ( THash< TKey, TDat, THashFunc > &  _Hash,
const bool &  _CmpKey,
const bool &  _Asc 
)
inline

Definition at line 115 of file hash.h.

115  :
116  Hash(_Hash), CmpKey(_CmpKey), Asc(_Asc) { }
const THash< TKey, TDat, THashFunc > & Hash
Definition: hash.h:113

Member Function Documentation

template<class TKey, class TDat, class THashFunc = TDefaultHashFunc<TKey>>
bool THash< TKey, TDat, THashFunc >::THashKeyDatCmp::operator() ( const int &  KeyId1,
const int &  KeyId2 
) const
inline

Definition at line 117 of file hash.h.

References THash< TKey, TDat, THashFunc >::THashKeyDatCmp::Asc, THash< TKey, TDat, THashFunc >::THashKeyDatCmp::CmpKey, and THash< TKey, TDat, THashFunc >::THashKeyDatCmp::Hash.

117  {
118  if (CmpKey) {
119  if (Asc) { return Hash.GetKey(KeyId1) < Hash.GetKey(KeyId2); }
120  else { return Hash.GetKey(KeyId2) < Hash.GetKey(KeyId1); } }
121  else {
122  if (Asc) { return Hash[KeyId1] < Hash[KeyId2]; }
123  else { return Hash[KeyId2] < Hash[KeyId1]; } } }
const THash< TKey, TDat, THashFunc > & Hash
Definition: hash.h:113

Member Data Documentation

template<class TKey, class TDat, class THashFunc = TDefaultHashFunc<TKey>>
bool THash< TKey, TDat, THashFunc >::THashKeyDatCmp::Asc

Definition at line 114 of file hash.h.

Referenced by THash< TKey, TDat, THashFunc >::THashKeyDatCmp::operator()().

template<class TKey, class TDat, class THashFunc = TDefaultHashFunc<TKey>>
bool THash< TKey, TDat, THashFunc >::THashKeyDatCmp::CmpKey

Definition at line 114 of file hash.h.

Referenced by THash< TKey, TDat, THashFunc >::THashKeyDatCmp::operator()().

template<class TKey, class TDat, class THashFunc = TDefaultHashFunc<TKey>>
const THash<TKey, TDat, THashFunc>& THash< TKey, TDat, THashFunc >::THashKeyDatCmp::Hash

Definition at line 113 of file hash.h.

Referenced by THash< TKey, TDat, THashFunc >::THashKeyDatCmp::operator()().


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