cpp-msgpack-rpc 0.2.0
An RPC library implementing MessagePack RPC.
Loading...
Searching...
No Matches
msgpack_rpc::clients::impl::ClientImpl Class Referencefinal

Class of internal implementation of clients. More...

#include <msgpack_rpc/clients/impl/client_impl.h>

Inheritance diagram for msgpack_rpc::clients::impl::ClientImpl:
Collaboration diagram for msgpack_rpc::clients::impl::ClientImpl:

Public Member Functions

 ClientImpl (ClientImpl &&)=delete
 ClientImpl (const ClientImpl &)=delete
 ClientImpl (std::shared_ptr< ClientConnector > connector, std::shared_ptr< CallList > call_list, std::shared_ptr< executors::IAsyncExecutor > executor, std::shared_ptr< logging::Logger > logger)
 Constructor.
 ~ClientImpl () override
 Destructor.
std::shared_ptr< ICallFutureImplasync_call (messages::MethodNameView method_name, const IParametersSerializer &parameters) override
 Asynchronously call a method.
std::shared_ptr< executors::IExecutorexecutor () override
 Get the executor.
void notify (messages::MethodNameView method_name, const IParametersSerializer &parameters) override
 Notify to a method.
ClientImploperator= (ClientImpl &&)=delete
ClientImploperator= (const ClientImpl &)=delete
void start ()
 Start processing of this client.
void stop () override
 Stop processing of this client.
Public Member Functions inherited from msgpack_rpc::clients::impl::IClientImpl
 IClientImpl (const IClientImpl &)=delete
 IClientImpl (IClientImpl &&)=delete
virtual ~IClientImpl () noexcept=default
 Destructor.
IClientImploperator= (const IClientImpl &)=delete
IClientImploperator= (IClientImpl &&)=delete

Private Member Functions

void check_executor_state ()
 Check whether the executor is running.

Private Attributes

std::shared_ptr< CallListcall_list_
 List of RPCs.
std::shared_ptr< ClientConnectorconnector_
 Connector.
std::shared_ptr< executors::IAsyncExecutorexecutor_
 Executor.
std::atomic< bool > is_started_ {false}
 Whether this client has been started.
std::atomic< bool > is_stopped_ {false}
 Whether this client has been stopped.
std::shared_ptr< logging::Loggerlogger_
 Logger.
std::shared_ptr< MessageSendersender_
 Sender of messages.

Additional Inherited Members

Protected Member Functions inherited from msgpack_rpc::clients::impl::IClientImpl
 IClientImpl () noexcept=default
 Constructor.

Detailed Description

Class of internal implementation of clients.

Definition at line 48 of file client_impl.h.

Constructor & Destructor Documentation

◆ ClientImpl()

msgpack_rpc::clients::impl::ClientImpl::ClientImpl ( std::shared_ptr< ClientConnector > connector,
std::shared_ptr< CallList > call_list,
std::shared_ptr< executors::IAsyncExecutor > executor,
std::shared_ptr< logging::Logger > logger )
inline

Constructor.

Parameters
[in]connectorConnector.
[in]call_listList of RPCs.
[in]executorExecutor.
[in]loggerLogger.

Definition at line 58 of file client_impl.h.

◆ ~ClientImpl()

msgpack_rpc::clients::impl::ClientImpl::~ClientImpl ( )
inlineoverride

Destructor.

Definition at line 71 of file client_impl.h.

Member Function Documentation

◆ async_call()

std::shared_ptr< ICallFutureImpl > msgpack_rpc::clients::impl::ClientImpl::async_call ( messages::MethodNameView method_name,
const IParametersSerializer & parameters )
inlinenodiscardoverridevirtual

Asynchronously call a method.

Parameters
[in]method_nameName of the method.
[in]parametersParameters.
Returns
Future object to wait the result of the call.

Implements msgpack_rpc::clients::impl::IClientImpl.

Definition at line 127 of file client_impl.h.

◆ check_executor_state()

void msgpack_rpc::clients::impl::ClientImpl::check_executor_state ( )
inlineprivate

Check whether the executor is running.

Definition at line 165 of file client_impl.h.

◆ executor()

std::shared_ptr< executors::IExecutor > msgpack_rpc::clients::impl::ClientImpl::executor ( )
inlinenodiscardoverridevirtual

Get the executor.

Returns
Executor.
Note
This function is mainly for testing. So this function may be removed in the future.

Implements msgpack_rpc::clients::impl::IClientImpl.

Definition at line 157 of file client_impl.h.

◆ notify()

void msgpack_rpc::clients::impl::ClientImpl::notify ( messages::MethodNameView method_name,
const IParametersSerializer & parameters )
inlineoverridevirtual

Notify to a method.

Parameters
[in]method_nameName of the method.
[in]parametersParameters.
Note
Notifications are always processed asynchronously because a notification doesn't have a response.

Implements msgpack_rpc::clients::impl::IClientImpl.

Definition at line 144 of file client_impl.h.

◆ start()

void msgpack_rpc::clients::impl::ClientImpl::start ( )
inline

Start processing of this client.

Definition at line 90 of file client_impl.h.

◆ stop()

void msgpack_rpc::clients::impl::ClientImpl::stop ( )
inlineoverridevirtual

Stop processing of this client.

Implements msgpack_rpc::clients::impl::IClientImpl.

Definition at line 111 of file client_impl.h.

Member Data Documentation

◆ call_list_

std::shared_ptr<CallList> msgpack_rpc::clients::impl::ClientImpl::call_list_
private

List of RPCs.

Definition at line 179 of file client_impl.h.

◆ connector_

std::shared_ptr<ClientConnector> msgpack_rpc::clients::impl::ClientImpl::connector_
private

Connector.

Definition at line 176 of file client_impl.h.

◆ executor_

std::shared_ptr<executors::IAsyncExecutor> msgpack_rpc::clients::impl::ClientImpl::executor_
private

Executor.

Definition at line 173 of file client_impl.h.

◆ is_started_

std::atomic<bool> msgpack_rpc::clients::impl::ClientImpl::is_started_ {false}
private

Whether this client has been started.

Definition at line 188 of file client_impl.h.

◆ is_stopped_

std::atomic<bool> msgpack_rpc::clients::impl::ClientImpl::is_stopped_ {false}
private

Whether this client has been stopped.

Definition at line 191 of file client_impl.h.

◆ logger_

std::shared_ptr<logging::Logger> msgpack_rpc::clients::impl::ClientImpl::logger_
private

Logger.

Definition at line 182 of file client_impl.h.

◆ sender_

std::shared_ptr<MessageSender> msgpack_rpc::clients::impl::ClientImpl::sender_
private

Sender of messages.

Definition at line 185 of file client_impl.h.


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