Class List > unsigned_int

Variable Length Unsigned Integer. More...

Public Attributes

Type Name
uint32_t value
Contained value.

Public Functions

Type Name
unsigned_int (uint32_t v = 0)
Construct a new unsigned int object.
unsigned_int (T v)
Construct a new unsigned int object.
operator T () const
Conversion Operator.
unsigned_int & operator= (uint32_t v)
Assignment operator.

Friends

Type Name
friend bool operator==
Equality Operator.
friend bool operator==
Equality Operator.
friend bool operator==
Equality Operator.
friend bool operator!=
Inequality Operator.
friend bool operator!=
Equality Operator.
friend bool operator!=
Inequality Operator.
friend bool operator<
Less than Operator.
friend bool operator<
Less than Operator.
friend bool operator<
Less than Operator.
friend bool operator>=
Greater or Equal to Operator.
friend bool operator>=
Greater or Equal to Operator.
friend bool operator>=
Greater or Equal to Operator.
friend DataStream & operator<<
Serialize an unsigned_int object with as few bytes as possible.
friend DataStream & operator>>
Deserialize an unsigned_int object.

Detailed Description

Variable Length Unsigned Integer. This provides more efficient serialization of 32-bit unsigned int. It serialuzes a 32-bit unsigned integer in as few bytes as possible varuint32 is unsigned and uses VLQ or Base-128 encoding

Public Attributes Documentation

variable value

uint32_t unsigned_int::value;

Contained value.

Contained value

Public Functions Documentation

function unsigned_int (1/2)

unsigned_int::unsigned_int(
    uint32_t v = 0
)

Construct a new unsigned int object.

Construct a new unsigned int object

Parameters:

  • v - Source

function unsigned_int (2/2)

template<typename T>
unsigned_int::unsigned_int(
    T v
)

Construct a new unsigned int object.

Construct a new unsigned int object from a type that is convertible to uint32_t

Template parameters:

  • T - Type of the source

Parameters:

  • v - Source

Precondition:

T must be convertible to uint32_t

function operator T

template<typename T>
unsigned_int::operator T() const

Conversion Operator.

Convert unsigned_int as T

Template parameters:

  • T - Target type of conversion

Returns:

T - Converted target

function operator=

unsigned_int& unsigned_int::operator=(
    uint32_t v
)

Assignment operator.

Assign 32-bit unsigned integer

Parameters:

  • v - Soruce

Returns:

unsigned_int& - Reference to this object

Friends Documentation

friend operator== (1/3)

bool operator==(
    const unsigned_int & i,
    const uint32_t & v
)

Equality Operator.

Check equality between a unsigned_int object and 32-bit unsigned integer

Parameters:

  • i - unsigned_int object to compare
  • v - 32-bit unsigned integer to compare

Returns:

true - if equal

Returns:

false - otherwise

friend operator== (2/3)

bool operator==(
    const uint32_t & i,
    const unsigned_int & v
)

Equality Operator.

Check equality between 32-bit unsigned integer and a unsigned_int object

Parameters:

  • i - 32-bit unsigned integer to compare
  • v - unsigned_int object to compare

Returns:

true - if equal

Returns:

false - otherwise

friend operator== (3/3)

bool operator==(
    const unsigned_int & i,
    const unsigned_int & v
)

Equality Operator.

Check equality between two unsigned_int objects

Parameters:

Returns:

true - if equal

Returns:

false - otherwise

friend operator!= (1/3)

bool operator!=(
    const unsigned_int & i,
    const uint32_t & v
)

Inequality Operator.

Check inequality between a unsigned_int object and 32-bit unsigned integer

Parameters:

  • i - unsigned_int object to compare
  • v - 32-bit unsigned integer to compare

Returns:

true - if inequal

Returns:

false - otherwise

friend operator!= (2/3)

bool operator!=(
    const uint32_t & i,
    const unsigned_int & v
)

Equality Operator.

Check inequality between 32-bit unsigned integer and a unsigned_int object

Parameters:

  • i - 32-bit unsigned integer to compare
  • v - unsigned_int object to compare

Returns:

true - if unequal

Returns:

false - otherwise

friend operator!= (3/3)

bool operator!=(
    const unsigned_int & i,
    const unsigned_int & v
)

Inequality Operator.

Check inequality between two unsigned_int objects

Parameters:

Returns:

true - if inequal

Returns:

false - otherwise

friend operator< (1/3)

bool operator<(
    const unsigned_int & i,
    const uint32_t & v
)

Less than Operator.

Check if the given unsigned_int object is less than the given 32-bit unsigned integer

Parameters:

  • i - unsigned_int object to compare
  • v - 32-bit unsigned integer to compare

Returns:

true - if i less than v

Returns:

false - otherwise

friend operator< (2/3)

bool operator<(
    const uint32_t & i,
    const unsigned_int & v
)

Less than Operator.

Check if the given 32-bit unsigned integer is less than the given unsigned_int object

Parameters:

  • i - 32-bit unsigned integer to compare
  • v - unsigned_int object to compare

Returns:

true - if i less than v

Returns:

false - otherwise

friend operator< (3/3)

bool operator<(
    const unsigned_int & i,
    const unsigned_int & v
)

Less than Operator.

Check if the first given unsigned_int is less than the second given unsigned_int object

Parameters:

Returns:

true - if i less than v

Returns:

false - otherwise

friend operator>= (1/3)

bool operator>=(
    const unsigned_int & i,
    const uint32_t & v
)

Greater or Equal to Operator.

Check if the given unsigned_int object is greater or equal to the given 32-bit unsigned integer

Parameters:

  • i - unsigned_int object to compare
  • v - 32-bit unsigned integer to compare

Returns:

true - if i is greater or equal to v

Returns:

false - otherwise

friend operator>= (2/3)

bool operator>=(
    const uint32_t & i,
    const unsigned_int & v
)

Greater or Equal to Operator.

Check if the given 32-bit unsigned integer is greater or equal to the given unsigned_int object

Parameters:

  • i - 32-bit unsigned integer to compare
  • v - unsigned_int object to compare

Returns:

true - if i is greater or equal to v

Returns:

false - otherwise

friend operator>= (3/3)

bool operator>=(
    const unsigned_int & i,
    const unsigned_int & v
)

Greater or Equal to Operator.

Check if the first given unsigned_int is greater or equal to the second given unsigned_int object

Parameters:

Returns:

true - if i is greater or equal to v

Returns:

false - otherwise

friend operator<<

template<typename DataStream>
DataStream& operator<<(
    DataStream & ds,
    const unsigned_int & v
)

Serialize an unsigned_int object with as few bytes as possible.

Serialize an unsigned_int object with as few bytes as possible

Parameters:

  • ds - The stream to write
  • v - The value to serialize

Template parameters:

  • DataStream - Type of datastream

Returns:

DataStream& - Reference to the datastream

friend operator>>

template<typename DataStream>
DataStream& operator>>(
    DataStream & ds,
    unsigned_int & vi
)

Deserialize an unsigned_int object.

Deserialize an unsigned_int object

Parameters:

  • ds - The stream to read
  • vi - The destination for deserialized value

Template parameters:

  • DataStream - Type of datastream

Returns:

DataStream& - Reference to the datastream


The documentation for this class was generated from the following file: libraries/eosiolib/varint.hpp