Couchbase C++ SDK
1.4.0 (rev. 59aa900)
Toggle main menu visibility
Loading...
Searching...
No Matches
ping_result.hxx
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2
/*
3
* Copyright 2023-present Couchbase, Inc.
4
*
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
8
*
9
* http://www.apache.org/licenses/LICENSE-2.0
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*/
17
18
#pragma once
19
20
#include <
couchbase/endpoint_ping_report.hxx
>
21
#include <
couchbase/service_type.hxx
>
22
23
#include <cstdint>
24
#include <map>
25
#include <string>
26
#include <utility>
27
#include <vector>
28
29
namespace
couchbase
30
{
31
class
ping_result
32
{
33
public
:
38
ping_result
() =
default
;
39
44
ping_result
(std::string
id
,
45
std::uint16_t
version
,
46
std::string
sdk
,
47
std::map<
service_type
, std::vector<endpoint_ping_report>>
endpoints
)
48
: id_{ std::move(
id
) }
49
, version_{
version
}
50
, sdk_{ std::move(
sdk
) }
51
, endpoints_{ std::move(
endpoints
) }
52
{
53
}
54
63
[[nodiscard]]
auto
id
() const -> std::
string
64
{
65
return
id_;
66
}
67
76
[[nodiscard]]
auto
version
() const -> std::uint16_t
77
{
78
return
version_;
79
}
80
89
[[nodiscard]]
auto
sdk
() const -> std::
string
90
{
91
return
sdk_;
92
}
93
102
[[nodiscard]]
auto
endpoints
() const -> std::map<
service_type
, std::vector<
endpoint_ping_report
>>
103
{
104
return
endpoints_;
105
}
106
112
[[nodiscard]]
auto
as_json
() const -> std::
string
;
113
114
private:
115
std::
string
id_{};
116
std::uint16_t version_{};
117
std::string sdk_{};
118
std::map<service_type, std::vector<endpoint_ping_report>> endpoints_{};
119
};
120
}
// namespace couchbase
couchbase::endpoint_ping_report
Definition
endpoint_ping_report.hxx:56
couchbase::ping_result::ping_result
ping_result(std::string id, std::uint16_t version, std::string sdk, std::map< service_type, std::vector< endpoint_ping_report > > endpoints)
Definition
ping_result.hxx:44
couchbase::ping_result::as_json
auto as_json() const -> std::string
Exports the ping report as JSON.
couchbase::ping_result::endpoints
auto endpoints() const -> std::map< service_type, std::vector< endpoint_ping_report > >
Returns the ping reports for each individual endpoint, organised by service type.
Definition
ping_result.hxx:102
couchbase::ping_result::id
auto id() const -> std::string
Returns the ID of this report.
Definition
ping_result.hxx:63
couchbase::ping_result::version
auto version() const -> std::uint16_t
Returns the version of this report (useful when exporting to JSON).
Definition
ping_result.hxx:76
couchbase::ping_result::ping_result
ping_result()=default
couchbase::ping_result::sdk
auto sdk() const -> std::string
Returns the identifier of this SDK (useful when exporting to JSON).
Definition
ping_result.hxx:89
endpoint_ping_report.hxx
couchbase
Represents a single item from the result of scan().
Definition
allow_querying_search_index_options.hxx:28
couchbase::service_type
service_type
Definition
service_type.hxx:22
service_type.hxx
couchbase
ping_result.hxx
Generated by
1.17.0