BitShares-Core  4.0.0
BitShares blockchain implementation and command-line interface 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

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

Definition at line 14 of file iostream.hpp.

Member Function Documentation

char fc::istream::get ( )
virtual

Definition at line 267 of file iostream.cpp.

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

Definition at line 33 of file iostream.hpp.

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.

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.

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 fc::asio::istream< AsyncReadStream >, graphene::net::stcp_socket, fc::ifstream, fc::tcp_socket, fc::cin_t, and fc::stringstream.

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: