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
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 >::THashMPKeyDatCmp::Asc, THashMP< TKey, TDat, THashFunc >::THashMPKeyDatCmp::CmpKey, and THashMP< TKey, TDat, THashFunc >::THashMPKeyDatCmp::Hash.

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

Member Data Documentation

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

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