Movatterモバイル変換


[0]ホーム

URL:


Logo
cpp_redis  4.0.0
cpp_redis is a C++11 Asynchronous Multi-Platform Lightweight Redis Client, with support for synchronous operations and pipelining.
Classes |Public Types |Public Member Functions |List of all members
cpp_redis::network::tcp_client_iface Class Referenceabstract

#include <tcp_client_iface.hpp>

Inheritance diagram for cpp_redis::network::tcp_client_iface:

Classes

struct  read_request
 
struct  read_result
 
struct  write_request
 
struct  write_result
 

Public Types

typedef std::function< void(read_result &)> async_read_callback_t
 
typedef std::function< void(write_result &)> async_write_callback_t
 
typedef std::function< void()> disconnection_handler_t
 

Public Member Functions

 tcp_client_iface (void)=default
 ctor
 
virtual ~tcp_client_iface (void)=default
 dtor
 
virtual void connect (const std::string &addr, std::uint32_t port, std::uint32_t timeout_msecs=0)=0
 
virtual void disconnect (bool wait_for_removal=false)=0
 
virtual bool is_connected (void) const =0
 
virtual void async_read (read_request &request)=0
 
virtual void async_write (write_request &request)=0
 
virtual void set_on_disconnection_handler (constdisconnection_handler_t &disconnection_handler)=0
 

Detailed Description

interface defining how tcp client should be implemented to be used inside cpp_redis

Member Typedef Documentation

◆ async_read_callback_t

typedef std::function<void(read_result&)>cpp_redis::network::tcp_client_iface::async_read_callback_t

async read completion callbacks function takingread_result as a parameter

◆ async_write_callback_t

typedef std::function<void(write_result&)>cpp_redis::network::tcp_client_iface::async_write_callback_t

async write completion callbacks function takingwrite_result as a parameter

◆ disconnection_handler_t

typedef std::function<void()>cpp_redis::network::tcp_client_iface::disconnection_handler_t

disconnection handler

Member Function Documentation

◆ async_read()

virtual void cpp_redis::network::tcp_client_iface::async_read(read_requestrequest)
pure virtual

async read operation

Parameters
requestinformation about what should be read and what should be done after completion

Implemented incpp_redis::network::tcp_client.

◆ async_write()

virtual void cpp_redis::network::tcp_client_iface::async_write(write_requestrequest)
pure virtual

async write operation

Parameters
requestinformation about what should be written and what should be done after completion

Implemented incpp_redis::network::tcp_client.

◆ connect()

virtual void cpp_redis::network::tcp_client_iface::connect(const std::string & addr,
std::uint32_t port,
std::uint32_t timeout_msecs =0 
)
pure virtual

start the tcp client

Parameters
addrhost to be connected to
portport to be connected to
timeout_msecsmax time to connect in ms

Implemented incpp_redis::network::tcp_client.

◆ disconnect()

virtual void cpp_redis::network::tcp_client_iface::disconnect(bool wait_for_removal =false)
pure virtual

stop the tcp client

Parameters
wait_for_removalwhen sets to true, disconnect blocks until the underlying TCP client has been effectively removed from the io_service and that all the underlying callbacks have completed.

Implemented incpp_redis::network::tcp_client.

◆ is_connected()

virtual bool cpp_redis::network::tcp_client_iface::is_connected(void ) const
pure virtual
Returns
whether the client is currently connected or not

Implemented incpp_redis::network::tcp_client.

◆ set_on_disconnection_handler()

virtual void cpp_redis::network::tcp_client_iface::set_on_disconnection_handler(constdisconnection_handler_tdisconnection_handler)
pure virtual

set on disconnection handler

Parameters
disconnection_handlerhandler to be called in case of a disconnection

Implemented incpp_redis::network::tcp_client.


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

Generated by  doxygen 1.8.13
[8]ページ先頭

©2009-2025 Movatter.jp