MongoDB C++ Driver
mongocxx-3.4.2
Main Page
Related Pages
+
Namespaces
Namespace List
+
Namespace Members
All
Functions
Enumerations
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
~
+
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
~
Typedefs
Enumerations
Related Functions
+
Files
File List
Examples
•
All
Classes
Namespaces
Functions
Typedefs
Enumerations
Enumerator
Friends
Pages
src
mongocxx
pool.hpp
1
// Copyright 2015 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 <functional>
18
#include <memory>
19
20
#include <bsoncxx/stdx/optional.hpp>
21
#include <mongocxx/options/pool.hpp>
22
#include <mongocxx/stdx.hpp>
23
#include <mongocxx/uri.hpp>
24
25
#include <mongocxx/config/prelude.hpp>
26
27
namespace
mongocxx
{
28
MONGOCXX_INLINE_NAMESPACE_BEGIN
29
30
class
client;
31
47
class
MONGOCXX_API
pool
{
48
public
:
59
explicit
pool
(
const
uri
& mongodb_uri =
mongocxx::uri
(),
60
const
options::pool
& options =
options::pool
());
61
65
~
pool
();
66
74
class
MONGOCXX_API
entry
{
75
public
:
77
client
* operator->()
const
& noexcept;
78
client
* operator->() && =
delete
;
79
81
client
& operator*()
const
& noexcept;
82
client
& operator*() && =
delete
;
83
85
entry
& operator=(std::nullptr_t) noexcept;
86
88
explicit
operator
bool()
const
noexcept;
89
90
private
:
91
friend
class
pool
;
92
93
using
unique_client = std::unique_ptr<client, std::function<void MONGOCXX_CALL(client*)>>;
94
95
MONGOCXX_PRIVATE
explicit
entry
(unique_client);
96
97
unique_client _client;
98
};
99
104
entry
acquire();
105
110
stdx::optional<entry> try_acquire();
111
112
private
:
113
MONGOCXX_PRIVATE
void
_release(
client
*
client
);
114
115
class
MONGOCXX_PRIVATE impl;
116
const
std::unique_ptr<impl> _impl;
117
};
118
119
MONGOCXX_INLINE_NAMESPACE_END
120
}
// namespace mongocxx
121
122
#include <mongocxx/config/postlude.hpp>
mongocxx::uri
Class representing a MongoDB connection string URI.
Definition:
uri.hpp:40
mongocxx
Top level namespace for the MongoDB C++ driver.
Definition:
bulk_write.hpp:24
mongocxx::client
Class representing a client connection to MongoDB.
Definition:
client.hpp:57
mongocxx::pool
A pool of client objects associated with a MongoDB deployment.
Definition:
pool.hpp:47
mongocxx::pool::entry
An entry is a handle on a client object acquired via the pool.
Definition:
pool.hpp:74
mongocxx::options::pool
Class representing the optional arguments to a MongoDB driver pool object.
Definition:
pool.hpp:29
Generated by
1.8.13