TARAXA
encoding_rlp.hpp File Reference
#include <libdevcore/RLP.h>
#include <optional>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  taraxa::util::RLPDecoderRef
 
struct  taraxa::util::InvalidEncodingSize
 

Namespaces

 taraxa
 
 taraxa::util
 

Macros

#define HAS_RLP_FIELDS
 
#define RLP_FIELDS_DEFINE(_class_, ...)
 
#define RLP_FIELDS_DEFINE_INPLACE(...)
 

Typedefs

using taraxa::util::RLPEncoderRef = dev::RLPStream &
 

Functions

template<typename... Params>
void taraxa::util::rlp_tuple (RLPEncoderRef encoding, Params const &... args)
 
template<typename T >
auto taraxa::util::rlp (RLPEncoderRef encoding, T const &target) -> decltype(RLP().toInt< T >(), void())
 
template<unsigned N>
void taraxa::util::rlp (RLPEncoderRef encoding, dev::FixedHash< N > const &target)
 
auto taraxa::util::rlp (RLPEncoderRef encoding, std::string const &target)
 
auto taraxa::util::rlp (RLPEncoderRef encoding, dev::bytes const &target)
 
template<typename Param >
void taraxa::util::rlp (RLPEncoderRef encoding, std::optional< Param > const &target)
 
template<typename Param >
void taraxa::util::rlp (RLPEncoderRef encoding, std::shared_ptr< Param > const &target)
 
template<typename T1 , typename T2 >
void taraxa::util::rlp (RLPEncoderRef encoding, std::pair< T1, T2 > const &target)
 
template<typename Sequence >
auto taraxa::util::rlp (RLPEncoderRef encoding, Sequence const &target) -> decltype(target.size(), target.begin(), target.end(), void())
 
template<typename Param , typename... Params>
void taraxa::util::__enc_rlp_tuple_body__ (RLPEncoderRef encoding, Param const &target, Params const &... rest)
 
template<typename... Params>
void taraxa::util::rlp_tuple (RLPDecoderRef encoding, Params &... args)
 
template<typename T >
auto taraxa::util::rlp (RLPDecoderRef encoding, T &target) -> decltype(encoding.value.toInt< T >(), void())
 
template<unsigned N>
void taraxa::util::rlp (RLPDecoderRef encoding, dev::FixedHash< N > &target)
 
auto taraxa::util::rlp (RLPDecoderRef encoding, std::string &target)
 
auto taraxa::util::rlp (RLPDecoderRef encoding, dev::bytes &target)
 
template<typename Param >
void taraxa::util::rlp (RLPDecoderRef encoding, std::optional< Param > &target)
 
template<typename Param >
void taraxa::util::rlp (RLPDecoderRef encoding, std::shared_ptr< Param > &target)
 
template<typename Sequence >
auto taraxa::util::rlp (RLPDecoderRef encoding, Sequence &target) -> decltype(target.emplace_back(), void())
 
void taraxa::util::rlp (RLPDecoderRef encoding, bool &target)
 
template<typename Map >
auto taraxa::util::rlp (RLPDecoderRef encoding, Map &target) -> decltype(target[target.begin() ->first], void())
 
template<typename Param , typename... Params>
void taraxa::util::__dec_rlp_tuple_body__ (RLP::iterator &i, RLP::iterator const &end, RLP::Strictness strictness, Param &target, Params &... rest)
 
template<typename T >
taraxa::util::rlp_dec (RLPDecoderRef encoding)
 
template<typename T >
dev::bytes const & taraxa::util::rlp_enc (RLPEncoderRef encoder_to_reuse, T const &obj)
 
template<typename T >
dev::bytes taraxa::util::rlp_enc (T const &obj)
 

Macro Definition Documentation

◆ HAS_RLP_FIELDS

#define HAS_RLP_FIELDS
Value:
void rlp(::taraxa::util::RLPDecoderRef encoding); \
void rlp(::taraxa::util::RLPEncoderRef encoding) const;
Class for writing to an RLP bytestream.
Definition: RLP.h:484
auto rlp(RLPDecoderRef encoding, Map &target) -> decltype(target[target.begin() ->first], void())
Definition: encoding_rlp.hpp:140
Definition: encoding_rlp.hpp:11

◆ RLP_FIELDS_DEFINE

#define RLP_FIELDS_DEFINE (   _class_,
  ... 
)
Value:
void _class_::rlp(::taraxa::util::RLPDecoderRef encoding) { ::taraxa::util::rlp_tuple(encoding, __VA_ARGS__); } \
void _class_::rlp(::taraxa::util::RLPEncoderRef encoding) const { ::taraxa::util::rlp_tuple(encoding, __VA_ARGS__); }
void rlp_tuple(RLPDecoderRef encoding, Params &... args)
Definition: encoding_rlp.hpp:173

◆ RLP_FIELDS_DEFINE_INPLACE

#define RLP_FIELDS_DEFINE_INPLACE (   ...)
Value:
void rlp(::taraxa::util::RLPDecoderRef encoding) { ::taraxa::util::rlp_tuple(encoding, __VA_ARGS__); } \
void rlp(::taraxa::util::RLPEncoderRef encoding) const { ::taraxa::util::rlp_tuple(encoding, __VA_ARGS__); }