Thrill  0.1
AsyncReadByteBlock Class Reference

Detailed Description

Definition at line 279 of file dispatcher.hpp.

+ Collaboration diagram for AsyncReadByteBlock:

#include <dispatcher.hpp>

Public Member Functions

 AsyncReadByteBlock (Connection &conn, size_t size, data::PinnedByteBlockPtr &&block, const AsyncReadByteBlockCallback &callback)
 Construct block reader with callback. More...
 
 AsyncReadByteBlock (const AsyncReadByteBlock &)=delete
 non-copyable: delete copy-constructor More...
 
 AsyncReadByteBlock (AsyncReadByteBlock &&)=default
 move-constructor: default More...
 
 ~AsyncReadByteBlock ()
 
data::PinnedByteBlockPtrbyte_block ()
 
Connectionconnection () const
 Returns conn_. More...
 
uint8_t * data ()
 underlying buffer pointer More...
 
const uint8_t * data () const
 underlying buffer pointer More...
 
void DoCallback ()
 
void DoCallback (size_t size_check)
 
bool IsDone () const
 
bool operator() ()
 Should be called when the socket is readable. More...
 
AsyncReadByteBlockoperator= (const AsyncReadByteBlock &)=delete
 non-copyable: delete assignment operator More...
 
AsyncReadByteBlockoperator= (AsyncReadByteBlock &&)=default
 move-assignment operator: default More...
 
size_t size () const
 underlying buffer size More...
 

Private Attributes

data::PinnedByteBlockPtr block_
 Receive block, holds a pin on the memory. More...
 
AsyncReadByteBlockCallback callback_
 functional object to call once data is complete More...
 
Connectionconn_
 Connection reference. More...
 
size_t pos_ = 0
 size currently read More...
 
size_t size_
 total size to read More...
 

Constructor & Destructor Documentation

◆ AsyncReadByteBlock() [1/3]

AsyncReadByteBlock ( Connection conn,
size_t  size,
data::PinnedByteBlockPtr &&  block,
const AsyncReadByteBlockCallback callback 
)
inline

Construct block reader with callback.

Definition at line 283 of file dispatcher.hpp.

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

◆ AsyncReadByteBlock() [2/3]

AsyncReadByteBlock ( const AsyncReadByteBlock )
delete

non-copyable: delete copy-constructor

◆ AsyncReadByteBlock() [3/3]

move-constructor: default

◆ ~AsyncReadByteBlock()

~AsyncReadByteBlock ( )
inline

Definition at line 306 of file dispatcher.hpp.

References LOGC.

Member Function Documentation

◆ byte_block()

data::PinnedByteBlockPtr& byte_block ( )
inline

Definition at line 355 of file dispatcher.hpp.

◆ connection()

Connection* connection ( ) const
inline

Returns conn_.

Definition at line 370 of file dispatcher.hpp.

References AsyncReadBuffer::conn_.

Referenced by Dispatcher::PerformAsync().

◆ data() [1/2]

uint8_t* data ( )
inline

underlying buffer pointer

Definition at line 373 of file dispatcher.hpp.

Referenced by Dispatcher::PerformAsync().

◆ data() [2/2]

const uint8_t* data ( ) const
inline

underlying buffer pointer

Definition at line 376 of file dispatcher.hpp.

◆ DoCallback() [1/2]

void DoCallback ( )
inline

Definition at line 357 of file dispatcher.hpp.

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

◆ DoCallback() [2/2]

void DoCallback ( size_t  size_check)
inline

Definition at line 364 of file dispatcher.hpp.

References die_unequal, and AsyncReadBuffer::DoCallback().

◆ IsDone()

bool IsDone ( ) const
inline

Definition at line 350 of file dispatcher.hpp.

◆ operator()()

bool operator() ( )
inline

Should be called when the socket is readable.

Definition at line 314 of file dispatcher.hpp.

References AsyncReadBuffer::conn_, AsyncReadBuffer::DoCallback(), LOGC, Connection::RecvOne(), and Connection::rx_active_.

◆ operator=() [1/2]

AsyncReadByteBlock& operator= ( const AsyncReadByteBlock )
delete

non-copyable: delete assignment operator

◆ operator=() [2/2]

AsyncReadByteBlock& operator= ( AsyncReadByteBlock &&  )
default

move-assignment operator: default

◆ size()

size_t size ( ) const
inline

underlying buffer size

Definition at line 379 of file dispatcher.hpp.

Referenced by Dispatcher::PerformAsync().

Member Data Documentation

◆ block_

data::PinnedByteBlockPtr block_
private

Receive block, holds a pin on the memory.

Definition at line 386 of file dispatcher.hpp.

◆ callback_

AsyncReadByteBlockCallback callback_
private

functional object to call once data is complete

Definition at line 395 of file dispatcher.hpp.

◆ conn_

Connection* conn_
private

Connection reference.

Definition at line 383 of file dispatcher.hpp.

◆ pos_

size_t pos_ = 0
private

size currently read

Definition at line 389 of file dispatcher.hpp.

◆ size_

size_t size_
private

total size to read

Definition at line 392 of file dispatcher.hpp.


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