Equity
Bitcoin Protocol Library
|
Classes | |
class | BitArray |
An array of bits. More... | |
class | DeserializationError |
Exception thrown for a deserialization error. More... | |
struct | DeserializeArrayImpl |
A helper class for deserialization of an std::array. More... | |
struct | DeserializeArrayImpl< std::array< uint8_t, N > > |
A helper class for deserialization of a std::array of uint8_t. More... | |
struct | InvalidMessageError |
Thrown by a message constructor if the data in the message is invalid. More... | |
class | Message |
A P2P network message. More... | |
class | Peer |
class | Serializable |
An abstract class that enables an object to be serialized by the serialization functions. More... | |
struct | SerializeArrayImpl |
A helper class for serialization of an std::array. More... | |
struct | SerializeArrayImpl< uint8_t, N > |
A helper class for serialization of an std::array of uint8_t. More... | |
struct | ToJsonArrayImpl |
A helper class for converting an std::array to JSON. More... | |
struct | ToJsonArrayImpl< uint8_t, N > |
A helper class for converting an std::array<uint8_t, N> to JSON. More... | |
class | VarArray |
An array of objects. More... | |
class | VarArray< std::array< T, N > > |
An array of std::array. More... | |
class | VarArray< uint8_t > |
An array of uint8_t. More... | |
class | VarString |
A variable-length string. More... | |
class | VASize |
A compressed 64-bit value. More... | |
Functions | |
void | serialize (uint8_t const &a, std::vector< uint8_t > &out) |
Serializes a uint8_t. More... | |
void | serialize (uint16_t const &a, std::vector< uint8_t > &out) |
Serializes a uint16_t. More... | |
void | serialize (uint32_t const &a, std::vector< uint8_t > &out) |
Serializes a uint32_t. More... | |
void | serialize (uint64_t const &a, std::vector< uint8_t > &out) |
Serializes a uint64_t. More... | |
void | serialize (std::string const &s, std::vector< uint8_t > &out) |
Serializes an std::string. More... | |
void | serialize (char const *s, std::vector< uint8_t > &out) |
Serializes a string. More... | |
template<> | |
void | serialize< uint8_t > (std::vector< uint8_t > const &a, std::vector< uint8_t > &out) |
Serializes a vector of uint8_t. More... | |
template<> | |
uint8_t | deserialize< uint8_t > (uint8_t const *&in, size_t &size) |
Deserializes a uint8_t. More... | |
template<> | |
uint16_t | deserialize< uint16_t > (uint8_t const *&in, size_t &size) |
Deserializes a uint16_t. More... | |
template<> | |
uint32_t | deserialize< uint32_t > (uint8_t const *&in, size_t &size) |
Deserializes a uint32_t. More... | |
template<> | |
uint64_t | deserialize< uint64_t > (uint8_t const *&in, size_t &size) |
Deserializes a uint64_t. More... | |
template<> | |
std::vector< uint8_t > | deserializeVector< uint8_t > (size_t n, uint8_t const *&in, size_t &size) |
Deserializes a vector of uint8_t. More... | |
std::string | deserializeString (size_t n, uint8_t const *&in, size_t &size) |
Deserializes a string. More... | |
template<> | |
json | toJson (std::vector< uint8_t > const &v) |
Converts a std::vector<uint8_t> to a JSON hex string toJson. More... | |
void | serialize (Serializable const &a, std::vector< uint8_t > &out) |
Serializes a Serializable. More... | |
template<typename T > | |
void | serialize (std::vector< T > const &v, std::vector< uint8_t > &out) |
Serializes an std::vector. More... | |
template<typename T , size_t N> | |
void | serialize (std::vector< std::array< T, N > > const &v, std::vector< uint8_t > &out) |
Serializes a vector of std::array. More... | |
template<typename T , size_t N> | |
void | serialize (std::array< T, N > const &a, std::vector< uint8_t > &out) |
Serializes an std::array. More... | |
json | toJson (Serializable const &x) |
Converts a Serializable to JSON object. More... | |
template<typename T > | |
json | toJson (T const *v, size_t size) |
Converts a generic array to a JSON array value toJson. More... | |
template<typename T > | |
json | toJson (std::vector< T > const &v) |
Converts a std::vector to a JSON array value toJson. More... | |
template<typename T , size_t N> | |
json | toJson (std::array< T, N > const &a) |
Converts a generic std::array to a JSON array value. More... | |
template<typename T > | |
T | deserialize (uint8_t const *&in, size_t &size) |
Deserializes an object with a deserialization constructor. More... | |
template<typename T > | |
std::vector< T > | deserializeVector (size_t n, uint8_t const *&in, size_t &size) |
Deserializes a vector. More... | |
template<typename T > | |
T | deserializeArray (uint8_t const *&in, size_t &size) |
Deserializes an std::array. More... | |
template<typename T , size_t N> | |
std::vector< std::array< T, N > > | deserializeVector (size_t n, uint8_t const *&in, size_t &size) |
Deserializes a vector of std::array. More... | |
T P2p::deserialize | ( | uint8_t const *& | in, |
size_t & | size | ||
) |
Deserializes an object with a deserialization constructor.
[in,out] | in | pointer to the next byte to deserialize |
[in,out] | size | number of bytes remaining in the serialized stream |
uint16_t P2p::deserialize< uint16_t > | ( | uint8_t const *& | in, |
size_t & | size | ||
) |
Deserializes a uint16_t.
[in,out] | in | pointer to the next byte to deserialize |
[in,out] | size | number of bytes remaining in the serialized stream |
uint32_t P2p::deserialize< uint32_t > | ( | uint8_t const *& | in, |
size_t & | size | ||
) |
Deserializes a uint32_t.
[in,out] | in | pointer to the next byte to deserialize |
[in,out] | size | number of bytes remaining in the serialized stream |
uint64_t P2p::deserialize< uint64_t > | ( | uint8_t const *& | in, |
size_t & | size | ||
) |
Deserializes a uint64_t.
[in,out] | in | pointer to the next byte to deserialize |
[in,out] | size | number of bytes remaining in the serialized stream |
uint8_t P2p::deserialize< uint8_t > | ( | uint8_t const *& | in, |
size_t & | size | ||
) |
Deserializes a uint8_t.
[in,out] | in | pointer to the next byte to deserialize |
[in,out] | size | number of bytes remaining in the serialized stream |
T P2p::deserializeArray | ( | uint8_t const *& | in, |
size_t & | size | ||
) |
Deserializes an std::array.
[in,out] | in | pointer to the next byte to deserialize |
[in,out] | size | number of bytes remaining in the serialized stream |
std::string P2p::deserializeString | ( | size_t | n, |
uint8_t const *& | in, | ||
size_t & | size | ||
) |
Deserializes a string.
n | Number of characters to deserialize | |
[in,out] | in | pointer to the next byte to deserialize |
[in,out] | size | number of bytes remaining in the serialized stream |
std::vector< T > P2p::deserializeVector | ( | size_t | n, |
uint8_t const *& | in, | ||
size_t & | size | ||
) |
Deserializes a vector.
n | Number of elements to deserialize | |
[in,out] | in | pointer to the next byte to deserialize |
[in,out] | size | number of bytes remaining in the serialized stream |
std::vector< std::array< T, N > > P2p::deserializeVector | ( | size_t | n, |
uint8_t const *& | in, | ||
size_t & | size | ||
) |
Deserializes a vector of std::array.
n | Number of std::array to deserialize | |
[in,out] | in | pointer to the next byte to deserialize |
[in,out] | size | number of bytes remaining in the serialized stream |
std::vector< uint8_t > P2p::deserializeVector< uint8_t > | ( | size_t | n, |
uint8_t const *& | in, | ||
size_t & | size | ||
) |
Deserializes a vector of uint8_t.
n | Number of uint8_t to deserialize | |
[in,out] | in | pointer to the next byte to deserialize |
[in,out] | size | number of bytes remaining in the serialized stream |
void P2p::serialize | ( | uint8_t const & | a, |
std::vector< uint8_t > & | out | ||
) |
Serializes a uint8_t.
a | value to be serialized |
out | destination |
void P2p::serialize | ( | uint16_t const & | a, |
std::vector< uint8_t > & | out | ||
) |
Serializes a uint16_t.
a | value to be serialized |
out | destination |
void P2p::serialize | ( | uint32_t const & | a, |
std::vector< uint8_t > & | out | ||
) |
Serializes a uint32_t.
a | value to be serialized |
out | destination |
void P2p::serialize | ( | uint64_t const & | a, |
std::vector< uint8_t > & | out | ||
) |
Serializes a uint64_t.
a | value to be serialized |
out | destination |
void P2p::serialize | ( | std::string const & | s, |
std::vector< uint8_t > & | out | ||
) |
Serializes an std::string.
s | std::string to be serialized |
out | destination |
void P2p::serialize | ( | char const * | s, |
std::vector< uint8_t > & | out | ||
) |
Serializes a string.
s | string to be serialized |
out | destination |
|
inline |
Serializes a Serializable.
a | object to be serialized |
out | destination |
void P2p::serialize | ( | std::vector< T > const & | v, |
std::vector< uint8_t > & | out | ||
) |
Serializes an std::vector.
v | std::vector to be serialized |
out | destination |
void P2p::serialize | ( | std::vector< std::array< T, N > > const & | v, |
std::vector< uint8_t > & | out | ||
) |
Serializes a vector of std::array.
v | std::vector to be serialized |
out | destination |
void P2p::serialize | ( | std::array< T, N > const & | a, |
std::vector< uint8_t > & | out | ||
) |
Serializes an std::array.
a | std::array to be serialized |
out | destination |
void P2p::serialize< uint8_t > | ( | std::vector< uint8_t > const & | a, |
std::vector< uint8_t > & | out | ||
) |
Serializes a vector of uint8_t.
a | std::vector to be serialized |
out | destination |
json P2p::toJson | ( | std::vector< uint8_t > const & | v | ) |
Converts a std::vector<uint8_t> to a JSON hex string toJson.
v |
|
inline |
Converts a Serializable to JSON object.
x | object to be serialized |
json P2p::toJson | ( | T const * | v, |
size_t | size | ||
) |
Converts a generic array to a JSON array value toJson.
v | pointer to array |
size | number of elements in the array |
json P2p::toJson | ( | std::vector< T > const & | v | ) |
Converts a std::vector to a JSON array value toJson.
v | std::vector to be serialized |
json P2p::toJson | ( | std::array< T, N > const & | a | ) |
Converts a generic std::array to a JSON array value.
a | std::array to be serialized |