Couchbase C++ SDK 1.0.4 (rev. 5355b0f)
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;
36#endif
37
44class bucket
45{
46public:
55 [[nodiscard]] auto default_scope() const -> scope;
56
65 [[nodiscard]] auto default_collection() const -> collection;
66
76 [[nodiscard]] auto scope(std::string_view scope_name) const -> scope;
77
90 void ping(const ping_options& options, ping_handler&& handler) const;
91
104 [[nodiscard]] auto ping(const ping_options& options = {}) const
105 -> std::future<std::pair<error, ping_result>>;
106
115 [[nodiscard]] auto collections() const -> collection_manager;
116
117private:
118 friend cluster;
119
120 bucket(core::cluster core, std::string_view name);
121
122 std::shared_ptr<bucket_impl> impl_;
123};
124} // namespace couchbase
Provides access to Couchbase bucket.
Definition bucket.hxx:45
auto default_collection() const -> collection
Opens the default collection for this bucket using the default scope.
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:70
The scope identifies a group of collections and allows high application density as a result.
Definition scope.hxx:47
Represents a single item from the result of collection::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