SNAP Library 2.1, User Reference  2013-09-25 10:47:25
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TGStat::TCmpByVal Class Reference

#include <gstat.h>

List of all members.

Public Member Functions

 TCmpByVal (TGStatVal SortBy, bool Asc)
bool operator() (const TGStat &GS1, const TGStat &GS2) const
bool operator() (const PGStat &GS1, const PGStat &GS2) const

Private Attributes

TGStatVal ValCmp
bool SortAsc

Detailed Description

Definition at line 42 of file gstat.h.


Constructor & Destructor Documentation

TGStat::TCmpByVal::TCmpByVal ( TGStatVal  SortBy,
bool  Asc 
) [inline]

Definition at line 47 of file gstat.h.

: ValCmp(SortBy), SortAsc(Asc) { }

Member Function Documentation

bool TGStat::TCmpByVal::operator() ( const TGStat GS1,
const TGStat GS2 
) const

Definition at line 7 of file gstat.cpp.

                                                                             {
  IAssertR(GS1.HasVal(ValCmp) && GS2.HasVal(ValCmp), TStr::Fmt("CmpVal: %d (%s)", 
    int(ValCmp), TGStat::GetValStr(ValCmp).CStr()).CStr());
  bool Res;
  if (ValCmp == gsvTime) { Res = GS1.Time < GS2.Time; }
  else { Res = GS1.GetVal(ValCmp) < GS2.GetVal(ValCmp); }
  if (SortAsc) { return Res; }
  else { return ! Res; }
}
bool TGStat::TCmpByVal::operator() ( const PGStat GS1,
const PGStat GS2 
) const

Definition at line 17 of file gstat.cpp.

                                                                             {
  return operator()(*GS1, *GS2);
}

Member Data Documentation

Definition at line 45 of file gstat.h.

Definition at line 44 of file gstat.h.


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