Feathercoin  0.5.0
P2P Digital Currency
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
Public Member Functions | Friends | List of all members
CBigNum Class Reference

C++ wrapper for BIGNUM (OpenSSL bignum) More...

#include <bignum.h>

Inheritance diagram for CBigNum:
Inheritance graph
[legend]
Collaboration diagram for CBigNum:
Collaboration graph
[legend]

Public Member Functions

 CBigNum ()
 
 CBigNum (const CBigNum &b)
 
CBigNumoperator= (const CBigNum &b)
 
 ~CBigNum ()
 
 CBigNum (signed char n)
 
 CBigNum (short n)
 
 CBigNum (int n)
 
 CBigNum (long n)
 
 CBigNum (int64 n)
 
 CBigNum (unsigned char n)
 
 CBigNum (unsigned short n)
 
 CBigNum (unsigned int n)
 
 CBigNum (unsigned long n)
 
 CBigNum (uint64 n)
 
 CBigNum (uint256 n)
 
 CBigNum (const std::vector< unsigned char > &vch)
 
void setulong (unsigned long n)
 
unsigned long getulong () const
 
unsigned int getuint () const
 
int getint () const
 
void setint64 (int64 sn)
 
void setuint64 (uint64 n)
 
void setuint256 (uint256 n)
 
uint256 getuint256 () const
 
void setvch (const std::vector< unsigned char > &vch)
 
std::vector< unsigned char > getvch () const
 
CBigNumSetCompact (unsigned int nCompact)
 
unsigned int GetCompact () const
 
void SetHex (const std::string &str)
 
std::string ToString (int nBase=10) const
 
std::string GetHex () const
 
unsigned int GetSerializeSize (int nType=0, int nVersion=PROTOCOL_VERSION) const
 
template<typename Stream >
void Serialize (Stream &s, int nType=0, int nVersion=PROTOCOL_VERSION) const
 
template<typename Stream >
void Unserialize (Stream &s, int nType=0, int nVersion=PROTOCOL_VERSION)
 
bool operator! () const
 
CBigNumoperator+= (const CBigNum &b)
 
CBigNumoperator-= (const CBigNum &b)
 
CBigNumoperator*= (const CBigNum &b)
 
CBigNumoperator/= (const CBigNum &b)
 
CBigNumoperator%= (const CBigNum &b)
 
CBigNumoperator<<= (unsigned int shift)
 
CBigNumoperator>>= (unsigned int shift)
 
CBigNumoperator++ ()
 
const CBigNum operator++ (int)
 
CBigNumoperator-- ()
 
const CBigNum operator-- (int)
 

Friends

const CBigNum operator- (const CBigNum &a, const CBigNum &b)
 
const CBigNum operator/ (const CBigNum &a, const CBigNum &b)
 
const CBigNum operator% (const CBigNum &a, const CBigNum &b)
 

Detailed Description

C++ wrapper for BIGNUM (OpenSSL bignum)

Definition at line 51 of file bignum.h.

Constructor & Destructor Documentation

CBigNum::CBigNum ( )
inline

Definition at line 54 of file bignum.h.

CBigNum::CBigNum ( const CBigNum b)
inline

Definition at line 59 of file bignum.h.

CBigNum::~CBigNum ( )
inline

Definition at line 76 of file bignum.h.

CBigNum::CBigNum ( signed char  n)
inline

Definition at line 82 of file bignum.h.

CBigNum::CBigNum ( short  n)
inline

Definition at line 83 of file bignum.h.

CBigNum::CBigNum ( int  n)
inline

Definition at line 84 of file bignum.h.

CBigNum::CBigNum ( long  n)
inline

Definition at line 85 of file bignum.h.

CBigNum::CBigNum ( int64  n)
inline

Definition at line 86 of file bignum.h.

CBigNum::CBigNum ( unsigned char  n)
inline

Definition at line 87 of file bignum.h.

CBigNum::CBigNum ( unsigned short  n)
inline

Definition at line 88 of file bignum.h.

CBigNum::CBigNum ( unsigned int  n)
inline

Definition at line 89 of file bignum.h.

CBigNum::CBigNum ( unsigned long  n)
inline

Definition at line 90 of file bignum.h.

CBigNum::CBigNum ( uint64  n)
inline

Definition at line 91 of file bignum.h.

CBigNum::CBigNum ( uint256  n)
inlineexplicit

Definition at line 92 of file bignum.h.

CBigNum::CBigNum ( const std::vector< unsigned char > &  vch)
inlineexplicit

Definition at line 94 of file bignum.h.

Member Function Documentation

unsigned int CBigNum::GetCompact ( ) const
inline

Definition at line 308 of file bignum.h.

std::string CBigNum::GetHex ( ) const
inline

Definition at line 388 of file bignum.h.

int CBigNum::getint ( ) const
inline

Definition at line 116 of file bignum.h.

unsigned int CBigNum::GetSerializeSize ( int  nType = 0,
int  nVersion = PROTOCOL_VERSION 
) const
inline

Definition at line 393 of file bignum.h.

unsigned int CBigNum::getuint ( ) const
inline

Definition at line 111 of file bignum.h.

uint256 CBigNum::getuint256 ( ) const
inline

Definition at line 225 of file bignum.h.

unsigned long CBigNum::getulong ( ) const
inline

Definition at line 106 of file bignum.h.

std::vector<unsigned char> CBigNum::getvch ( ) const
inline

Definition at line 255 of file bignum.h.

bool CBigNum::operator! ( ) const
inline

Definition at line 413 of file bignum.h.

CBigNum& CBigNum::operator%= ( const CBigNum b)
inline

Definition at line 445 of file bignum.h.

CBigNum& CBigNum::operator*= ( const CBigNum b)
inline

Definition at line 431 of file bignum.h.

CBigNum& CBigNum::operator++ ( )
inline

Definition at line 476 of file bignum.h.

const CBigNum CBigNum::operator++ ( int  )
inline

Definition at line 484 of file bignum.h.

CBigNum& CBigNum::operator+= ( const CBigNum b)
inline

Definition at line 418 of file bignum.h.

CBigNum& CBigNum::operator-- ( )
inline

Definition at line 492 of file bignum.h.

const CBigNum CBigNum::operator-- ( int  )
inline

Definition at line 502 of file bignum.h.

CBigNum& CBigNum::operator-= ( const CBigNum b)
inline

Definition at line 425 of file bignum.h.

CBigNum& CBigNum::operator/= ( const CBigNum b)
inline

Definition at line 439 of file bignum.h.

CBigNum& CBigNum::operator<<= ( unsigned int  shift)
inline

Definition at line 451 of file bignum.h.

CBigNum& CBigNum::operator= ( const CBigNum b)
inline

Definition at line 69 of file bignum.h.

CBigNum& CBigNum::operator>>= ( unsigned int  shift)
inline

Definition at line 458 of file bignum.h.

template<typename Stream >
void CBigNum::Serialize ( Stream &  s,
int  nType = 0,
int  nVersion = PROTOCOL_VERSION 
) const
inline

Definition at line 399 of file bignum.h.

CBigNum& CBigNum::SetCompact ( unsigned int  nCompact)
inline

Definition at line 289 of file bignum.h.

void CBigNum::SetHex ( const std::string &  str)
inline

Definition at line 332 of file bignum.h.

void CBigNum::setint64 ( int64  sn)
inline

Definition at line 125 of file bignum.h.

void CBigNum::setuint256 ( uint256  n)
inline

Definition at line 197 of file bignum.h.

void CBigNum::setuint64 ( uint64  n)
inline

Definition at line 170 of file bignum.h.

void CBigNum::setulong ( unsigned long  n)
inline

Definition at line 100 of file bignum.h.

void CBigNum::setvch ( const std::vector< unsigned char > &  vch)
inline

Definition at line 240 of file bignum.h.

std::string CBigNum::ToString ( int  nBase = 10) const
inline

Definition at line 362 of file bignum.h.

template<typename Stream >
void CBigNum::Unserialize ( Stream &  s,
int  nType = 0,
int  nVersion = PROTOCOL_VERSION 
)
inline

Definition at line 405 of file bignum.h.

Friends And Related Function Documentation

const CBigNum operator% ( const CBigNum a,
const CBigNum b 
)
friend

Definition at line 559 of file bignum.h.

const CBigNum operator- ( const CBigNum a,
const CBigNum b 
)
friend

Definition at line 526 of file bignum.h.

const CBigNum operator/ ( const CBigNum a,
const CBigNum b 
)
friend

Definition at line 550 of file bignum.h.


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