Couchbase C++ SDK 1.2.0 (rev. c2439a4)
Loading...
Searching...
No Matches
bucket.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 2020-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
23#include <couchbase/scope.hxx>
24
25#include <memory>
26
27namespace couchbase
28{
29#ifndef COUCHBASE_CXX_CLIENT_DOXYGEN
30namespace core
31{
32class cluster;
33} // namespace core
34class cluster;
35class bucket_impl;
36namespace crypto
37{
38class manager;
39} // namespace crypto
40#endif
41
48class bucket
49{
50public:
59 [[nodiscard]] auto default_scope() const -> scope;
60
69 [[nodiscard]] auto default_collection() const -> collection;
70
80 [[nodiscard]] auto scope(std::string_view scope_name) const -> scope;
81
94 void ping(const ping_options& options, ping_handler&& handler) const;
95
108 [[nodiscard]] auto ping(const ping_options& options = {}) const
109 -> std::future<std::pair<error, ping_result>>;
110
119 [[nodiscard]] auto collections() const -> collection_manager;
120
121private:
122 friend cluster;
123
124 bucket(core::cluster core, std::string_view name, std::shared_ptr<crypto::manager>);
125
126 std::shared_ptr<bucket_impl> impl_;
127};
128} // namespace couchbase
auto default_collection() const -> collection
Opens the default collection for this bucket using the default scope.
auto scope(std::string_view scope_name) const -> scope
Opens the scope with the given name.
auto default_scope() const -> scope
Opens default scope.
auto collections() const -> collection_manager
Provides access to the collection management services.
void ping(const ping_options &options, ping_handler &&handler) const
Performs application-level ping requests against services in the Couchbase cluster.
The cluster is the main entry point when connecting to a Couchbase cluster.
Definition cluster.hxx:60
Definition collection_manager.hxx:47
The collection provides access to all collection APIs.
Definition collection.hxx:74
Definition expiry.hxx:24
Definition internal.hxx:27
Represents a single item from the result of scan()
Definition allow_querying_search_index_options.hxx:28
std::function< void(error, ping_result)> ping_handler
Definition ping_options.hxx:93
Definition ping_options.hxx:32