Definition at line 448 of file net_plugin.cpp.
◆ add_write_queue()
bool sysio::queued_buffer::add_write_queue |
( |
const std::shared_ptr< vector< char > > & | buff, |
|
|
std::function< void(boost::system::error_code, std::size_t)> | callback, |
|
|
bool | to_sync_queue ) |
|
inline |
Definition at line 481 of file net_plugin.cpp.
483 {
484 std::lock_guard<std::mutex> g( _mtx );
485 if( to_sync_queue ) {
486 _sync_write_queue.push_back( {buff, callback} );
487 } else {
488 _write_queue.push_back( {buff, callback} );
489 }
490 _write_queue_size += buff->size();
492 return false;
493 }
494 return true;
495 }
constexpr auto def_max_write_queue_size
◆ clear_out_queue()
void sysio::queued_buffer::clear_out_queue |
( |
| ) |
|
|
inline |
Definition at line 457 of file net_plugin.cpp.
457 {
458 std::lock_guard<std::mutex> g( _mtx );
459 while ( _out_queue.size() > 0 ) {
460 _out_queue.pop_front();
461 }
462 }
◆ clear_write_queue()
void sysio::queued_buffer::clear_write_queue |
( |
| ) |
|
|
inline |
Definition at line 450 of file net_plugin.cpp.
450 {
451 std::lock_guard<std::mutex> g( _mtx );
452 _write_queue.clear();
453 _sync_write_queue.clear();
454 _write_queue_size = 0;
455 }
◆ fill_out_buffer()
void sysio::queued_buffer::fill_out_buffer |
( |
std::vector< boost::asio::const_buffer > & | bufs | ) |
|
|
inline |
Definition at line 497 of file net_plugin.cpp.
497 {
498 std::lock_guard<std::mutex> g( _mtx );
499 if( _sync_write_queue.size() > 0 ) {
501 } else {
503 SYS_ASSERT( _write_queue_size == 0, plugin_exception,
"write queue size expected to be zero" );
504 }
505 }
#define SYS_ASSERT(expr, exc_type, FORMAT,...)
void fill_out_buffer(std::vector< boost::asio::const_buffer > &bufs)
◆ is_out_queue_empty()
bool sysio::queued_buffer::is_out_queue_empty |
( |
| ) |
const |
|
inline |
Definition at line 469 of file net_plugin.cpp.
469 {
470 std::lock_guard<std::mutex> g( _mtx );
471 return _out_queue.empty();
472 }
◆ out_callback()
void sysio::queued_buffer::out_callback |
( |
boost::system::error_code | ec, |
|
|
std::size_t | w ) |
|
inline |
Definition at line 507 of file net_plugin.cpp.
507 {
508 std::lock_guard<std::mutex> g( _mtx );
509 for( auto& m : _out_queue ) {
510 m.callback( ec, w );
511 }
512 }
◆ ready_to_send()
bool sysio::queued_buffer::ready_to_send |
( |
| ) |
const |
|
inline |
Definition at line 474 of file net_plugin.cpp.
474 {
475 std::lock_guard<std::mutex> g( _mtx );
476
477 return ((!_sync_write_queue.empty() || !_write_queue.empty()) && _out_queue.empty());
478 }
◆ write_queue_size()
uint32_t sysio::queued_buffer::write_queue_size |
( |
| ) |
const |
|
inline |
Definition at line 464 of file net_plugin.cpp.
464 {
465 std::lock_guard<std::mutex> g( _mtx );
466 return _write_queue_size;
467 }
The documentation for this class was generated from the following file: