SNAP Library 6.0, Developer Reference  2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
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 >::GetKey().

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

Here is the call graph for this function:

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.

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

Definition at line 114 of file hash.h.

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.


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