BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
Public Member Functions | List of all members
fc::istream Class Referenceabstract

#include <iostream.hpp>

Inheritance diagram for fc::istream:
fc::asio::istream< AsyncReadStream > fc::buffered_istream fc::cin_t fc::ifstream fc::iostream fc::stringstream fc::tcp_socket graphene::net::stcp_socket

Public Member Functions

virtual ~istream ()
 
virtual size_t readsome (char *buf, size_t len)=0
 
virtual size_t readsome (const std::shared_ptr< char > &buf, size_t len, size_t offset)=0
 
istreamread (char *buf, size_t len)
 
istreamread (const std::shared_ptr< char > &buf, size_t len, size_t offset=0)
 
virtual char get ()
 
void get (char &c)
 

Detailed Description

Provides a fc::thread friendly cooperatively multi-tasked stream that will block 'cooperatively' instead of hard blocking.

Definition at line 11 of file iostream.hpp.

Constructor & Destructor Documentation

◆ ~istream()

virtual fc::istream::~istream ( )
inlinevirtual

Definition at line 14 of file iostream.hpp.

Member Function Documentation

◆ get() [1/2]

char fc::istream::get ( )
virtual

Definition at line 267 of file iostream.cpp.

◆ get() [2/2]

void fc::istream::get ( char &  c)
inline

Definition at line 33 of file iostream.hpp.

◆ read() [1/2]

istream & fc::istream::read ( char *  buf,
size_t  len 
)

read len bytes or throw, this method is implemented in terms of readsome.

Exceptions
fc::eof_exceptionif len bytes cannot be read

Definition at line 274 of file iostream.cpp.

◆ read() [2/2]

istream & fc::istream::read ( const std::shared_ptr< char > &  buf,
size_t  len,
size_t  offset = 0 
)

Definition at line 282 of file iostream.cpp.

◆ readsome() [1/2]

virtual size_t fc::istream::readsome ( char *  buf,
size_t  len 
)
pure virtual

read at least 1 byte or throw, if no data is available this method should block cooperatively until data is available or fc::eof is thrown.

Exceptions
fc::eofif at least 1 byte cannot be read

Implemented in graphene::net::stcp_socket, fc::tcp_socket, fc::asio::istream< AsyncReadStream >, fc::ifstream, fc::buffered_istream, fc::cin_t, and fc::stringstream.

◆ readsome() [2/2]

virtual size_t fc::istream::readsome ( const std::shared_ptr< char > &  buf,
size_t  len,
size_t  offset 
)
pure virtual

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