Thrill  0.1
AsyncReadBuffer Class Reference

Detailed Description

Definition at line 66 of file dispatcher.hpp.

+ Collaboration diagram for AsyncReadBuffer:

#include <dispatcher.hpp>

Public Member Functions

 AsyncReadBuffer (Connection &conn, size_t buffer_size, const AsyncReadBufferCallback &callback)
 Construct buffered reader with callback. More...
 
 AsyncReadBuffer (const AsyncReadBuffer &)=delete
 non-copyable: delete copy-constructor More...
 
 AsyncReadBuffer (AsyncReadBuffer &&)=default
 move-constructor: default More...
 
 ~AsyncReadBuffer ()
 
Bufferbuffer ()
 reference to Buffer More...
 
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...
 
AsyncReadBufferoperator= (const AsyncReadBuffer &)=delete
 non-copyable: delete assignment operator More...
 
AsyncReadBufferoperator= (AsyncReadBuffer &&)=default
 move-assignment operator: default More...
 
size_t size () const
 underlying buffer size More...
 

Private Attributes

Buffer buffer_
 Receive buffer (allocates memory) More...
 
AsyncReadBufferCallback callback_
 functional object to call once data is complete More...
 
Connectionconn_
 Connection reference. More...
 
size_t read_size_ = 0
 total size currently read More...
 

Constructor & Destructor Documentation

◆ AsyncReadBuffer() [1/3]

AsyncReadBuffer ( Connection conn,
size_t  buffer_size,
const AsyncReadBufferCallback callback 
)
inline

Construct buffered reader with callback.

Definition at line 70 of file dispatcher.hpp.

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

◆ AsyncReadBuffer() [2/3]

AsyncReadBuffer ( const AsyncReadBuffer )
delete

non-copyable: delete copy-constructor

◆ AsyncReadBuffer() [3/3]

AsyncReadBuffer ( AsyncReadBuffer &&  )
default

move-constructor: default

◆ ~AsyncReadBuffer()

~AsyncReadBuffer ( )
inline

Definition at line 90 of file dispatcher.hpp.

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

Member Function Documentation

◆ buffer()

Buffer& buffer ( )
inline

reference to Buffer

Definition at line 137 of file dispatcher.hpp.

References AsyncReadBuffer::buffer_.

Referenced by Dispatcher::AsyncWrite().

◆ connection()

Connection* connection ( ) const
inline

Returns conn_.

Definition at line 152 of file dispatcher.hpp.

References AsyncReadBuffer::conn_.

Referenced by Dispatcher::PerformAsync().

◆ data() [1/2]

uint8_t* data ( )
inline

underlying buffer pointer

Definition at line 155 of file dispatcher.hpp.

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

Referenced by Dispatcher::PerformAsync().

◆ data() [2/2]

const uint8_t* data ( ) const
inline

underlying buffer pointer

Definition at line 158 of file dispatcher.hpp.

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

◆ DoCallback() [1/2]

◆ DoCallback() [2/2]

void DoCallback ( size_t  size_check)
inline

◆ IsDone()

bool IsDone ( ) const
inline

◆ operator()()

◆ operator=() [1/2]

◆ operator=() [2/2]

AsyncReadBuffer& operator= ( AsyncReadBuffer &&  )
default

move-assignment operator: default

◆ size()

size_t size ( ) const
inline

underlying buffer size

Definition at line 161 of file dispatcher.hpp.

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

Referenced by Dispatcher::PerformAsync().

Member Data Documentation

◆ buffer_

◆ callback_

AsyncReadBufferCallback callback_
private

◆ conn_

◆ read_size_

size_t read_size_ = 0
private

total size currently read

Definition at line 171 of file dispatcher.hpp.

Referenced by AsyncReadBuffer::IsDone(), and AsyncReadBuffer::operator()().


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