SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
SWC::Comm::ConnHandlerPlain Class Referencefinal

#include <swcdb/core/comm/ConnHandler.h>

+ Inheritance diagram for SWC::Comm::ConnHandlerPlain:
+ Collaboration diagram for SWC::Comm::ConnHandlerPlain:

Public Types

typedef std::shared_ptr< ConnHandlerPlainPtr
 

Public Member Functions

virtual ~ConnHandlerPlain () noexcept
 
void do_close () noexcept override
 
bool is_open () const noexcept override
 
- Public Member Functions inherited from SWC::Comm::ConnHandler
 ConnHandler (const ConnHandler &)=delete
 
 ConnHandler (ConnHandler &&)=delete
 
ConnHandleroperator= (const ConnHandler &)=delete
 
ConnHandleroperator= (ConnHandler &&)=delete
 
SWC_CAN_INLINE size_t endpoint_remote_hash () const noexcept
 
SWC_CAN_INLINE size_t endpoint_local_hash () const noexcept
 
SWC_CAN_INLINE Core::Encoder::Type get_encoder () const noexcept
 
virtual bool is_secure () const noexcept
 
void new_connection ()
 
size_t pending_read () noexcept
 
SWC_CAN_INLINE bool due ()
 
bool send_error (int error, const std::string &msg, const Event::Ptr &ev) noexcept
 
bool response_ok (const Event::Ptr &ev) noexcept
 
bool send_response (Buffers::Ptr cbuf, DispatchHandler::Ptr hdlr=nullptr) noexcept
 
bool send_request (Buffers::Ptr cbuf, DispatchHandler::Ptr hdlr)
 
void print (std::ostream &out) const
 

Static Public Member Functions

static Ptr make (AppContext::Ptr &app_ctx, SocketPlain &socket)
 

Protected Member Functions

SocketLayer *SWC_CONST_FUNC socket_layer () noexcept override
 
void read (uint8_t **bufp, size_t *remainp, asio::error_code &ec) override
 
void do_async_write (Core::Vector< asio::const_buffer > &&buffers, Sender_noAck &&hdlr) noexcept override
 
void do_async_write (Core::Vector< asio::const_buffer > &&buffers, Sender_Ack &&hdlr) noexcept override
 
void do_async_read (uint8_t *data, uint32_t sz, Receiver_HeaderPrefix &&hdlr) noexcept override
 
void do_async_read (uint8_t *data, uint32_t sz, Receiver_Header &&hdlr) noexcept override
 
void do_async_read (uint8_t *data, uint32_t sz, Receiver_Buffer &&hdlr) noexcept override
 
- Protected Member Functions inherited from SWC::Comm::ConnHandler
SWC_CAN_INLINE ConnHandler (AppContext::Ptr &a_app_ctx) noexcept
 
SWC_CAN_INLINE ConnHandlerPtr ptr () noexcept
 
virtual ~ConnHandler () noexcept
 
void do_close_run () noexcept
 
void disconnected () noexcept
 

Private Member Functions

 ConnHandlerPlain (AppContext::Ptr &app_ctx, SocketPlain &socket) noexcept
 

Private Attributes

SocketPlain m_sock
 

Additional Inherited Members

- Public Attributes inherited from SWC::Comm::ConnHandler
Core::AtomicBool connected
 
const AppContext::Ptr app_ctx
 
EndPoint endpoint_remote
 
EndPoint endpoint_local
 
- Protected Attributes inherited from SWC::Comm::ConnHandler
Core::MutexSptd m_mutex
 

Detailed Description

Definition at line 253 of file ConnHandler.h.

Member Typedef Documentation

◆ Ptr

Definition at line 256 of file ConnHandler.h.

Constructor & Destructor Documentation

◆ ~ConnHandlerPlain()

SWC::Comm::ConnHandlerPlain::~ConnHandlerPlain ( )
virtualnoexcept

Definition at line 580 of file ConnHandler.cc.

References is_open(), and m_sock.

+ Here is the call graph for this function:

◆ ConnHandlerPlain()

SWC::Comm::ConnHandlerPlain::ConnHandlerPlain ( AppContext::Ptr app_ctx,
SocketPlain socket 
)
privatenoexcept

Definition at line 573 of file ConnHandler.cc.

Referenced by make().

+ Here is the caller graph for this function:

Member Function Documentation

◆ do_async_read() [1/3]

void SWC::Comm::ConnHandlerPlain::do_async_read ( uint8_t *  data,
uint32_t  sz,
ConnHandler::Receiver_Buffer &&  hdlr 
)
overrideprotectedvirtualnoexcept

Implements SWC::Comm::ConnHandler.

Definition at line 638 of file ConnHandler.cc.

References data.

◆ do_async_read() [2/3]

void SWC::Comm::ConnHandlerPlain::do_async_read ( uint8_t *  data,
uint32_t  sz,
ConnHandler::Receiver_Header &&  hdlr 
)
overrideprotectedvirtualnoexcept

Implements SWC::Comm::ConnHandler.

Definition at line 632 of file ConnHandler.cc.

References data.

◆ do_async_read() [3/3]

void SWC::Comm::ConnHandlerPlain::do_async_read ( uint8_t *  data,
uint32_t  sz,
ConnHandler::Receiver_HeaderPrefix &&  hdlr 
)
overrideprotectedvirtualnoexcept

Implements SWC::Comm::ConnHandler.

Definition at line 626 of file ConnHandler.cc.

References data.

◆ do_async_write() [1/2]

void SWC::Comm::ConnHandlerPlain::do_async_write ( Core::Vector< asio::const_buffer > &&  buffers,
ConnHandler::Sender_Ack &&  hdlr 
)
overrideprotectedvirtualnoexcept

Implements SWC::Comm::ConnHandler.

Definition at line 619 of file ConnHandler.cc.

References buffers.

◆ do_async_write() [2/2]

void SWC::Comm::ConnHandlerPlain::do_async_write ( Core::Vector< asio::const_buffer > &&  buffers,
ConnHandler::Sender_noAck &&  hdlr 
)
overrideprotectedvirtualnoexcept

Implements SWC::Comm::ConnHandler.

Definition at line 612 of file ConnHandler.cc.

References buffers.

◆ do_close()

void SWC::Comm::ConnHandlerPlain::do_close ( )
overridevirtualnoexcept

Implements SWC::Comm::ConnHandler.

Definition at line 587 of file ConnHandler.cc.

References SWC::Core::AtomicBase< T, OrderT >::compare_exchange_weak(), SWC::Comm::ConnHandler::connected, SWC::Comm::ConnHandler::disconnected(), SWC::Comm::ConnHandler::do_close_run(), and m_sock.

+ Here is the call graph for this function:

◆ is_open()

bool SWC::Comm::ConnHandlerPlain::is_open ( ) const
overridevirtualnoexcept

Implements SWC::Comm::ConnHandler.

Definition at line 600 of file ConnHandler.cc.

References SWC::Comm::ConnHandler::connected, and m_sock.

Referenced by ~ConnHandlerPlain().

+ Here is the caller graph for this function:

◆ make()

ConnHandlerPlain::Ptr SWC::Comm::ConnHandlerPlain::make ( AppContext::Ptr app_ctx,
SocketPlain socket 
)
static

Definition at line 569 of file ConnHandler.cc.

References SWC::Comm::ConnHandler::app_ctx, and ConnHandlerPlain().

Referenced by SWC::Comm::client::Serialized::get_connection(), SWC::Comm::client::Serialized::Connector< HdlrT >::operator()(), SWC::Comm::server::Acceptor::Plain::operator()(), and SWC::Comm::server::Acceptor::Mixed::operator()().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

void SWC::Comm::ConnHandlerPlain::read ( uint8_t **  bufp,
size_t *  remainp,
asio::error_code &  ec 
)
overrideprotectedvirtual

Implements SWC::Comm::ConnHandler.

Definition at line 645 of file ConnHandler.cc.

References m_sock, and SWC::Comm::ConnHandler::read().

+ Here is the call graph for this function:

◆ socket_layer()

SocketLayer * SWC::Comm::ConnHandlerPlain::socket_layer ( )
overrideprotectedvirtualnoexcept

Implements SWC::Comm::ConnHandler.

Definition at line 604 of file ConnHandler.cc.

References m_sock.

Member Data Documentation

◆ m_sock

SocketPlain SWC::Comm::ConnHandlerPlain::m_sock
private

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