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
TPair< TVal1, TVal2 > Class Template Reference

#include <ds.h>

Public Member Functions

 TPair ()
 
 TPair (const TPair &Pair)
 
 TPair (const TVal1 &_Val1, const TVal2 &_Val2)
 
 TPair (TSIn &SIn)
 
void Save (TSOut &SOut) const
 
void Load (TSIn &SIn)
 
void LoadXml (const PXmlTok &XmlTok, const TStr &Nm="")
 
void SaveXml (TSOut &SOut, const TStr &Nm) const
 
TPairoperator= (const TPair &Pair)
 
bool operator== (const TPair &Pair) const
 
bool operator< (const TPair &Pair) const
 
int GetMemUsed () const
 
int GetPrimHashCd () const
 
int GetSecHashCd () const
 
void GetVal (TVal1 &_Val1, TVal2 &_Val2) const
 
const TVal1 & GetVal1 () const
 
const TVal2 & GetVal2 () const
 
TStr GetStr () const
 

Public Attributes

TVal1 Val1
 
TVal2 Val2
 

Detailed Description

template<class TVal1, class TVal2>
class TPair< TVal1, TVal2 >

Definition at line 32 of file ds.h.

Constructor & Destructor Documentation

template<class TVal1, class TVal2>
TPair< TVal1, TVal2 >::TPair ( )
inline

Definition at line 37 of file ds.h.

37 : Val1(), Val2(){}
TVal1 Val1
Definition: ds.h:34
TVal2 Val2
Definition: ds.h:35
template<class TVal1, class TVal2>
TPair< TVal1, TVal2 >::TPair ( const TPair< TVal1, TVal2 > &  Pair)
inline

Definition at line 38 of file ds.h.

38 : Val1(Pair.Val1), Val2(Pair.Val2){}
TVal1 Val1
Definition: ds.h:34
TVal2 Val2
Definition: ds.h:35
template<class TVal1, class TVal2>
TPair< TVal1, TVal2 >::TPair ( const TVal1 &  _Val1,
const TVal2 &  _Val2 
)
inline

Definition at line 39 of file ds.h.

39 : Val1(_Val1), Val2(_Val2){}
TVal1 Val1
Definition: ds.h:34
TVal2 Val2
Definition: ds.h:35
template<class TVal1, class TVal2>
TPair< TVal1, TVal2 >::TPair ( TSIn SIn)
inlineexplicit

Definition at line 40 of file ds.h.

40 : Val1(SIn), Val2(SIn){}
TVal1 Val1
Definition: ds.h:34
TVal2 Val2
Definition: ds.h:35

Member Function Documentation

template<class TVal1, class TVal2>
int TPair< TVal1, TVal2 >::GetMemUsed ( ) const
inline

Definition at line 54 of file ds.h.

54 {return Val1.GetMemUsed()+Val2.GetMemUsed();}
TVal1 Val1
Definition: ds.h:34
TVal2 Val2
Definition: ds.h:35
template<class TVal1, class TVal2>
int TPair< TVal1, TVal2 >::GetPrimHashCd ( ) const
inline

Definition at line 56 of file ds.h.

56 {return TPairHashImpl::GetHashCd(Val1.GetPrimHashCd(), Val2.GetPrimHashCd()); }
static int GetHashCd(const int hc1, const int hc2)
Definition: bd.h:590
TVal1 Val1
Definition: ds.h:34
TVal2 Val2
Definition: ds.h:35
template<class TVal1, class TVal2>
int TPair< TVal1, TVal2 >::GetSecHashCd ( ) const
inline

Definition at line 57 of file ds.h.

57 {return TPairHashImpl::GetHashCd(Val2.GetSecHashCd(), Val1.GetSecHashCd()); }
static int GetHashCd(const int hc1, const int hc2)
Definition: bd.h:590
TVal1 Val1
Definition: ds.h:34
TVal2 Val2
Definition: ds.h:35
template<class TVal1, class TVal2>
TStr TPair< TVal1, TVal2 >::GetStr ( ) const
inline

Definition at line 62 of file ds.h.

62  {
63  return TStr("Pair(")+Val1.GetStr()+", "+Val2.GetStr()+")";}
Definition: dt.h:412
TVal1 Val1
Definition: ds.h:34
TVal2 Val2
Definition: ds.h:35
template<class TVal1, class TVal2>
void TPair< TVal1, TVal2 >::GetVal ( TVal1 &  _Val1,
TVal2 &  _Val2 
) const
inline

Definition at line 59 of file ds.h.

59 {_Val1=Val1; _Val2=Val2;}
TVal1 Val1
Definition: ds.h:34
TVal2 Val2
Definition: ds.h:35
template<class TVal1, class TVal2>
const TVal1& TPair< TVal1, TVal2 >::GetVal1 ( ) const
inline

Definition at line 60 of file ds.h.

60 { return Val1;}
TVal1 Val1
Definition: ds.h:34
template<class TVal1, class TVal2>
const TVal2& TPair< TVal1, TVal2 >::GetVal2 ( ) const
inline

Definition at line 61 of file ds.h.

61 { return Val2;}
TVal2 Val2
Definition: ds.h:35
template<class TVal1, class TVal2>
void TPair< TVal1, TVal2 >::Load ( TSIn SIn)
inline

Definition at line 43 of file ds.h.

43 {Val1.Load(SIn); Val2.Load(SIn);}
TVal1 Val1
Definition: ds.h:34
TVal2 Val2
Definition: ds.h:35
template<class TVal1 , class TVal2 >
void TPair< TVal1, TVal2 >::LoadXml ( const PXmlTok XmlTok,
const TStr Nm = "" 
)

Definition at line 71 of file xmlser.h.

71  {
72  XLoadHd(Nm); XLoad(Val1); XLoad(Val2);}
#define XLoadHd(Nm)
Definition: bd.h:312
#define XLoad(Nm)
Definition: bd.h:315
TVal1 Val1
Definition: ds.h:34
TVal2 Val2
Definition: ds.h:35
template<class TVal1, class TVal2>
bool TPair< TVal1, TVal2 >::operator< ( const TPair< TVal1, TVal2 > &  Pair) const
inline

Definition at line 51 of file ds.h.

51  {
52  return (Val1<Pair.Val1)||((Val1==Pair.Val1)&&(Val2<Pair.Val2));}
TVal1 Val1
Definition: ds.h:34
TVal2 Val2
Definition: ds.h:35
template<class TVal1, class TVal2>
TPair& TPair< TVal1, TVal2 >::operator= ( const TPair< TVal1, TVal2 > &  Pair)
inline

Definition at line 47 of file ds.h.

47  {
48  if (this!=&Pair){Val1=Pair.Val1; Val2=Pair.Val2;} return *this;}
TVal1 Val1
Definition: ds.h:34
TVal2 Val2
Definition: ds.h:35
template<class TVal1, class TVal2>
bool TPair< TVal1, TVal2 >::operator== ( const TPair< TVal1, TVal2 > &  Pair) const
inline

Definition at line 49 of file ds.h.

49  {
50  return (Val1==Pair.Val1)&&(Val2==Pair.Val2);}
TVal1 Val1
Definition: ds.h:34
TVal2 Val2
Definition: ds.h:35
template<class TVal1, class TVal2>
void TPair< TVal1, TVal2 >::Save ( TSOut SOut) const
inline

Definition at line 41 of file ds.h.

41  {
42  Val1.Save(SOut); Val2.Save(SOut);}
TVal1 Val1
Definition: ds.h:34
TVal2 Val2
Definition: ds.h:35
template<class TVal1 , class TVal2 >
void TPair< TVal1, TVal2 >::SaveXml ( TSOut SOut,
const TStr Nm 
) const

Definition at line 75 of file xmlser.h.

75  {
76  XSaveHd(Nm); XSave(Val1); XSave(Val2);}
#define XSaveHd(Nm)
Definition: bd.h:318
#define XSave(Nm)
Definition: bd.h:333
TVal1 Val1
Definition: ds.h:34
TVal2 Val2
Definition: ds.h:35

Member Data Documentation

template<class TVal1, class TVal2>
TVal1 TPair< TVal1, TVal2 >::Val1

Definition at line 34 of file ds.h.

template<class TVal1, class TVal2>
TVal2 TPair< TVal1, TVal2 >::Val2

Definition at line 35 of file ds.h.


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