Class List > signed_int

Variable Length Signed Integer. More...

Public Attributes

Type Name
int32_t value
Contained value.

Public Functions

Type Name
signed_int (int32_t v = 0)
Construct a new signed int object.
operator int32_t () const
Conversion operator.
signed_int & operator= (const T & v)
Assignment operator.
signed_int operator++ (int)
Increment operator.
signed_int & operator++ ()
Increment 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 signed_int object with as few bytes as possible.
friend DataStream & operator>>
Deserialize an signed_int object.

Detailed Description

Variable Length Signed Integer. This provides more efficient serialization of 32-bit signed int. It serializes a 32-bit signed integer in as few bytes as possible. `varint32' is signed and uses Zig-Zag encoding

Public Attributes Documentation

variable value

int32_t signed_int::value;

Contained value.

Contained value

Public Functions Documentation

function signed_int

signed_int::signed_int(
    int32_t v = 0
)

Construct a new signed int object.

Construct a new signed int object

Parameters:

  • v - Source

function operator int32_t

signed_int::operator int32_t() const

Conversion operator.

Convert signed_int to primitive 32-bit signed integer

Returns:

int32_t - The converted result

function operator=

template<typename T>
signed_int& signed_int::operator=(
    const T & v
)

Assignment operator.

Assign an object that is convertible to int32_t

Template parameters:

  • T - Type of the assignment object

Parameters:

  • v - Source

Returns:

unsigned_int& - Reference to this object

function operator++ (1/2)

signed_int signed_int::operator++(
    int 
)

Increment operator.

Increment operator

Returns:

signed_int - New signed_int with value incremented from the current object's value

function operator++ (2/2)

signed_int& signed_int::operator++()

Increment operator.

Increment operator

Returns:

signed_int - Reference to current object

Friends Documentation

friend operator== (1/3)

bool operator==(
    const signed_int & i,
    const int32_t & v
)

Equality Operator.

Check equality between a signed_int object and 32-bit integer

Parameters:

  • i - signed_int object to compare
  • v - 32-bit integer to compare

Returns:

true - if equal

Returns:

false - otherwise

friend operator== (2/3)

bool operator==(
    const int32_t & i,
    const signed_int & v
)

Equality Operator.

Check equality between 32-bit integer and a signed_int object

Parameters:

  • i - 32-bit integer to compare
  • v - signed_int object to compare

Returns:

true - if equal

Returns:

false - otherwise

friend operator== (3/3)

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

Equality Operator.

Check equality between two signed_int objects

Parameters:

Returns:

true - if equal

Returns:

false - otherwise

friend operator!= (1/3)

bool operator!=(
    const signed_int & i,
    const int32_t & v
)

Inequality Operator.

Check inequality between a signed_int object and 32-bit integer

Parameters:

  • i - signed_int object to compare
  • v - 32-bit integer to compare

Returns:

true - if inequal

Returns:

false - otherwise

friend operator!= (2/3)

bool operator!=(
    const int32_t & i,
    const signed_int & v
)

Equality Operator.

Check inequality between 32-bit integer and a signed_int object

Parameters:

  • i - 32-bit integer to compare
  • v - signed_int object to compare

Returns:

true - if unequal

Returns:

false - otherwise

friend operator!= (3/3)

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

Inequality Operator.

Check inequality between two signed_int objects

Parameters:

Returns:

true - if inequal

Returns:

false - otherwise

friend operator< (1/3)

bool operator<(
    const signed_int & i,
    const int32_t & v
)

Less than Operator.

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

Parameters:

  • i - signed_int object to compare
  • v - 32-bit integer to compare

Returns:

true - if i less than v

Returns:

false - otherwise

friend operator< (2/3)

bool operator<(
    const int32_t & i,
    const signed_int & v
)

Less than Operator.

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

Parameters:

  • i - 32-bit integer to compare
  • v - signed_int object to compare

Returns:

true - if i less than v

Returns:

false - otherwise

friend operator< (3/3)

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

Less than Operator.

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

Parameters:

Returns:

true - if i less than v

Returns:

false - otherwise

friend operator>= (1/3)

bool operator>=(
    const signed_int & i,
    const int32_t & v
)

Greater or Equal to Operator.

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

Parameters:

  • i - signed_int object to compare
  • v - 32-bit integer to compare

Returns:

true - if i is greater or equal to v

Returns:

false - otherwise

friend operator>= (2/3)

bool operator>=(
    const int32_t & i,
    const signed_int & v
)

Greater or Equal to Operator.

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

Parameters:

  • i - 32-bit integer to compare
  • v - signed_int object to compare

Returns:

true - if i is greater or equal to v

Returns:

false - otherwise

friend operator>= (3/3)

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

Greater or Equal to Operator.

Check if the first given signed_int is greater or equal to the second given signed_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 signed_int & v
)

Serialize an signed_int object with as few bytes as possible.

Serialize an signed_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,
    signed_int & vi
)

Deserialize an signed_int object.

Deserialize an signed_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