Loading...
Searching...
No Matches
read_concern.hpp
Go to the documentation of this file.
// Copyright 2009-present MongoDB, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <mongocxx/v1/read_concern-fwd.hpp> // IWYU pragma: export
//
#include <mongocxx/v1/detail/prelude.hpp>
#include <bsoncxx/v1/document/value-fwd.hpp>
#include <bsoncxx/v1/stdx/string_view.hpp>
#include <mongocxx/v1/config/export.hpp>
namespace mongocxx {
namespace v1 {
class read_concern {
private:
void* _impl; // mongoc_read_concern_t
public:
enum class level {
k_local,
k_majority,
k_linearizable,
k_server_default,
k_unknown,
k_available,
k_snapshot,
};
MONGOCXX_ABI_EXPORT_CDECL() ~read_concern();
MONGOCXX_ABI_EXPORT_CDECL() read_concern(read_concern&& other) noexcept;
MONGOCXX_ABI_EXPORT_CDECL(read_concern&) operator=(read_concern&& other) noexcept;
MONGOCXX_ABI_EXPORT_CDECL() read_concern(read_concern const& other);
MONGOCXX_ABI_EXPORT_CDECL(read_concern&) operator=(read_concern const& other);
MONGOCXX_ABI_EXPORT_CDECL() read_concern();
MONGOCXX_ABI_EXPORT_CDECL(read_concern&) acknowledge_level(level v);
MONGOCXX_ABI_EXPORT_CDECL(level) acknowledge_level() const;
MONGOCXX_ABI_EXPORT_CDECL(read_concern&) acknowledge_string(bsoncxx::v1::stdx::string_view v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::string_view) acknowledge_string() const;
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::document::value) to_document() const;
friend MONGOCXX_ABI_EXPORT_CDECL(bool) operator==(read_concern const& lhs, read_concern const& rhs);
friend bool operator!=(read_concern const& lhs, read_concern const& rhs) {
return !(lhs == rhs);
}
class internal;
private:
/* explicit(false) */ read_concern(void* impl);
};
} // namespace v1
} // namespace mongocxx
#include <mongocxx/v1/detail/postlude.hpp>
mongocxx::v1::read_concern::read_concern
read_concern()
Default initialization.
mongocxx::v1::read_concern::to_document
bsoncxx::v1::document::value to_document() const
Return this read concern option as a document.
mongocxx::v1::read_concern::~read_concern
~read_concern()
Destroy this object.
mongocxx::v1::read_concern::acknowledge_level
read_concern & acknowledge_level(level v)
Set the read concern level.
mongocxx::v1::read_concern::read_concern
read_concern(read_concern &&other) noexcept
Move constructor.
mongocxx::v1::read_concern::level
level
The read concern level.
Definition read_concern.hpp:53
mongocxx::v1::read_concern::level::k_unknown
@ k_unknown
An unknown (unsupported) read concern level.
Definition read_concern.hpp:82
mongocxx::v1::read_concern::level::k_linearizable
@ k_linearizable
Read Concern "linearizable" (MongoDB Manual)
Definition read_concern.hpp:69
mongocxx::v1::read_concern::level::k_server_default
@ k_server_default
Default MongoDB Read Concerns/Write Concerns (MongoDB Manual)
Definition read_concern.hpp:75
mongocxx::v1::read_concern::level::k_local
@ k_local
Read Concern "local" (MongoDB Manual)
Definition read_concern.hpp:57
mongocxx::v1::read_concern::level::k_snapshot
@ k_snapshot
Read Concern "snapshot" (MongoDB Manual)
Definition read_concern.hpp:94
mongocxx::v1::read_concern::level::k_available
@ k_available
Read Concern "available" (MongoDB Manual)
Definition read_concern.hpp:88
mongocxx::v1::read_concern::level::k_majority
@ k_majority
Read Concern "majority" (MongoDB Manual)
Definition read_concern.hpp:63
mongocxx::v1::read_concern::acknowledge_string
read_concern & acknowledge_string(bsoncxx::v1::stdx::string_view v)
Set the read concern level to an arbitrary string.
export.hpp
Provides macros to control the set of symbols exported in the ABI.
MONGOCXX_ABI_EXPORT_CDECL
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition export.hpp:52
postlude.hpp
The mongocxx v1 macro guard postlude header.
prelude.hpp
The mongocxx v1 macro guard prelude header.
bsoncxx
The top-level namespace within which all bsoncxx library entities are declared.
mongocxx::v1
Declares entities whose ABI stability is guaranteed for documented symbols.
mongocxx
The top-level namespace within which all mongocxx library entities are declared.
value-fwd.hpp
Declares bsoncxx::v1::document::value.
read_concern-fwd.hpp
Declares mongocxx::v1::read_concern.
string_view.hpp
Provides std::string_view-related polyfills for library API usage.