Thrill  0.1
AsyncWriteBuffer Class Reference

Detailed Description

Definition at line 179 of file dispatcher.hpp.

+ Collaboration diagram for AsyncWriteBuffer:

#include <dispatcher.hpp>

Public Member Functions

 AsyncWriteBuffer (Connection &conn, Buffer &&buffer, const AsyncWriteCallback &callback)
 Construct buffered writer with callback. More...
 
 AsyncWriteBuffer (const AsyncWriteBuffer &)=delete
 non-copyable: delete copy-constructor More...
 
 AsyncWriteBuffer (AsyncWriteBuffer &&)=default
 move-constructor: default More...
 
 ~AsyncWriteBuffer ()
 
Connectionconnection () const
 Returns conn_. More...
 
const uint8_t * data () const
 underlying buffer pointer More...
 
void DoCallback ()
 
bool IsDone () const
 
bool operator() ()
 Should be called when the socket is writable. More...
 
AsyncWriteBufferoperator= (const AsyncWriteBuffer &)=delete
 non-copyable: delete assignment operator More...
 
AsyncWriteBufferoperator= (AsyncWriteBuffer &&)=default
 move-assignment operator: default More...
 
size_t size () const
 underlying buffer size More...
 

Private Attributes

Buffer buffer_
 Send buffer (owned by this writer) More...
 
AsyncWriteCallback callback_
 functional object to call once data is complete More...
 
Connectionconn_
 Connection reference. More...
 
size_t write_size_ = 0
 total size currently written More...
 

Constructor & Destructor Documentation

◆ AsyncWriteBuffer() [1/3]

AsyncWriteBuffer ( Connection conn,
Buffer &&  buffer,
const AsyncWriteCallback callback 
)
inline

Construct buffered writer with callback.

Definition at line 183 of file dispatcher.hpp.

References AsyncReadBuffer::buffer_, AsyncReadBuffer::conn_, LOGC, AsyncReadBuffer::operator=(), Buffer::size(), and Connection::tx_active_.

◆ AsyncWriteBuffer() [2/3]

AsyncWriteBuffer ( const AsyncWriteBuffer )
delete

non-copyable: delete copy-constructor

◆ AsyncWriteBuffer() [3/3]

move-constructor: default

◆ ~AsyncWriteBuffer()

~AsyncWriteBuffer ( )
inline

Definition at line 203 of file dispatcher.hpp.

References AsyncReadBuffer::buffer_, LOGC, and Buffer::size().

Member Function Documentation

◆ connection()

Connection* connection ( ) const
inline

Returns conn_.

Definition at line 255 of file dispatcher.hpp.

References AsyncReadBuffer::conn_.

Referenced by Dispatcher::PerformAsync().

◆ data()

const uint8_t* data ( ) const
inline

underlying buffer pointer

Definition at line 258 of file dispatcher.hpp.

References AsyncReadBuffer::buffer_, and Buffer::data().

Referenced by Dispatcher::PerformAsync().

◆ DoCallback()

void DoCallback ( )
inline

Definition at line 247 of file dispatcher.hpp.

References AsyncReadBuffer::callback_, and AsyncReadBuffer::conn_.

◆ IsDone()

bool IsDone ( ) const
inline

Definition at line 245 of file dispatcher.hpp.

References AsyncReadBuffer::buffer_, and Buffer::size().

◆ operator()()

bool operator() ( )
inline

◆ operator=() [1/2]

AsyncWriteBuffer& operator= ( const AsyncWriteBuffer )
delete

non-copyable: delete assignment operator

◆ operator=() [2/2]

AsyncWriteBuffer& operator= ( AsyncWriteBuffer &&  )
default

move-assignment operator: default

◆ size()

size_t size ( ) const
inline

underlying buffer size

Definition at line 261 of file dispatcher.hpp.

References AsyncReadBuffer::buffer_, and Buffer::size().

Referenced by Dispatcher::PerformAsync().

Member Data Documentation

◆ buffer_

Buffer buffer_
private

Send buffer (owned by this writer)

Definition at line 268 of file dispatcher.hpp.

◆ callback_

AsyncWriteCallback callback_
private

functional object to call once data is complete

Definition at line 274 of file dispatcher.hpp.

◆ conn_

Connection* conn_
private

Connection reference.

Definition at line 265 of file dispatcher.hpp.

◆ write_size_

size_t write_size_ = 0
private

total size currently written

Definition at line 271 of file dispatcher.hpp.


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