cpp-msgpack-rpc
0.2.0
An RPC library implementing MessagePack RPC.
Toggle main menu visibility
Loading...
Searching...
No Matches
server_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 <string_view>
23
#include <vector>
24
25
#include "
msgpack_rpc/addresses/uri.h
"
26
#include "
msgpack_rpc/config/executor_config.h
"
27
#include "
msgpack_rpc/config/message_parser_config.h
"
28
#include "msgpack_rpc/impl/msgpack_rpc_export.h"
29
30
namespace
msgpack_rpc::config
{
31
35
class
MSGPACK_RPC_EXPORT
ServerConfig
{
36
public
:
43
ServerConfig
();
44
51
ServerConfig
&
add_uri
(
const
addresses::URI
& uri);
52
59
ServerConfig
&
add_uri
(std::string_view uri);
60
66
[[nodiscard]]
const
std::vector<addresses::URI>&
uris
() const noexcept;
67
73
[[nodiscard]]
MessageParserConfig
&
message_parser
() noexcept;
74
80
[[nodiscard]] const
MessageParserConfig
&
message_parser
() const noexcept;
81
87
[[nodiscard]]
ExecutorConfig
&
executor
() noexcept;
88
94
[[nodiscard]] const
ExecutorConfig
&
executor
() const noexcept;
95
96
private:
98
std
::vector<
addresses
::URI>
uris_
;
99
101
MessageParserConfig
message_parser_
;
102
104
ExecutorConfig
executor_
;
105
};
106
107
}
// 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::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::ServerConfig::ServerConfig
ServerConfig()
Constructor.
msgpack_rpc::config::ServerConfig::executor
ExecutorConfig & executor() noexcept
Get the configuration of executors.
Definition
server_config.cpp:51
msgpack_rpc::config::ServerConfig::executor_
ExecutorConfig executor_
Configuration of executors.
Definition
server_config.h:104
msgpack_rpc::config::ServerConfig::message_parser_
MessageParserConfig message_parser_
Configuration of parsers of messages.
Definition
server_config.h:101
msgpack_rpc::config::ServerConfig::uris_
std::vector< addresses::URI > uris_
URIs.
Definition
server_config.h:98
msgpack_rpc::config::ServerConfig::uris
const std::vector< addresses::URI > & uris() const noexcept
Get the URIs of the server.
Definition
server_config.cpp:39
msgpack_rpc::config::ServerConfig::message_parser
MessageParserConfig & message_parser() noexcept
Get the configuration of parsers of messages.
Definition
server_config.cpp:43
msgpack_rpc::config::ServerConfig::add_uri
ServerConfig & add_uri(const addresses::URI &uri)
Add a URI of the server.
Definition
server_config.cpp:30
executor_config.h
Definition of ExecutorConfig class.
message_parser_config.h
Definition of MessageParserConfig class.
msgpack_rpc::addresses
Namespace of addresses.
Definition
i_address.h:26
msgpack_rpc::config
Namespace of configurations.
Definition
client_config.h:32
std
STL namespace.
uri.h
Definition of URI class.
include
msgpack_rpc
config
server_config.h
Generated on
for cpp-msgpack-rpc by
1.18.0