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
THashMP< TKey, TDat, THashFunc >::THashMPKeyDatCmp Class Reference

Public Member Functions

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

Public Attributes

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

Detailed Description

template<class TKey, class TDat, class THashFunc = TDefaultHashFunc<TKey>>
class THashMP< TKey, TDat, THashFunc >::THashMPKeyDatCmp

Definition at line 93 of file hashmp.h.

Constructor & Destructor Documentation

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

Definition at line 97 of file hashmp.h.

97  :
98  Hash(_Hash), CmpKey(_CmpKey), Asc(_Asc) { }
const THashMP< TKey, TDat, THashFunc > & Hash
Definition: hashmp.h:95

Member Function Documentation

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

Definition at line 99 of file hashmp.h.

References THashMP< TKey, TDat, THashFunc >::GetKey().

99  {
100  if (CmpKey) {
101  if (Asc) { return Hash.GetKey(KeyId1) < Hash.GetKey(KeyId2); }
102  else { return Hash.GetKey(KeyId2) < Hash.GetKey(KeyId1); } }
103  else {
104  if (Asc) { return Hash[KeyId1] < Hash[KeyId2]; }
105  else { return Hash[KeyId2] < Hash[KeyId1]; } } }
const THashMP< TKey, TDat, THashFunc > & Hash
Definition: hashmp.h:95

Here is the call graph for this function:

Member Data Documentation

template<class TKey, class TDat, class THashFunc = TDefaultHashFunc<TKey>>
bool THashMP< TKey, TDat, THashFunc >::THashMPKeyDatCmp::Asc

Definition at line 96 of file hashmp.h.

template<class TKey, class TDat, class THashFunc = TDefaultHashFunc<TKey>>
bool THashMP< TKey, TDat, THashFunc >::THashMPKeyDatCmp::CmpKey

Definition at line 96 of file hashmp.h.

template<class TKey, class TDat, class THashFunc = TDefaultHashFunc<TKey>>
const THashMP<TKey, TDat, THashFunc>& THashMP< TKey, TDat, THashFunc >::THashMPKeyDatCmp::Hash

Definition at line 95 of file hashmp.h.


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