@@ -2834,6 +2834,47 @@ class DTTestTracer : public bmqpi::DTTracer {
2834
2834
d_allocator_p);
2835
2835
return result;
2836
2836
}
2837
+
2838
+ int serializeSpan (bsl::vector<unsigned char >* out,
2839
+ const bsl::shared_ptr<bmqpi::DTSpan>& dtSpan) const
2840
+ BSLS_KEYWORD_OVERRIDE
2841
+ {
2842
+ bmqu::MemOutStream event (d_allocator_p);
2843
+
2844
+ out->resize (dtSpan->operation ().size () + 1 );
2845
+ out->insert (out->cbegin (), dtSpan->operation ().cbegin (), dtSpan->operation ().cend ());
2846
+
2847
+ event << " SERIALIZE " << dtSpan->operation ();
2848
+ d_eventsQueue_p->pushBack (event.str ());
2849
+
2850
+ return 0 ;
2851
+ }
2852
+
2853
+ int deserializeAndCreateChildSpan (
2854
+ bsl::shared_ptr<bmqpi::DTSpan>* out,
2855
+ const bsl::vector<unsigned char >& in,
2856
+ const bsl::string_view& operation,
2857
+ const bmqpi::DTSpan::Baggage& baggage) const BSLS_KEYWORD_OVERRIDE
2858
+ {
2859
+ bsl::string parentOperation (in.begin (), in.end ());
2860
+
2861
+ bmqu::MemOutStream event (d_allocator_p);
2862
+ event << " DESERIALIZE " << parentOperation;
2863
+ d_eventsQueue_p->pushBack (event.str ());
2864
+
2865
+ bmqu::MemOutStream operationName (d_allocator_p);
2866
+ operationName << operation;
2867
+ operationName << " < " << parentOperation;
2868
+
2869
+ *out = bsl::shared_ptr<bmqpi::DTSpan>(
2870
+ new (*d_allocator_p) DTTestSpan (operationName.str (),
2871
+ baggage,
2872
+ d_eventsQueue_p,
2873
+ d_allocator_p),
2874
+ d_allocator_p);
2875
+
2876
+ return 0 ;
2877
+ }
2837
2878
};
2838
2879
2839
2880
} // close unnamed namespace
0 commit comments