SNAP Library 3.0, Developer 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
TCmpPairByVal2< TVal1, TVal2 > Class Template Reference

Compares the pair by the second value. More...

#include <ds.h>

Public Member Functions

 TCmpPairByVal2 (const bool &AscSort=true)
 
bool operator() (const TPair< TVal1, TVal2 > &P1, const TPair< TVal1, TVal2 > &P2) const
 

Private Attributes

bool IsAsc
 

Detailed Description

template<class TVal1, class TVal2>
class TCmpPairByVal2< TVal1, TVal2 >

Compares the pair by the second value.

Definition at line 116 of file ds.h.

Constructor & Destructor Documentation

template<class TVal1 , class TVal2 >
TCmpPairByVal2< TVal1, TVal2 >::TCmpPairByVal2 ( const bool &  AscSort = true)
inline

Definition at line 120 of file ds.h.

120 : IsAsc(AscSort) { }
bool IsAsc
Definition: ds.h:118

Member Function Documentation

template<class TVal1 , class TVal2 >
bool TCmpPairByVal2< TVal1, TVal2 >::operator() ( const TPair< TVal1, TVal2 > &  P1,
const TPair< TVal1, TVal2 > &  P2 
) const
inline

Definition at line 121 of file ds.h.

References TCmpPairByVal2< TVal1, TVal2 >::IsAsc, and TPair< TVal1, TVal2 >::Val2.

121  {
122  if (IsAsc) { return P1.Val2 < P2.Val2; } else { return P2.Val2 < P1.Val2; }
123  }
bool IsAsc
Definition: ds.h:118
TVal2 Val2
Definition: ds.h:35

Member Data Documentation

template<class TVal1 , class TVal2 >
bool TCmpPairByVal2< TVal1, TVal2 >::IsAsc
private

Definition at line 118 of file ds.h.

Referenced by TCmpPairByVal2< TVal1, TVal2 >::operator()().


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