Ethereum  PoC-8
The C++ Implementation of Ethereum
dev::RLPStream Class Reference

Class for writing to an RLP bytestream. More...

#include <RLP.h>

Public Member Functions

 RLPStream ()
 Initializes empty RLPStream. More...
 
 RLPStream (size_t _listItems)
 Initializes the RLPStream as a list of _listItems items. More...
 
 ~RLPStream ()
 
RLPStreamappend (unsigned _s)
 Append given datum to the byte stream. More...
 
RLPStreamappend (u160 _s)
 
RLPStreamappend (u256 _s)
 
RLPStreamappend (bigint _s)
 
RLPStreamappend (bytesConstRef _s, bool _compact=false)
 
RLPStreamappend (bytes const &_s)
 
RLPStreamappend (std::string const &_s)
 
RLPStreamappend (char const *_s)
 
template<unsigned N>
RLPStreamappend (FixedHash< N > _s, bool _compact=false, bool _allOrNothing=false)
 
RLPStreamappend (RLP const &_rlp, size_t _itemCount=1)
 Appends an arbitrary RLP fragment - this must be a single item unless _itemCount is given. More...
 
template<class _T >
RLPStreamappend (std::vector< _T > const &_s)
 Appends a sequence of data to the stream as a list. More...
 
template<class _T >
RLPStreamappendVector (std::vector< _T > const &_s)
 
template<class _T , size_t S>
RLPStreamappend (std::array< _T, S > const &_s)
 
template<class _T >
RLPStreamappend (std::set< _T > const &_s)
 
template<class _T >
RLPStreamappend (std::unordered_set< _T > const &_s)
 
template<class T , class U >
RLPStreamappend (std::pair< T, U > const &_s)
 
RLPStreamappendList (size_t _items)
 Appends a list. More...
 
RLPStreamappendList (bytesConstRef _rlp)
 
RLPStreamappendList (bytes const &_rlp)
 
RLPStreamappendList (RLPStream const &_s)
 
RLPStreamappendRaw (bytesConstRef _rlp, size_t _itemCount=1)
 Appends raw (pre-serialised) RLP data. Use with caution. More...
 
RLPStreamappendRaw (bytes const &_rlp, size_t _itemCount=1)
 
template<class T >
RLPStreamoperator<< (T _data)
 Shift operators for appending data items. More...
 
void clear ()
 Clear the output stream so far. More...
 
bytes const & out () const
 Read the byte stream. More...
 
bytes && invalidate ()
 Invalidate the object and steal the output byte stream. More...
 
void swapOut (bytes &_dest)
 Swap the contents of the output stream out for some other byte array. More...
 

Detailed Description

Class for writing to an RLP bytestream.

Definition at line 369 of file RLP.h.

Constructor & Destructor Documentation

◆ RLPStream() [1/2]

dev::RLPStream::RLPStream ( )
inline

Initializes empty RLPStream.

Definition at line 373 of file RLP.h.

◆ RLPStream() [2/2]

dev::RLPStream::RLPStream ( size_t  _listItems)
inlineexplicit

Initializes the RLPStream as a list of _listItems items.

Definition at line 376 of file RLP.h.

◆ ~RLPStream()

dev::RLPStream::~RLPStream ( )
inline

Definition at line 378 of file RLP.h.

Member Function Documentation

◆ append() [1/15]

RLPStream & RLPStream::append ( bigint  _s)

Definition at line 309 of file RLP.cpp.

◆ append() [2/15]

RLPStream& dev::RLPStream::append ( bytes const &  _s)
inline

Definition at line 386 of file RLP.h.

◆ append() [3/15]

RLPStream & RLPStream::append ( bytesConstRef  _s,
bool  _compact = false 
)

Definition at line 288 of file RLP.cpp.

◆ append() [4/15]

RLPStream& dev::RLPStream::append ( char const *  _s)
inline

Definition at line 388 of file RLP.h.

◆ append() [5/15]

template<unsigned N>
RLPStream& dev::RLPStream::append ( FixedHash< N >  _s,
bool  _compact = false,
bool  _allOrNothing = false 
)
inline

Definition at line 389 of file RLP.h.

◆ append() [6/15]

RLPStream& dev::RLPStream::append ( RLP const &  _rlp,
size_t  _itemCount = 1 
)
inline

Appends an arbitrary RLP fragment - this must be a single item unless _itemCount is given.

Definition at line 392 of file RLP.h.

◆ append() [7/15]

template<class _T , size_t S>
RLPStream& dev::RLPStream::append ( std::array< _T, S > const &  _s)
inline

Definition at line 397 of file RLP.h.

◆ append() [8/15]

template<class T , class U >
RLPStream& dev::RLPStream::append ( std::pair< T, U > const &  _s)
inline

Definition at line 400 of file RLP.h.

◆ append() [9/15]

template<class _T >
RLPStream& dev::RLPStream::append ( std::set< _T > const &  _s)
inline

Definition at line 398 of file RLP.h.

◆ append() [10/15]

RLPStream& dev::RLPStream::append ( std::string const &  _s)
inline

Definition at line 387 of file RLP.h.

◆ append() [11/15]

template<class _T >
RLPStream& dev::RLPStream::append ( std::unordered_set< _T > const &  _s)
inline

Definition at line 399 of file RLP.h.

◆ append() [12/15]

template<class _T >
RLPStream& dev::RLPStream::append ( std::vector< _T > const &  _s)
inline

Appends a sequence of data to the stream as a list.

Definition at line 395 of file RLP.h.

◆ append() [13/15]

RLPStream& dev::RLPStream::append ( u160  _s)
inline

Definition at line 382 of file RLP.h.

◆ append() [14/15]

RLPStream& dev::RLPStream::append ( u256  _s)
inline

Definition at line 383 of file RLP.h.

◆ append() [15/15]

RLPStream& dev::RLPStream::append ( unsigned  _s)
inline

Append given datum to the byte stream.

Definition at line 381 of file RLP.h.

◆ appendList() [1/4]

RLPStream& dev::RLPStream::appendList ( bytes const &  _rlp)
inline

Definition at line 405 of file RLP.h.

◆ appendList() [2/4]

RLPStream & RLPStream::appendList ( bytesConstRef  _rlp)

Definition at line 278 of file RLP.cpp.

◆ appendList() [3/4]

RLPStream& dev::RLPStream::appendList ( RLPStream const &  _s)
inline

Definition at line 406 of file RLP.h.

◆ appendList() [4/4]

RLPStream & RLPStream::appendList ( size_t  _items)

Appends a list.

Definition at line 268 of file RLP.cpp.

◆ appendRaw() [1/2]

RLPStream& dev::RLPStream::appendRaw ( bytes const &  _rlp,
size_t  _itemCount = 1 
)
inline

Definition at line 410 of file RLP.h.

◆ appendRaw() [2/2]

RLPStream & RLPStream::appendRaw ( bytesConstRef  _rlp,
size_t  _itemCount = 1 
)

Appends raw (pre-serialised) RLP data. Use with caution.

Definition at line 222 of file RLP.cpp.

◆ appendVector()

template<class _T >
RLPStream& dev::RLPStream::appendVector ( std::vector< _T > const &  _s)
inline

Definition at line 396 of file RLP.h.

◆ clear()

void dev::RLPStream::clear ( )
inline

Clear the output stream so far.

Definition at line 416 of file RLP.h.

◆ invalidate()

bytes&& dev::RLPStream::invalidate ( )
inline

Invalidate the object and steal the output byte stream.

Definition at line 422 of file RLP.h.

◆ operator<<()

template<class T >
RLPStream& dev::RLPStream::operator<< ( _data)
inline

Shift operators for appending data items.

Definition at line 413 of file RLP.h.

◆ out()

bytes const& dev::RLPStream::out ( ) const
inline

Read the byte stream.

Definition at line 419 of file RLP.h.

◆ swapOut()

void dev::RLPStream::swapOut ( bytes _dest)
inline

Swap the contents of the output stream out for some other byte array.

Definition at line 425 of file RLP.h.


The documentation for this class was generated from the following files: