Skip to content

Commit 3a458fd

Browse files
committed
CXX-786 Remove deprecated 'implementation' methods
1 parent 75a8204 commit 3a458fd

20 files changed

+0
-158
lines changed

src/mongocxx/bulk_write.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,6 @@ void bulk_write::append(const model::write& operation) {
8787
}
8888
}
8989

90-
void* bulk_write::implementation() const {
91-
return _impl->operation_t;
92-
}
93-
9490
void bulk_write::bypass_document_validation(bool bypass_document_validation) {
9591
libmongoc::bulk_operation_set_bypass_document_validation(_impl->operation_t,
9692
bypass_document_validation);

src/mongocxx/bulk_write.hpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,6 @@ class MONGOCXX_API bulk_write {
8888
///
8989
void append(const model::write& operation);
9090

91-
///
92-
/// Gets a handle to the underlying implementation.
93-
///
94-
/// Returned pointer is only valid for the lifetime of this object.
95-
///
96-
/// @deprecated Future versions of the driver reserve the right to change the implementation
97-
/// and remove this interface entirely.
98-
///
99-
/// @return Pointer to implementation of this object, or nullptr if not available.
100-
///
101-
MONGOCXX_DEPRECATED void* implementation() const;
102-
10391
///
10492
/// Whether or not to bypass document validation for this operation.
10593
///

src/mongocxx/client.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ client::operator bool() const noexcept {
6060
return static_cast<bool>(_impl);
6161
}
6262

63-
void* client::implementation() const {
64-
return _get_impl().client_t;
65-
}
66-
6763
void client::read_concern(class read_concern rc) {
6864
libmongoc::client_set_read_concern(_get_impl().client_t, rc._impl->read_concern_t);
6965
}

src/mongocxx/client.hpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,6 @@ class MONGOCXX_API client {
9292
///
9393
explicit operator bool() const noexcept;
9494

95-
///
96-
/// Gets a handle to the underlying implementation.
97-
///
98-
/// Returned pointer is only valid for the lifetime of this object.
99-
///
100-
/// @deprecated Future versions of the driver reserve the right to change the implementation
101-
/// and remove this interface entirely.
102-
///
103-
/// @return Pointer to implementation of this object, or nullptr if not available.
104-
///
105-
MONGOCXX_DEPRECATED void* implementation() const;
106-
10795
///
10896
/// Sets the read concern for this client.
10997
///

src/mongocxx/collection.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,6 @@ cursor collection::aggregate(const pipeline& pipeline, const options::aggregate&
283283
stages.bson(), options_bson.bson(), rp_ptr));
284284
}
285285

286-
void* collection::implementation() const {
287-
return _get_impl().collection_t;
288-
}
289-
290286
stdx::optional<result::insert_one> collection::insert_one(view_or_value document,
291287
const options::insert& options) {
292288
class bulk_write bulk_op(false);

src/mongocxx/collection.hpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -379,18 +379,6 @@ class MONGOCXX_API collection {
379379
bsoncxx::document::view_or_value filter, bsoncxx::document::view_or_value update,
380380
const options::find_one_and_update& options = options::find_one_and_update());
381381

382-
///
383-
/// Gets a handle to the underlying implementation.
384-
///
385-
/// Returned pointer is only valid for the lifetime of this object.
386-
///
387-
/// @deprecated Future versions of the driver reserve the right to change the implementation
388-
/// and remove this interface entirely.
389-
///
390-
/// @return Pointer to implementation of this object, or nullptr if not available.
391-
///
392-
MONGOCXX_DEPRECATED void* implementation() const;
393-
394382
///
395383
/// Inserts a single document into the collection. If the document is missing an identifier
396384
/// (@c _id field) one will be generated for it.

src/mongocxx/cursor.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@ cursor::iterator cursor::end() {
7070
return iterator(nullptr);
7171
}
7272

73-
void* cursor::implementation() const {
74-
return _impl->cursor_t;
75-
}
76-
7773
cursor::iterator::iterator(cursor* cursor) : _cursor(cursor) {
7874
if (cursor) operator++();
7975
}

src/mongocxx/cursor.hpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,6 @@ class MONGOCXX_API cursor {
6363
/// @return the cursor::iterator
6464
iterator end();
6565

66-
///
67-
/// Gets a handle to the underlying implementation.
68-
///
69-
/// Returned pointer is only valid for the lifetime of this object.
70-
///
71-
/// @deprecated Future versions of the driver reserve the right to change the implementation
72-
/// and remove this interface entirely.
73-
///
74-
/// @return Pointer to implementation of this object, or nullptr if not available.
75-
///
76-
MONGOCXX_DEPRECATED void* implementation() const;
77-
7866
private:
7967
friend class collection;
8068
friend class client;

src/mongocxx/database.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ database::operator bool() const noexcept {
6969
return static_cast<bool>(_impl);
7070
}
7171

72-
void* database::implementation() const {
73-
return _get_impl().database_t;
74-
}
75-
7672
cursor database::list_collections(bsoncxx::document::view_or_value filter) {
7773
libbson::scoped_bson_t filter_bson{filter};
7874
bson_error_t error;

src/mongocxx/database.hpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -132,18 +132,6 @@ class MONGOCXX_API database {
132132
///
133133
bool has_collection(stdx::string_view name) const;
134134

135-
///
136-
/// Gets a handle to the underlying implementation.
137-
///
138-
/// Returned pointer is only valid for the lifetime of this object.
139-
///
140-
/// @deprecated Future versions of the driver reserve the right to change the implementation
141-
/// and remove this interface entirely.
142-
///
143-
/// @return Pointer to implementation of this object, or nullptr if not available.
144-
///
145-
MONGOCXX_DEPRECATED void* implementation() const;
146-
147135
///
148136
/// Enumerates the collections in this database.
149137
///

src/mongocxx/pool.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,5 @@ stdx::optional<pool::entry> pool::try_acquire() {
7272
}};
7373
}
7474

75-
void* pool::implementation() const {
76-
return _impl->client_pool_t;
77-
}
78-
7975
MONGOCXX_INLINE_NAMESPACE_END
8076
} // namespace mongocxx

src/mongocxx/pool.hpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,6 @@ class MONGOCXX_API pool {
8484
///
8585
stdx::optional<entry> try_acquire();
8686

87-
///
88-
/// Gets a handle to the underlying implementation.
89-
///
90-
/// Returned pointer is only valid for the lifetime of this object.
91-
///
92-
/// @deprecated Future versions of the driver reserve the right to change the implementation
93-
/// and remove this interface entirely.
94-
///
95-
/// @return Pointer to implementation of this object, or nullptr if not available.
96-
///
97-
MONGOCXX_DEPRECATED void* implementation() const;
98-
9987
private:
10088
MONGOCXX_PRIVATE void _release(client* client);
10189

src/mongocxx/read_preference.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ read_preference::read_preference(read_mode mode, bsoncxx::document::view_or_valu
5454

5555
read_preference::~read_preference() = default;
5656

57-
void* read_preference::implementation() const {
58-
return _impl->read_preference_t;
59-
}
60-
6157
void read_preference::mode(read_mode mode) {
6258
libmongoc::read_prefs_set_mode(_impl->read_preference_t, static_cast<mongoc_read_mode_t>(mode));
6359
}

src/mongocxx/read_preference.hpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -137,18 +137,6 @@ class MONGOCXX_API read_preference {
137137
///
138138
~read_preference();
139139

140-
///
141-
/// Gets a handle to the underlying implementation.
142-
///
143-
/// Returned pointer is only valid for the lifetime of this object.
144-
///
145-
/// @deprecated Future versions of the driver reserve the right to change the implementation
146-
/// and remove this interface entirely.
147-
///
148-
/// @return Pointer to implementation of this object, or nullptr if not available.
149-
///
150-
MONGOCXX_DEPRECATED void* implementation() const;
151-
152140
///
153141
/// Sets a new mode for this read_preference.
154142
///

src/mongocxx/test/collection_mocked.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ TEST_CASE("Collection", "[collection]") {
128128
[&](mongoc_collection_t* collection, mongoc_query_flags_t flags, const bson_t* pipeline,
129129
const bson_t* options, const mongoc_read_prefs_t* read_prefs) -> mongoc_cursor_t* {
130130
collection_aggregate_called = true;
131-
REQUIRE(collection == mongo_coll.implementation());
132131
REQUIRE(flags == MONGOC_QUERY_NONE);
133132

134133
bsoncxx::array::view p(bson_get_data(pipeline), pipeline->len);
@@ -166,8 +165,6 @@ TEST_CASE("Collection", "[collection]") {
166165
else
167166
REQUIRE(!o["bypassDocumentValidation"]);
168167

169-
REQUIRE(read_prefs == mongo_coll.read_preference().implementation());
170-
171168
return NULL;
172169
});
173170

@@ -196,7 +193,6 @@ TEST_CASE("Collection", "[collection]") {
196193
bool success = true;
197194
std::int64_t expected_skip = 0;
198195
std::int64_t expected_limit = 0;
199-
auto expected_read_pref = mongo_coll.read_preference().implementation();
200196

201197
const bson_t* expected_opts = nullptr;
202198

@@ -205,14 +201,10 @@ TEST_CASE("Collection", "[collection]") {
205201
int64_t skip, int64_t limit, const bson_t* cmd_opts,
206202
const mongoc_read_prefs_t* read_prefs, bson_error_t*) {
207203
collection_count_called = true;
208-
REQUIRE(coll == mongo_coll.implementation());
209204
REQUIRE(flags == MONGOC_QUERY_NONE);
210205
REQUIRE(bson_get_data(query) == filter_doc.view().data());
211206
REQUIRE(skip == expected_skip);
212207
REQUIRE(limit == expected_limit);
213-
if (expected_read_pref) {
214-
REQUIRE(MONGOC_READ_SECONDARY == mongoc_read_prefs_get_mode(read_prefs));
215-
}
216208
if (expected_opts) {
217209
REQUIRE(bson_equal(cmd_opts, expected_opts));
218210
}
@@ -279,7 +271,6 @@ TEST_CASE("Collection", "[collection]") {
279271
collection_create_index->interpose([&](mongoc_collection_t* coll, const bson_t*,
280272
const mongoc_index_opt_t* opt, bson_error_t*) {
281273
collection_create_index_called = true;
282-
REQUIRE(coll == mongo_coll.implementation());
283274
if (options.unique()) {
284275
REQUIRE(opt->unique == expected_unique);
285276
}
@@ -330,7 +321,6 @@ TEST_CASE("Collection", "[collection]") {
330321

331322
collection_drop->interpose([&](mongoc_collection_t* coll, bson_error_t*) {
332323
collection_drop_called = true;
333-
REQUIRE(coll == mongo_coll.implementation());
334324
return success;
335325
});
336326

@@ -360,7 +350,6 @@ TEST_CASE("Collection", "[collection]") {
360350
const mongoc_read_prefs_t* read_prefs) {
361351
collection_find_called = true;
362352

363-
REQUIRE(coll == mongo_coll.implementation());
364353
REQUIRE(flags == MONGOC_QUERY_NONE);
365354
REQUIRE(skip == skip);
366355
REQUIRE(limit == limit);
@@ -436,7 +425,6 @@ TEST_CASE("Collection", "[collection]") {
436425

437426
bulk_operation_set_client->interpose([&](mongoc_bulk_operation_t*, void* client) {
438427
bulk_operation_set_client_called = true;
439-
REQUIRE(client == mongo_client.implementation());
440428
});
441429

442430
bulk_operation_set_database->interpose([&](mongoc_bulk_operation_t*, const char* db) {
@@ -454,7 +442,6 @@ TEST_CASE("Collection", "[collection]") {
454442
[&](mongoc_bulk_operation_t*, const mongoc_write_concern_t*) {
455443
bulk_operation_set_write_concern_called = true;
456444
// TODO: actually test the write concern setting is correct or default
457-
// REQUIRE(wc == concern.implementation());
458445
});
459446

460447
bulk_operation_execute->interpose(

src/mongocxx/test/pool.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ TEST_CASE(
148148

149149
REQUIRE(!!client);
150150
REQUIRE(try_pop_called);
151-
REQUIRE(client->get()->implementation() == fake);
152151
}
153152
}
154153

src/mongocxx/uri.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ std::vector<uri::host> uri::hosts() const {
6464
return result;
6565
}
6666

67-
void* uri::implementation() const {
68-
return _impl->uri_t;
69-
}
70-
7167
bsoncxx::document::view uri::options() const {
7268
auto opts_bson = libmongoc::uri_get_options(_impl->uri_t);
7369
return bsoncxx::document::view{::bson_get_data(opts_bson), opts_bson->len};

src/mongocxx/uri.hpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,6 @@ class MONGOCXX_API uri {
103103
///
104104
std::string database() const;
105105

106-
///
107-
/// Gets a handle to the underlying implementation.
108-
///
109-
/// Returned pointer is only valid for the lifetime of this object.
110-
///
111-
/// @deprecated Future versions of the driver reserve the right to change the implementation
112-
/// and remove this interface entirely.
113-
///
114-
/// @return Pointer to implementation of this object, or nullptr if not available.
115-
///
116-
MONGOCXX_DEPRECATED void* implementation() const;
117-
118106
///
119107
/// Returns other uri options.
120108
///

src/mongocxx/write_concern.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ void write_concern::fsync(bool fsync) {
5959
libmongoc::write_concern_set_fsync(_impl->write_concern_t, fsync);
6060
}
6161

62-
void* write_concern::implementation() const {
63-
return _impl->write_concern_t;
64-
}
65-
6662
void write_concern::journal(bool journal) {
6763
libmongoc::write_concern_set_journal(_impl->write_concern_t, journal);
6864
}

src/mongocxx/write_concern.hpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,6 @@ class MONGOCXX_API write_concern {
108108
///
109109
void fsync(bool fsync);
110110

111-
///
112-
/// Gets a handle to the underlying implementation.
113-
///
114-
/// Returned pointer is only valid for the lifetime of this object.
115-
///
116-
/// @deprecated Future versions of the driver reserve the right to change the implementation
117-
/// and remove this interface entirely.
118-
///
119-
/// @return Pointer to implementation of this object, or nullptr if not available.
120-
///
121-
MONGOCXX_DEPRECATED void* implementation() const;
122-
123111
///
124112
/// Sets the journal parameter for this write concern.
125113
///

0 commit comments

Comments
 (0)