cpp-msgpack-rpc
0.2.0
An RPC library implementing MessagePack RPC.
Toggle main menu visibility
Loading...
Searching...
No Matches
client_config.h
Go to the documentation of this file.
1
/*
2
* Copyright 2023 MusicScience37 (Kenta Kabashima)
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
20
#pragma once
21
22
#include <chrono>
23
#include <string_view>
24
#include <vector>
25
26
#include "
msgpack_rpc/addresses/uri.h
"
27
#include "
msgpack_rpc/config/executor_config.h
"
28
#include "
msgpack_rpc/config/message_parser_config.h
"
29
#include "
msgpack_rpc/config/reconnection_config.h
"
30
#include "msgpack_rpc/impl/msgpack_rpc_export.h"
31
32
namespace
msgpack_rpc::config
{
33
38
class
MSGPACK_RPC_EXPORT
ClientConfig
{
39
public
:
46
ClientConfig
();
47
54
ClientConfig
&
add_uri
(
addresses::URI
uri);
55
62
ClientConfig
&
add_uri
(std::string_view uri);
63
69
[[nodiscard]]
const
std::vector<addresses::URI>&
uris
()
const
noexcept
;
70
77
ClientConfig
&
call_timeout
(std::chrono::nanoseconds value);
78
84
[[nodiscard]] std::chrono::nanoseconds
call_timeout
()
const
noexcept
;
85
91
[[nodiscard]]
MessageParserConfig
&
message_parser
()
noexcept
;
92
98
[[nodiscard]]
const
MessageParserConfig
&
message_parser
()
const
noexcept
;
99
105
[[nodiscard]]
ExecutorConfig
&
executor
()
noexcept
;
106
112
[[nodiscard]]
const
ExecutorConfig
&
executor
()
const
noexcept
;
113
119
[[nodiscard]]
ReconnectionConfig
&
reconnection
()
noexcept
;
120
126
[[nodiscard]]
const
ReconnectionConfig
&
reconnection
()
const
noexcept
;
127
128
private
:
130
std::vector<addresses::URI>
uris_
;
131
133
std::chrono::nanoseconds
call_timeout_
;
134
136
MessageParserConfig
message_parser_
;
137
139
ExecutorConfig
executor_
;
140
142
ReconnectionConfig
reconnection_
;
143
};
144
145
}
// namespace msgpack_rpc::config
msgpack_rpc::addresses::URI
Class of URIs (Uniform Resource Identifiers) to specify endpoints in this library.
Definition
uri.h:38
msgpack_rpc::config::ClientConfig::reconnection
ReconnectionConfig & reconnection() noexcept
Get the configuration of reconnection.
Definition
client_config.cpp:81
msgpack_rpc::config::ClientConfig::uris_
std::vector< addresses::URI > uris_
URIs.
Definition
client_config.h:130
msgpack_rpc::config::ClientConfig::call_timeout
ClientConfig & call_timeout(std::chrono::nanoseconds value)
Set the duration of timeout of RPCs.
Definition
client_config.cpp:54
msgpack_rpc::config::ClientConfig::executor
ExecutorConfig & executor() noexcept
Get the configuration of executors.
Definition
client_config.cpp:75
msgpack_rpc::config::ClientConfig::executor_
ExecutorConfig executor_
Configuration of executors.
Definition
client_config.h:139
msgpack_rpc::config::ClientConfig::ClientConfig
ClientConfig()
Constructor.
Definition
client_config.cpp:39
msgpack_rpc::config::ClientConfig::reconnection_
ReconnectionConfig reconnection_
Configuration of reconnection.
Definition
client_config.h:142
msgpack_rpc::config::ClientConfig::uris
const std::vector< addresses::URI > & uris() const noexcept
Get the URIs of the server.
Definition
client_config.cpp:50
msgpack_rpc::config::ClientConfig::message_parser_
MessageParserConfig message_parser_
Configuration of parsers of messages.
Definition
client_config.h:136
msgpack_rpc::config::ClientConfig::call_timeout_
std::chrono::nanoseconds call_timeout_
Duration of timeout of RPCs.
Definition
client_config.h:133
msgpack_rpc::config::ClientConfig::message_parser
MessageParserConfig & message_parser() noexcept
Get the configuration of parsers of messages.
Definition
client_config.cpp:67
msgpack_rpc::config::ClientConfig::add_uri
ClientConfig & add_uri(addresses::URI uri)
Add a URI of the server.
Definition
client_config.cpp:41
msgpack_rpc::config::ExecutorConfig
Class of configuration of executors.
Definition
executor_config.h:31
msgpack_rpc::config::MessageParserConfig
Class of configuration of parsers of messages.
Definition
message_parser_config.h:31
msgpack_rpc::config::ReconnectionConfig
Class of configurations of reconnection.
Definition
reconnection_config.h:31
executor_config.h
Definition of ExecutorConfig class.
message_parser_config.h
Definition of MessageParserConfig class.
msgpack_rpc::config
Namespace of configurations.
Definition
client_config.h:32
reconnection_config.h
Definition of ReconnectionConfig class.
uri.h
Definition of URI class.
include
msgpack_rpc
config
client_config.h
Generated on
for cpp-msgpack-rpc by
1.18.0