scclib
Stable Cloud Computing C++ Library
Public Member Functions | List of all members
scc::util::IoPipeline Struct Reference

Input/output stream with pipeline of readers and writers. More...

#include <iopipeline.h>

Inheritance diagram for scc::util::IoPipeline:
Inheritance graph
[legend]
Collaboration diagram for scc::util::IoPipeline:
Collaboration graph
[legend]

Public Member Functions

 IoPipeline (const std::shared_ptr< Reader > &, const std::shared_ptr< Writer > &, size_t=1024, size_t=1024)
 Create with base reader/writer and buffer sizes.
 
void rw_add_back (const std::shared_ptr< PipelineReader > &r, const std::shared_ptr< PipelineWriter > &w)
 Add to the end of the chain (before the base).
 
void rw_add_front (const std::shared_ptr< PipelineReader > &r, const std::shared_ptr< PipelineWriter > &w)
 Add to the end of the chain (after the stream).
 
std::shared_ptr< Readerrd_fix_chain ()
 Fix the chain, and return the pointer that should be pointed to by the stream.
 
std::shared_ptr< Writerwr_fix_chain ()
 Fix the chain, and return the pointer that should be pointed to by the stream.
 
- Public Member Functions inherited from scc::util::InChain
 InChain (const std::shared_ptr< Reader > &)
 Create with base reader and read buffer size. More...
 
void rd_replace_base (const std::shared_ptr< PipelineReader > &r)
 Replace the base writer with a new base writer.
 
void rd_add_back (const std::shared_ptr< PipelineReader > &r)
 Add a reader to the end of the chain (before the base).
 
void rd_add_front (const std::shared_ptr< PipelineReader > &r)
 Add a reader to the start of the chain (after the stream).
 
void rd_del (const std::shared_ptr< PipelineReader > &)
 Delete a reader from the chain.
 
- Public Member Functions inherited from scc::util::OutChain
 OutChain (const std::shared_ptr< Writer > &)
 Create with base writer and write buffer size.
 
void wr_replace_base (const std::shared_ptr< PipelineWriter > &w)
 Replace the base writer with a new base writer.
 
void wr_add_back (const std::shared_ptr< PipelineWriter > &w)
 Add a writer to the end of the chain (before the base).
 
void wr_add_front (const std::shared_ptr< PipelineWriter > &w)
 Add a writer to the start of the chain (after the stream).
 
void wr_del (const std::shared_ptr< PipelineWriter > &)
 Delete a writer from the chain.
 
- Public Member Functions inherited from scc::util::IoStream
 IoStream (Reader &, Writer &, size_t=1024, size_t=1024)
 Create reader/writer stream. More...
 
 IoStream (const std::shared_ptr< Reader > &, const std::shared_ptr< Writer > &, size_t=1024, size_t=1024)
 Create reader/writer stream. More...
 
 IoStream ()=delete
 No default construct.
 
 IoStream (const IoStream &)=delete
 Copy construct not allowed.
 
IoStreamoperator= (const IoStream &)=delete
 Copy assign not allowed.
 
 IoStream (IoStream &&)
 Move construct.
 
IoStreamoperator= (IoStream &&)
 Move assign.
 
void read_reset (const std::shared_ptr< Reader > &)
 
void write_reset (const std::shared_ptr< Writer > &)
 
std::shared_ptr< Readerread_shared () const
 
std::shared_ptr< Writerwrite_shared () const
 
size_t recvbuf_size () const
 Size of receive buffer.
 
void recvbuf_size (size_t)
 Resize the receive buffer.
 
size_t sendbuf_size () const
 Size of send buffer.
 
void sendbuf_size (size_t)
 Resize the send buffer.
 
virtual std::string recv_fail () const
 Failure message from instream.
 
virtual std::string send_fail () const
 Failure message from outstream.
 
void clear (std::ios::iostate=std::ios::goodbit)
 

Additional Inherited Members

- Public Attributes inherited from scc::util::InChain
std::shared_ptr< Readerrd_base
 
std::list< std::shared_ptr< PipelineReader > > rd_chain
 
- Public Attributes inherited from scc::util::OutChain
std::shared_ptr< Writerwr_base
 
std::list< std::shared_ptr< PipelineWriter > > wr_chain
 

Detailed Description

Input/output stream with pipeline of readers and writers.

Without: stream reads/writes <-> base With chain: stream reads/writes <-> chain[0] <-> ... <-> chain[N] <-> base

Examples
util/unittest/iohelper.cc.

Definition at line 162 of file iopipeline.h.


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