@@ -2834,6 +2834,49 @@ 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 (),
2846
+ dtSpan->operation ().cbegin (),
2847
+ dtSpan->operation ().cend ());
2848
+
2849
+ event << " SERIALIZE " << dtSpan->operation ();
2850
+ d_eventsQueue_p->pushBack (event.str ());
2851
+
2852
+ return 0 ;
2853
+ }
2854
+
2855
+ int deserializeAndCreateChildSpan (
2856
+ bsl::shared_ptr<bmqpi::DTSpan>* out,
2857
+ const bsl::vector<unsigned char >& in,
2858
+ const bsl::string_view& operation,
2859
+ const bmqpi::DTSpan::Baggage& baggage) const BSLS_KEYWORD_OVERRIDE
2860
+ {
2861
+ bsl::string parentOperation (in.begin (), in.end ());
2862
+
2863
+ bmqu::MemOutStream event (d_allocator_p);
2864
+ event << " DESERIALIZE " << parentOperation;
2865
+ d_eventsQueue_p->pushBack (event.str ());
2866
+
2867
+ bmqu::MemOutStream operationName (d_allocator_p);
2868
+ operationName << operation;
2869
+ operationName << " < " << parentOperation;
2870
+
2871
+ *out = bsl::shared_ptr<bmqpi::DTSpan>(
2872
+ new (*d_allocator_p) DTTestSpan (operationName.str (),
2873
+ baggage,
2874
+ d_eventsQueue_p,
2875
+ d_allocator_p),
2876
+ d_allocator_p);
2877
+
2878
+ return 0 ;
2879
+ }
2837
2880
};
2838
2881
2839
2882
} // close unnamed namespace
0 commit comments