SNAP Library 3.0, User Reference  2016-07-20 17:56:49
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 102 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 106 of file hash.h.

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

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 108 of file hash.h.

108  {
109  if (CmpKey) {
110  if (Asc) { return Hash.GetKey(KeyId1) < Hash.GetKey(KeyId2); }
111  else { return Hash.GetKey(KeyId2) < Hash.GetKey(KeyId1); } }
112  else {
113  if (Asc) { return Hash[KeyId1] < Hash[KeyId2]; }
114  else { return Hash[KeyId2] < Hash[KeyId1]; } } }
const THash< TKey, TDat, THashFunc > & Hash
Definition: hash.h:104

Member Data Documentation

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

Definition at line 105 of file hash.h.

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

Definition at line 105 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 104 of file hash.h.


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