MongoDB C++ Driver  mongocxx-3.7.0
bucket.hpp
1 // Copyright 2017 MongoDB Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #pragma once
16 
17 #include <string>
18 
19 #include <bsoncxx/stdx/optional.hpp>
20 #include <mongocxx/read_concern.hpp>
21 #include <mongocxx/read_preference.hpp>
22 #include <mongocxx/stdx.hpp>
23 #include <mongocxx/write_concern.hpp>
24 
25 #include <mongocxx/config/prelude.hpp>
26 
27 namespace mongocxx {
28 MONGOCXX_INLINE_NAMESPACE_BEGIN
29 namespace options {
30 namespace gridfs {
31 
35 class MONGOCXX_API bucket {
36  public:
47  bucket& bucket_name(std::string bucket_name);
48 
55  const stdx::optional<std::string>& bucket_name() const;
56 
68  bucket& chunk_size_bytes(std::int32_t chunk_size_bytes);
69 
76  const stdx::optional<std::int32_t>& chunk_size_bytes() const;
77 
90 
97  const stdx::optional<class read_concern>& read_concern() const;
98 
117 
124  const stdx::optional<class read_preference>& read_preference() const;
125 
138 
145  const stdx::optional<class write_concern>& write_concern() const;
146 
147  private:
148  stdx::optional<std::string> _bucket_name;
149  stdx::optional<std::int32_t> _chunk_size_bytes;
150  stdx::optional<class read_concern> _read_concern;
151  stdx::optional<class read_preference> _read_preference;
152  stdx::optional<class write_concern> _write_concern;
153 };
154 
155 } // namespace gridfs
156 } // namespace options
157 MONGOCXX_INLINE_NAMESPACE_END
158 } // namespace mongocxx
159 
160 #include <mongocxx/config/postlude.hpp>
mongocxx::options::gridfs::bucket
Class representing the optional arguments to a MongoDB GridFS bucket creation operation.
Definition: bucket.hpp:35
mongocxx
Top level namespace for the MongoDB C++ driver.
Definition: bulk_write.hpp:24
mongocxx::write_concern
Class representing the server-side requirement for reporting the success of a write operation.
Definition: write_concern.hpp:56
mongocxx::read_concern
A class to represent the read concern.
Definition: read_concern.hpp:54
mongocxx::read_preference
Class representing a preference for how the driver routes read operations to members of a replica set...
Definition: read_preference.hpp:63