cpp-msgpack-rpc
0.2.0
An RPC library implementing MessagePack RPC.
Toggle main menu visibility
Loading...
Searching...
No Matches
server.h
Go to the documentation of this file.
1
/*
2
* Copyright 2024 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 <memory>
23
#include <utility>
24
#include <vector>
25
26
#include "
msgpack_rpc/addresses/uri.h
"
27
#include "
msgpack_rpc/executors/i_executor.h
"
28
#include "
msgpack_rpc/servers/impl/i_server_impl.h
"
29
30
namespace
msgpack_rpc::servers
{
31
37
class
Server
{
38
public
:
47
explicit
Server
(std::unique_ptr<impl::IServerImpl>
impl
) noexcept
48
:
impl_
(std::move(
impl
)) {}
49
56
void
stop
() {
impl_
->stop(); }
57
63
void
run_until_signal
() {
impl_
->run_until_signal(); }
64
70
[[nodiscard]] std::vector<addresses::URI>
local_endpoint_uris
() {
71
return
impl_
->local_endpoint_uris();
72
}
73
82
[[nodiscard]] std::shared_ptr<executors::IExecutor>
executor
() {
83
return
impl_
->executor();
84
}
85
86
private
:
88
std::unique_ptr<impl::IServerImpl>
impl_
;
89
};
90
91
}
// namespace msgpack_rpc::servers
msgpack_rpc::servers::Server::stop
void stop()
Stop processing of this server.
Definition
server.h:56
msgpack_rpc::servers::Server::Server
Server(std::unique_ptr< impl::IServerImpl > impl) noexcept
Constructor.
Definition
server.h:47
msgpack_rpc::servers::Server::impl_
std::unique_ptr< impl::IServerImpl > impl_
Object of the internal implementation.
Definition
server.h:88
msgpack_rpc::servers::Server::run_until_signal
void run_until_signal()
Run processing of this server until SIGINT or SIGTERM is received.
Definition
server.h:63
msgpack_rpc::servers::Server::local_endpoint_uris
std::vector< addresses::URI > local_endpoint_uris()
Get the URIs of the local endpoints in this server.
Definition
server.h:70
msgpack_rpc::servers::Server::executor
std::shared_ptr< executors::IExecutor > executor()
Get the executor.
Definition
server.h:82
i_executor.h
Definition of IExecutor class.
i_server_impl.h
Definition of IServerImpl class.
msgpack_rpc::servers::impl
Namespace of internal implementation.
Definition
i_server_builder_impl.h:33
msgpack_rpc::servers
Namespace of servers.
Definition
i_server_builder_impl.h:33
uri.h
Definition of URI class.
include
msgpack_rpc
servers
server.h
Generated on
for cpp-msgpack-rpc by
1.18.0