Thrill  0.1
AsyncWriteBlock Class Reference

Detailed Description

Definition at line 400 of file dispatcher.hpp.

+ Collaboration diagram for AsyncWriteBlock:

#include <dispatcher.hpp>

Public Member Functions

 AsyncWriteBlock (Connection &conn, data::PinnedBlock &&block, const AsyncWriteCallback &callback)
 Construct block writer with callback. More...
 
 AsyncWriteBlock (const AsyncWriteBlock &)=delete
 non-copyable: delete copy-constructor More...
 
 AsyncWriteBlock (AsyncWriteBlock &&)=default
 move-constructor: default More...
 
 ~AsyncWriteBlock ()
 
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...
 
AsyncWriteBlockoperator= (const AsyncWriteBlock &)=delete
 non-copyable: delete assignment operator More...
 
AsyncWriteBlockoperator= (AsyncWriteBlock &&)=default
 move-assignment operator: default More...
 
size_t size () const
 underlying buffer size More...
 

Private Attributes

data::PinnedBlock block_
 Send block (holds a pin on the underlying ByteBlock) More...
 
AsyncWriteCallback callback_
 functional object to call once data is complete More...
 
Connectionconn_
 Connection reference. More...
 
size_t written_size_ = 0
 total size currently written More...
 

Constructor & Destructor Documentation

◆ AsyncWriteBlock() [1/3]

AsyncWriteBlock ( Connection conn,
data::PinnedBlock &&  block,
const AsyncWriteCallback callback 
)
inline

Construct block writer with callback.

Definition at line 404 of file dispatcher.hpp.

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

◆ AsyncWriteBlock() [2/3]

AsyncWriteBlock ( const AsyncWriteBlock )
delete

non-copyable: delete copy-constructor

◆ AsyncWriteBlock() [3/3]

AsyncWriteBlock ( AsyncWriteBlock &&  )
default

move-constructor: default

◆ ~AsyncWriteBlock()

~AsyncWriteBlock ( )
inline

Definition at line 425 of file dispatcher.hpp.

References LOGC.

Member Function Documentation

◆ connection()

Connection* connection ( ) const
inline

Returns conn_.

Definition at line 480 of file dispatcher.hpp.

References AsyncReadBuffer::conn_.

Referenced by Dispatcher::PerformAsync().

◆ data()

const uint8_t* data ( ) const
inline

underlying buffer pointer

Definition at line 483 of file dispatcher.hpp.

Referenced by Dispatcher::PerformAsync().

◆ DoCallback()

void DoCallback ( )
inline

Definition at line 470 of file dispatcher.hpp.

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

◆ IsDone()

bool IsDone ( ) const
inline

Definition at line 468 of file dispatcher.hpp.

◆ operator()()

bool operator() ( )
inline

Should be called when the socket is writable.

Definition at line 432 of file dispatcher.hpp.

References AsyncReadBuffer::conn_, AsyncReadBuffer::DoCallback(), LOG1, LOGC, Connection::SendOne(), and Connection::tx_active_.

◆ operator=() [1/2]

AsyncWriteBlock& operator= ( const AsyncWriteBlock )
delete

non-copyable: delete assignment operator

◆ operator=() [2/2]

AsyncWriteBlock& operator= ( AsyncWriteBlock &&  )
default

move-assignment operator: default

◆ size()

size_t size ( ) const
inline

underlying buffer size

Definition at line 486 of file dispatcher.hpp.

Referenced by Dispatcher::PerformAsync().

Member Data Documentation

◆ block_

data::PinnedBlock block_
private

Send block (holds a pin on the underlying ByteBlock)

Definition at line 493 of file dispatcher.hpp.

◆ callback_

AsyncWriteCallback callback_
private

functional object to call once data is complete

Definition at line 499 of file dispatcher.hpp.

◆ conn_

Connection* conn_
private

Connection reference.

Definition at line 490 of file dispatcher.hpp.

◆ written_size_

size_t written_size_ = 0
private

total size currently written

Definition at line 496 of file dispatcher.hpp.


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