Couchbase C++ SDK 1.0.1 (rev. 58d46d7)
Loading...
Searching...
No Matches
transaction_keyspace.hxx
Go to the documentation of this file.
1/*
2 * Copyright 2021-Present Couchbase, Inc.
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 */
16#pragma once
17
18#include <string>
19
21{
26 transaction_keyspace(std::string bucket_name,
27 std::string scope_name,
28 std::string collection_name);
29
30 explicit transaction_keyspace(const std::string& bucket_name);
31
32 auto operator==(const transaction_keyspace& keyspace) const -> bool
33 {
34 return bucket == keyspace.bucket && scope == keyspace.scope &&
35 collection == keyspace.collection;
36 }
37
47 auto valid() const -> bool;
48
50 template<typename OStream>
51 friend auto operator<<(OStream& os, const transaction_keyspace& keyspace) -> OStream&
52 {
53 os << "transaction_keyspace{";
54 os << "bucket: " << keyspace.bucket;
55 os << ", scope: " << keyspace.scope;
56 os << ", collection: " << keyspace.collection;
57 os << "}";
58 return os;
59 }
60
61 std::string bucket;
62 std::string scope;
63 std::string collection;
64};
65} // namespace couchbase::transactions
Provides access to Couchbase bucket.
Definition bucket.hxx:45
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
Definition transactions.hxx:28
Offline, serializable representation of a bucket, scope, and collection.
Definition transaction_keyspace.hxx:25
transaction_keyspace(std::string bucket_name, std::string scope_name, std::string collection_name)
std::string scope
Definition transaction_keyspace.hxx:62
std::string bucket
Definition transaction_keyspace.hxx:61
auto operator==(const transaction_keyspace &keyspace) const -> bool
Definition transaction_keyspace.hxx:32
std::string collection
Definition transaction_keyspace.hxx:63
auto valid() const -> bool
Check if a keyspace is valid.
transaction_keyspace(const std::string &bucket_name)