Skip to content

Commit 1c31e7c

Browse files
authored
v1: apm and events (CXX-3237, CXX-3238) (#1524)
* CXX-3236 update APM member function names for server heartbeat callbacks * CXX 3236 Fix missing export macros
1 parent 90f286f commit 1c31e7c

File tree

95 files changed

+3948
-838
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+3948
-838
lines changed

src/mongocxx/include/mongocxx/v1/apm.hpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,14 @@ class apm {
254254
/// @par Preconditions:
255255
/// - `fn` MUST NOT throw an exception when invoked.
256256
///
257-
MONGOCXX_ABI_EXPORT_CDECL(apm&) on_heartbeat_started(
257+
MONGOCXX_ABI_EXPORT_CDECL(apm&) on_server_heartbeat_started(
258258
std::function<void MONGOCXX_ABI_CDECL(v1::events::server_heartbeat_started const&)> fn);
259259

260260
///
261261
/// Return the current the "ServerHeartbeatStartedEvent" handler.
262262
///
263263
MONGOCXX_ABI_EXPORT_CDECL(std::function<void MONGOCXX_ABI_CDECL(v1::events::server_heartbeat_started const&)>)
264-
heartbeat_started() const;
264+
server_heartbeat_started() const;
265265

266266
///
267267
/// Set the "ServerHeartbeatFailedEvent" handler.
@@ -271,14 +271,14 @@ class apm {
271271
/// @par Preconditions:
272272
/// - `fn` MUST NOT throw an exception when invoked.
273273
///
274-
MONGOCXX_ABI_EXPORT_CDECL(apm&) on_heartbeat_failed(
274+
MONGOCXX_ABI_EXPORT_CDECL(apm&) on_server_heartbeat_failed(
275275
std::function<void MONGOCXX_ABI_CDECL(v1::events::server_heartbeat_failed const&)> fn);
276276

277277
///
278278
/// Return the current the "ServerHeartbeatFailedEvent" handler.
279279
///
280280
MONGOCXX_ABI_EXPORT_CDECL(std::function<void MONGOCXX_ABI_CDECL(v1::events::server_heartbeat_failed const&)>)
281-
heartbeat_failed() const;
281+
server_heartbeat_failed() const;
282282

283283
///
284284
/// Set the "ServerHeartbeatSucceededEvent" handler.
@@ -288,14 +288,16 @@ class apm {
288288
/// @par Preconditions:
289289
/// - `fn` MUST NOT throw an exception when invoked.
290290
///
291-
MONGOCXX_ABI_EXPORT_CDECL(apm&) on_heartbeat_succeeded(
291+
MONGOCXX_ABI_EXPORT_CDECL(apm&) on_server_heartbeat_succeeded(
292292
std::function<void MONGOCXX_ABI_CDECL(v1::events::server_heartbeat_succeeded const&)> fn);
293293

294294
///
295295
/// Return the current the "ServerHeartbeatSucceededEvent" handler.
296296
///
297297
MONGOCXX_ABI_EXPORT_CDECL(std::function<void MONGOCXX_ABI_CDECL(v1::events::server_heartbeat_succeeded const&)>)
298-
heartbeat_succeeded() const;
298+
server_heartbeat_succeeded() const;
299+
300+
class internal;
299301
};
300302

301303
} // namespace v1

src/mongocxx/include/mongocxx/v1/events/command_failed.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ class command_failed {
8787
///
8888
MONGOCXX_ABI_EXPORT_CDECL(std::uint16_t) port() const;
8989

90+
class internal;
91+
9092
private:
9193
/* explicit(false) */ command_failed(void const* impl);
9294
};

src/mongocxx/include/mongocxx/v1/events/command_started.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ class command_started {
8787
///
8888
MONGOCXX_ABI_EXPORT_CDECL(std::uint16_t) port() const;
8989

90+
class internal;
91+
9092
private:
9193
/* explicit(false) */ command_started(void const* impl);
9294
};

src/mongocxx/include/mongocxx/v1/events/command_succeeded.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ class command_succeeded {
8787
///
8888
MONGOCXX_ABI_EXPORT_CDECL(std::uint16_t) port() const;
8989

90+
class internal;
91+
9092
private:
9193
/* explicit(false) */ command_succeeded(void const* impl);
9294
};

src/mongocxx/include/mongocxx/v1/events/server_closed.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ class server_closed {
6060
///
6161
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::oid) topology_id() const;
6262

63+
class internal;
64+
6365
private:
6466
/* explicit(false) */ server_closed(void const* impl);
6567
};

src/mongocxx/include/mongocxx/v1/events/server_description.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ class server_description {
7272
///
7373
/// Copy constructor.
7474
///
75-
server_description(server_description const& other);
75+
MONGOCXX_ABI_EXPORT_CDECL() server_description(server_description const& other);
7676

7777
///
7878
/// Copy assignment.
7979
///
80-
server_description& operator=(server_description const& other);
80+
MONGOCXX_ABI_EXPORT_CDECL(server_description&) operator=(server_description const& other);
8181

8282
///
8383
/// Return the client-generated unique server ID.
@@ -124,6 +124,11 @@ class server_description {
124124
/// Return the port number for the connection used by the command.
125125
///
126126
MONGOCXX_ABI_EXPORT_CDECL(std::uint16_t) port() const;
127+
128+
class internal;
129+
130+
private:
131+
/* explicit(false) */ server_description(void* impl);
127132
};
128133

129134
} // namespace events

src/mongocxx/include/mongocxx/v1/events/server_description_changed.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ class server_description_changed {
7272
///
7373
MONGOCXX_ABI_EXPORT_CDECL(v1::events::server_description) new_description() const;
7474

75+
class internal;
76+
7577
private:
7678
/* explicit(false) */ server_description_changed(void const* impl);
7779
};

src/mongocxx/include/mongocxx/v1/events/server_heartbeat_failed.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ class server_heartbeat_failed {
7272
///
7373
MONGOCXX_ABI_EXPORT_CDECL(bool) awaited() const;
7474

75+
class internal;
76+
7577
private:
7678
/* explicit(false) */ server_heartbeat_failed(void const* impl);
7779
};

src/mongocxx/include/mongocxx/v1/events/server_heartbeat_started.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ class server_heartbeat_started {
6161
///
6262
MONGOCXX_ABI_EXPORT_CDECL(bool) awaited() const;
6363

64+
class internal;
65+
6466
private:
6567
/* explicit(false) */ server_heartbeat_started(void const* impl);
6668
};

src/mongocxx/include/mongocxx/v1/events/server_heartbeat_succeeded.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ class server_heartbeat_succeeded {
7373
///
7474
MONGOCXX_ABI_EXPORT_CDECL(bool) awaited() const;
7575

76+
class internal;
77+
7678
private:
7779
/* explicit(false) */ server_heartbeat_succeeded(void const* impl);
7880
};

0 commit comments

Comments
 (0)