SNAP Library 6.0, User Reference  2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
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 894 of file dt.h.

Constructor & Destructor Documentation

TNum< int64 >::TNum ( )
inline

Definition at line 901 of file dt.h.

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

Definition at line 902 of file dt.h.

902 : Val(Int.Val){}
Base Val
Definition: dt.h:871
int64 Val
Definition: dt.h:896
TNum< int64 >::TNum ( const int64 Int)
inline

Definition at line 903 of file dt.h.

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

Definition at line 905 of file dt.h.

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

Member Function Documentation

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

Definition at line 945 of file dt.h.

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

Definition at line 924 of file dt.h.

924 { return TStr::Fmt("%ll", Int.Val); }
Base Val
Definition: dt.h:871
static TStr Fmt(const char *FmtStr,...)
Definition: dt.cpp:1599
static TStr TNum< int64 >::GetKiloStr ( const int64 Val)
inlinestatic

Definition at line 927 of file dt.h.

927  {
928  if (Val>100 * 1000){ return GetStr(Val / 1000) + "K"; }
929  else if (Val>1000){ return GetStr(Val / 1000) + "." + GetStr((Val % 1000) / 100) + "K"; }
930  else { return GetStr(Val); }
931  }
TStr GetStr() const
Definition: dt.h:922
int64 Val
Definition: dt.h:896
static TStr TNum< int64 >::GetMegaStr ( const int64 Val)
inlinestatic

Definition at line 932 of file dt.h.

932  {
933  if (Val>100 * 1000000){ return GetStr(Val / 1000000) + "M"; }
934  else if (Val>1000000){
935  return GetStr(Val / 1000000) + "." + GetStr((Val % 1000000) / 100000) + "M";
936  }
937  else { return GetKiloStr(Val); }
938  }
TStr GetStr() const
Definition: dt.h:922
int64 Val
Definition: dt.h:896
static TStr GetKiloStr(const int64 &Val)
Definition: dt.h:927
int TNum< int64 >::GetMemUsed ( ) const
inline

Definition at line 915 of file dt.h.

915 { return sizeof(TNum); }
TNum()
Definition: dt.h:901
TStr TNum< int64 >::GetStr ( ) const
inline

Definition at line 922 of file dt.h.

922 { return TStr::Fmt("%ll", Val); }
int64 Val
Definition: dt.h:896
static TStr Fmt(const char *FmtStr,...)
Definition: dt.cpp:1599
static TStr TNum< int64 >::GetStr ( const TNum< int64 > &  Int)
inlinestatic

Definition at line 923 of file dt.h.

923 { return TStr::Fmt("%ll", Int.Val); }
Base Val
Definition: dt.h:871
static TStr Fmt(const char *FmtStr,...)
Definition: dt.cpp:1599
void TNum< int64 >::Load ( TSIn SIn)
inline

Definition at line 906 of file dt.h.

906 { SIn.Load(Val); }
void Load(bool &Bool)
Definition: fl.h:84
int64 Val
Definition: dt.h:896
TNum< int64 >::operator int64 ( ) const
inline

Definition at line 904 of file dt.h.

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

Definition at line 911 of file dt.h.

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

Definition at line 913 of file dt.h.

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

Definition at line 909 of file dt.h.

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

Definition at line 912 of file dt.h.

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

Definition at line 914 of file dt.h.

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

Definition at line 910 of file dt.h.

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

Definition at line 908 of file dt.h.

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

Definition at line 907 of file dt.h.

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

Member Data Documentation

const int64 TNum< int64 >::Mn
static

Definition at line 898 of file dt.h.

const int64 TNum< int64 >::Mx
static

Definition at line 899 of file dt.h.

int64 TNum< int64 >::Val

Definition at line 896 of file dt.h.


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