piranha  0.10
Public Member Functions | List of all members
piranha::msgpack_pack_impl< Stream, mp_integer< SSize >, mp_integer_msgpack_pack_enabler< Stream > > Struct Template Reference

Specialisation of piranha::msgpack_pack() for piranha::mp_integer. More...

#include <piranha/mp_integer.hpp>

Public Member Functions

void operator() (msgpack::packer< Stream > &p, const mp_integer< SSize > &n, msgpack_format f) const
 Call operator. More...
 

Detailed Description

template<typename Stream, std::size_t SSize>
struct piranha::msgpack_pack_impl< Stream, mp_integer< SSize >, mp_integer_msgpack_pack_enabler< Stream > >

Specialisation of piranha::msgpack_pack() for piranha::mp_integer.

Note
This specialisation is enabled only if:

Definition at line 822 of file mp_integer.hpp.

Member Function Documentation

◆ operator()()

template<typename Stream , std::size_t SSize>
void piranha::msgpack_pack_impl< Stream, mp_integer< SSize >, mp_integer_msgpack_pack_enabler< Stream > >::operator() ( msgpack::packer< Stream > &  p,
const mp_integer< SSize > &  n,
msgpack_format  f 
) const
inline

Call operator.

If the serialization format f is msgpack_format::portable, then a decimal string representation of the integer is packed. Otherwise, an array of 3 elements is packed: the first element is a boolean representing whether the integer is stored in static storage or not, the second element is a boolean representing the sign of the integer (true for positive or zero, false for negative) and the last element is an array of limbs.

Parameters
ptarget msgpack::packer.
nthe input piranha::mp_integer.
fthe desired piranha::msgpack_format.
Exceptions
std::overflow_errorif the number of limbs is larger than an implementation-defined value.
unspecifiedany exception thrown by:
  • the public interface of msgpack::packer,
  • memory errors in standard containers,
  • piranha::msgpack_pack(),
  • the conversion of n to string.

Definition at line 842 of file mp_integer.hpp.


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