Couchbase C++ SDK 1.0.1 (rev. 58d46d7)
Loading...
Searching...
No Matches
transaction_get_result.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#include <vector>
20
21#include <couchbase/cas.hxx>
24#include <couchbase/result.hxx>
25
26// forward declarations...
28{
29class attempt_context_impl;
30class transaction_get_result;
31class transaction_links;
32class document_metadata;
33} // namespace couchbase::core::transactions
34
36{
37
39{
40public:
45
51 template<typename Document,
53 std::enable_if_t<!codec::is_transcoder_v<Document>, bool> = true,
54 std::enable_if_t<codec::is_transcoder_v<Transcoder>, bool> = true>
56 {
57 return Transcoder::template decode<Document>(content());
58 }
59
60 template<typename Transcoder, std::enable_if_t<codec::is_transcoder_v<Transcoder>, bool> = true>
61 [[nodiscard]] auto content_as() const -> typename Transcoder::document_type
62 {
63 return Transcoder::decode(content());
64 }
65
71 [[nodiscard]] auto id() const -> const std::string&;
72
75
77 std::shared_ptr<couchbase::core::transactions::transaction_get_result> base)
78 : base_(std::move(base))
79 {
80 }
81
82 [[nodiscard]] auto content() const -> const codec::encoded_value&;
83
86
87 [[nodiscard]] auto bucket() const -> const std::string&;
88 [[nodiscard]] auto scope() const -> const std::string&;
89 [[nodiscard]] auto collection() const -> const std::string&;
91};
92} // namespace couchbase::transactions
Provides access to Couchbase bucket.
Definition bucket.hxx:45
CAS is a special type that represented in protocol using unsigned 64-bit integer, but only equality c...
Definition cas.hxx:34
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 transaction_get_result.hxx:39
auto content_as() const -> typename Transcoder::document_type
Definition transaction_get_result.hxx:61
auto id() const -> const std::string &
Get document id.
friend class couchbase::core::transactions::attempt_context_impl
Definition transaction_get_result.hxx:85
friend class couchbase::core::transactions::transaction_get_result
Definition transaction_get_result.hxx:84
auto content_as() const -> Document
Content of the document.
Definition transaction_get_result.hxx:55
The transactions object is used to initiate a transaction.
Definition transactions.hxx:39
json_transcoder< tao_json_serializer > default_json_transcoder
Definition default_json_transcoder.hxx:28
Definition transaction_get_result.hxx:28
Definition transactions.hxx:28
Represents a single item from the result of collection::scan()
Definition allow_querying_search_index_options.hxx:28