SNAP Library , Developer Reference  2013-01-07 14:03:36
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 41 of file gstat.h.


Constructor & Destructor Documentation

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

Definition at line 46 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.

References TStr::CStr(), TStr::Fmt(), TGStat::GetVal(), TGStat::GetValStr(), gsvTime, TGStat::HasVal(), IAssertR, SortAsc, TGStat::Time, and ValCmp.

                                                                             {
  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; }
}

Here is the call graph for this function:

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 44 of file gstat.h.

Referenced by operator()().

Definition at line 43 of file gstat.h.

Referenced by operator()().


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