Skip to content

Commit 26db017

Browse files
committed
Add interfaces and tests in DTSpan to finish a span
Signed-off-by: Emelia Lei <[email protected]>
1 parent 7745315 commit 26db017

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

Diff for: src/groups/bmq/bmqimp/bmqimp_brokersession.t.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -2798,6 +2798,12 @@ class DTTestSpan : public bmqpi::DTSpan {
27982798
{
27992799
return d_operation;
28002800
}
2801+
2802+
int finish() const BSLS_KEYWORD_OVERRIDE
2803+
{
2804+
// NOT IMPLEMENTED
2805+
return 0;
2806+
}
28012807
};
28022808

28032809
class DTTestTracer : public bmqpi::DTTracer {

Diff for: src/groups/bmq/bmqpi/bmqpi_dtspan.h

+4
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ class DTSpan {
5656
/// Returns the name of the operation that this `DTSpan` represents.
5757
virtual bsl::string_view operation() const = 0;
5858

59+
/// Finish this span. Return 0 on success, or a non-zero error code
60+
/// on error
61+
virtual int finish() const = 0;
62+
5963
// =============
6064
// class Baggage
6165
// =============

Diff for: src/groups/bmq/bmqpi/bmqpi_dtspan.t.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ using namespace BloombergLP;
2929
/// A test implementation of the `bmqpi::DTSpan` protocol.
3030
struct DTSpanTestImp : public bsls::ProtocolTestImp<bmqpi::DTSpan> {
3131
bsl::string_view operation() const BSLS_KEYWORD_OVERRIDE;
32+
int finish() const BSLS_KEYWORD_OVERRIDE;
3233
};
3334

3435
// Define one of DTSpanTestImp methods out-of-line, to instruct the compiler to
@@ -38,6 +39,11 @@ bsl::string_view DTSpanTestImp::operation() const
3839
return markDone();
3940
}
4041

42+
int DTSpanTestImp::finish() const
43+
{
44+
return markDone();
45+
};
46+
4147
// ============================================================================
4248
// TESTS
4349
// ============================================================================

0 commit comments

Comments
 (0)