SNAP Library 4.0, Developer Reference  2017-07-27 13:18:06
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
TNum< int64 > Class Template Reference

#include <dt.h>

Public Member Functions

 TNum ()
 
 TNum (const TNum &Int)
 
 TNum (const int64 &Int)
 
 operator int64 () const
 
 TNum (TSIn &SIn)
 
void Load (TSIn &SIn)
 
void Save (TSOut &SOut) const
 
TNumoperator= (const TNum &Int)
 
TNumoperator+= (const TNum &Int)
 
TNumoperator-= (const TNum &Int)
 
TNumoperator++ ()
 
TNumoperator-- ()
 
TNum operator++ (int)
 
TNum operator-- (int)
 
int GetMemUsed () const
 
TStr GetStr () const
 

Static Public Member Functions

static TStr GetStr (const TNum &Int)
 
static TStr GetHexStr (const TNum &Int)
 
static TStr GetKiloStr (const int64 &Val)
 
static TStr GetMegaStr (const int64 &Val)
 
static int64 GetFromBufSafe (const char *Bf)
 

Public Attributes

int64 Val
 

Static Public Attributes

static const int64 Mn
 
static const int64 Mx
 

Detailed Description

template<>
class TNum< int64 >

Definition at line 891 of file dt.h.

Constructor & Destructor Documentation

TNum< int64 >::TNum ( )
inline

Definition at line 898 of file dt.h.

898 : Val(0){}
int64 Val
Definition: dt.h:893
TNum< int64 >::TNum ( const TNum< int64 > &  Int)
inline

Definition at line 899 of file dt.h.

899 : Val(Int.Val){}
Base Val
Definition: dt.h:868
int64 Val
Definition: dt.h:893
TNum< int64 >::TNum ( const int64 Int)
inline

Definition at line 900 of file dt.h.

900 : Val(Int){}
int64 Val
Definition: dt.h:893
TNum< int64 >::TNum ( TSIn SIn)
inlineexplicit

Definition at line 902 of file dt.h.

References TSIn::Load(), and TNum< Base >::Val.

902 { SIn.Load(Val); }
void Load(bool &Bool)
Definition: fl.h:84
int64 Val
Definition: dt.h:893

Here is the call graph for this function:

Member Function Documentation

static int64 TNum< int64 >::GetFromBufSafe ( const char *  Bf)
inlinestatic

Definition at line 942 of file dt.h.

References TNum< Base >::Val.

942  {
943 #ifdef ARM
944  int64 Val;
945  memcpy(&Val, Bf, sizeof(int64)); //we cannot use a cast on ARM (needs 8byte memory aligned doubles)
946  return Val;
947 #else
948  return *((int64*)Bf);
949 #endif
950  }
long long int64
Definition: bd.h:27
int64 Val
Definition: dt.h:893
static TStr TNum< int64 >::GetHexStr ( const TNum< int64 > &  Int)
inlinestatic

Definition at line 921 of file dt.h.

References TStr::Fmt(), and TNum< Base >::Val.

921 { return TStr::Fmt("%ll", Int.Val); }
Base Val
Definition: dt.h:868
static TStr Fmt(const char *FmtStr,...)
Definition: dt.cpp:1599

Here is the call graph for this function:

static TStr TNum< int64 >::GetKiloStr ( const int64 Val)
inlinestatic

Definition at line 924 of file dt.h.

924  {
925  if (Val>100 * 1000){ return GetStr(Val / 1000) + "K"; }
926  else if (Val>1000){ return GetStr(Val / 1000) + "." + GetStr((Val % 1000) / 100) + "K"; }
927  else { return GetStr(Val); }
928  }
TStr GetStr() const
Definition: dt.h:919
int64 Val
Definition: dt.h:893
static TStr TNum< int64 >::GetMegaStr ( const int64 Val)
inlinestatic

Definition at line 929 of file dt.h.

929  {
930  if (Val>100 * 1000000){ return GetStr(Val / 1000000) + "M"; }
931  else if (Val>1000000){
932  return GetStr(Val / 1000000) + "." + GetStr((Val % 1000000) / 100000) + "M";
933  }
934  else { return GetKiloStr(Val); }
935  }
TStr GetStr() const
Definition: dt.h:919
int64 Val
Definition: dt.h:893
static TStr GetKiloStr(const int64 &Val)
Definition: dt.h:924
int TNum< int64 >::GetMemUsed ( ) const
inline

Definition at line 912 of file dt.h.

References TNum< Base >::TNum().

912 { return sizeof(TNum); }
TNum()
Definition: dt.h:898

Here is the call graph for this function:

TStr TNum< int64 >::GetStr ( ) const
inline

Definition at line 919 of file dt.h.

References TStr::Fmt(), and TNum< Base >::Val.

919 { return TStr::Fmt("%ll", Val); }
int64 Val
Definition: dt.h:893
static TStr Fmt(const char *FmtStr,...)
Definition: dt.cpp:1599

Here is the call graph for this function:

static TStr TNum< int64 >::GetStr ( const TNum< int64 > &  Int)
inlinestatic

Definition at line 920 of file dt.h.

References TStr::Fmt(), and TNum< Base >::Val.

920 { return TStr::Fmt("%ll", Int.Val); }
Base Val
Definition: dt.h:868
static TStr Fmt(const char *FmtStr,...)
Definition: dt.cpp:1599

Here is the call graph for this function:

void TNum< int64 >::Load ( TSIn SIn)
inline

Definition at line 903 of file dt.h.

References TSIn::Load(), and TNum< Base >::Val.

Referenced by TVVec< TFlt >::Load().

903 { SIn.Load(Val); }
void Load(bool &Bool)
Definition: fl.h:84
int64 Val
Definition: dt.h:893

Here is the call graph for this function:

Here is the caller graph for this function:

TNum< int64 >::operator int64 ( ) const
inline

Definition at line 901 of file dt.h.

References TNum< Base >::Val.

901 { return Val; }
int64 Val
Definition: dt.h:893
TNum& TNum< int64 >::operator++ ( )
inline

Definition at line 908 of file dt.h.

References TNum< Base >::Val.

908 { ++Val; return *this; } // prefix
int64 Val
Definition: dt.h:893
TNum TNum< int64 >::operator++ ( int  )
inline

Definition at line 910 of file dt.h.

References TNum< Base >::Val.

910 { TNum oldVal = Val; Val++; return oldVal; } // postfix
Definition: dt.h:866
int64 Val
Definition: dt.h:893
TNum& TNum< int64 >::operator+= ( const TNum< int64 > &  Int)
inline

Definition at line 906 of file dt.h.

References TNum< Base >::Val.

906 { Val += Int.Val; return *this; }
Base Val
Definition: dt.h:868
int64 Val
Definition: dt.h:893
TNum& TNum< int64 >::operator-- ( )
inline

Definition at line 909 of file dt.h.

References TNum< Base >::Val.

909 { --Val; return *this; } // prefix
int64 Val
Definition: dt.h:893
TNum TNum< int64 >::operator-- ( int  )
inline

Definition at line 911 of file dt.h.

References TNum< Base >::Val.

911 { TNum oldVal = Val; Val--; return oldVal; } // postfix
Definition: dt.h:866
int64 Val
Definition: dt.h:893
TNum& TNum< int64 >::operator-= ( const TNum< int64 > &  Int)
inline

Definition at line 907 of file dt.h.

References TNum< Base >::Val.

907 { Val -= Int.Val; return *this; }
Base Val
Definition: dt.h:868
int64 Val
Definition: dt.h:893
TNum& TNum< int64 >::operator= ( const TNum< int64 > &  Int)
inline

Definition at line 905 of file dt.h.

References TNum< Base >::Val.

905 { Val = Int.Val; return *this; }
Base Val
Definition: dt.h:868
int64 Val
Definition: dt.h:893
void TNum< int64 >::Save ( TSOut SOut) const
inline

Definition at line 904 of file dt.h.

References TSOut::Save(), and TNum< Base >::Val.

Referenced by TVVec< TFlt >::Save(), and TVVVec< TVal, TSizeTy >::Save().

904 { SOut.Save(Val); }
void Save(const bool &Bool)
Definition: fl.h:173
int64 Val
Definition: dt.h:893

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

const int64 TNum< int64 >::Mn
static

Definition at line 895 of file dt.h.

const int64 TNum< int64 >::Mx
static

Definition at line 896 of file dt.h.

int64 TNum< int64 >::Val

Definition at line 893 of file dt.h.


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