BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
Public Member Functions | List of all members
fc::datastream< T > Class Template Reference

#include <datastream.hpp>

Public Member Functions

 datastream (T start, size_t s)
 
void skip (size_t s)
 
bool read (char *d, size_t s)
 
bool write (const char *d, size_t s)
 
bool put (char c)
 
bool get (unsigned char &c)
 
bool get (char &c)
 
pos () const
 
bool valid () const
 
bool seekp (size_t p)
 
size_t tellp () const
 
size_t remaining () const
 

Detailed Description

template<typename T>
class fc::datastream< T >

The purpose of this datastream is to provide a fast, effecient, means of calculating the amount of data "about to be written" and then writing it. This means having two modes of operation, "test run" where you call the entire pack sequence calculating the size, and then actually packing it after doing a single allocation.

Definition at line 20 of file datastream.hpp.

Constructor & Destructor Documentation

◆ datastream()

template<typename T >
fc::datastream< T >::datastream ( start,
size_t  s 
)
inline

Definition at line 22 of file datastream.hpp.

Member Function Documentation

◆ get() [1/2]

template<typename T >
bool fc::datastream< T >::get ( char &  c)
inline

Definition at line 55 of file datastream.hpp.

◆ get() [2/2]

template<typename T >
bool fc::datastream< T >::get ( unsigned char &  c)
inline

Definition at line 54 of file datastream.hpp.

◆ pos()

template<typename T >
T fc::datastream< T >::pos ( ) const
inline

Definition at line 65 of file datastream.hpp.

◆ put()

template<typename T >
bool fc::datastream< T >::put ( char  c)
inline

Definition at line 45 of file datastream.hpp.

◆ read()

template<typename T >
bool fc::datastream< T >::read ( char *  d,
size_t  s 
)
inline

Definition at line 27 of file datastream.hpp.

◆ remaining()

template<typename T >
size_t fc::datastream< T >::remaining ( ) const
inline

Definition at line 69 of file datastream.hpp.

◆ seekp()

template<typename T >
bool fc::datastream< T >::seekp ( size_t  p)
inline

Definition at line 67 of file datastream.hpp.

◆ skip()

template<typename T >
void fc::datastream< T >::skip ( size_t  s)
inline

Definition at line 26 of file datastream.hpp.

◆ tellp()

template<typename T >
size_t fc::datastream< T >::tellp ( ) const
inline

Definition at line 68 of file datastream.hpp.

◆ valid()

template<typename T >
bool fc::datastream< T >::valid ( ) const
inline

Definition at line 66 of file datastream.hpp.

◆ write()

template<typename T >
bool fc::datastream< T >::write ( const char *  d,
size_t  s 
)
inline

Definition at line 36 of file datastream.hpp.


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