1616
1717#include < list>
1818#include < memory>
19- #include < optional>
20- #include < string_view>
2119
20+ #include " absl/memory/memory.h"
21+ #include " absl/strings/string_view.h"
22+ #include " absl/types/optional.h"
2223#include " cpp2sky/config.pb.h"
2324#include " cpp2sky/propagation.h"
2425#include " cpp2sky/time.h"
@@ -58,7 +59,7 @@ class TracingSpan {
5859 /* *
5960 * Get peer address.
6061 */
61- virtual std ::string_view peer () const = 0;
62+ virtual absl ::string_view peer () const = 0;
6263
6364 /* *
6465 * Get span type.
@@ -88,7 +89,7 @@ class TracingSpan {
8889 /* *
8990 * Get operation name.
9091 */
91- virtual std ::string_view operationName () const = 0;
92+ virtual absl ::string_view operationName () const = 0;
9293
9394 /* *
9495 * Set parent span ID of this span.
@@ -98,10 +99,10 @@ class TracingSpan {
9899 /* *
99100 * Set start time to calculate execution time.
100101 */
101- virtual void startSpan (std ::string_view operation_name) = 0;
102- virtual void startSpan (std ::string_view operation_name,
102+ virtual void startSpan (absl ::string_view operation_name) = 0;
103+ virtual void startSpan (absl ::string_view operation_name,
103104 TimePoint<SystemTime> current_time) = 0;
104- virtual void startSpan (std ::string_view operation_name,
105+ virtual void startSpan (absl ::string_view operation_name,
105106 TimePoint<SteadyTime> current_time) = 0;
106107
107108 /* *
@@ -114,7 +115,7 @@ class TracingSpan {
114115 /* *
115116 * Set peer address for this span (lvalue)
116117 */
117- virtual void setPeer (std ::string_view remote_address) = 0;
118+ virtual void setPeer (absl ::string_view remote_address) = 0;
118119
119120 /* *
120121 * Set span type. Entry or Exit. Entry span means origin span which doesn't
@@ -142,15 +143,15 @@ class TracingSpan {
142143 /* *
143144 * Set tag to current span.
144145 */
145- virtual void addTag (std ::string_view key, std ::string_view value) = 0;
146+ virtual void addTag (absl ::string_view key, absl ::string_view value) = 0;
146147
147148 /* *
148149 * Add log related with current span.
149150 */
150- virtual void addLog (std ::string_view key, std ::string_view value) = 0;
151- virtual void addLog (std ::string_view key, std ::string_view value,
151+ virtual void addLog (absl ::string_view key, absl ::string_view value) = 0;
152+ virtual void addLog (absl ::string_view key, absl ::string_view value,
152153 TimePoint<SystemTime> current_time) = 0;
153- virtual void addLog (std ::string_view key, std ::string_view value,
154+ virtual void addLog (absl ::string_view key, absl ::string_view value,
154155 TimePoint<SteadyTime> current_time) = 0;
155156
156157 /* *
@@ -161,7 +162,7 @@ class TracingSpan {
161162 /* *
162163 * Set operation name.
163164 */
164- virtual void setOperationName (std ::string_view operation_name) = 0;
165+ virtual void setOperationName (absl ::string_view operation_name) = 0;
165166
166167 /* *
167168 * Add parent segment reference to current span.
@@ -231,8 +232,8 @@ class TracingContext {
231232 * @param target_address Target address to send request. For more detail:
232233 * https://github.com/apache/skywalking-data-collect-protocol/blob/master/language-agent/Tracing.proto#L97-L101
233234 */
234- virtual std ::optional<std::string> createSW8HeaderValue (
235- const std ::string_view target_address) = 0;
235+ virtual absl ::optional<std::string> createSW8HeaderValue (
236+ const absl ::string_view target_address) = 0;
236237
237238 /* *
238239 * Generate Apache SkyWalking native segment object. This method **SHOULD**
@@ -260,7 +261,7 @@ class TracingContext {
260261 * logging format following with any format extracted with
261262 * cpp2sky::logFormat().
262263 */
263- virtual std::string logMessage (std ::string_view message) const = 0;
264+ virtual std::string logMessage (absl ::string_view message) const = 0;
264265};
265266
266267using TracingContextPtr = std::shared_ptr<TracingContext>;
@@ -272,7 +273,7 @@ using TracingContextPtr = std::shared_ptr<TracingContext>;
272273class StartEntrySpan {
273274 public:
274275 StartEntrySpan (TracingContextPtr tracing_context,
275- std ::string_view operation_name)
276+ absl ::string_view operation_name)
276277 : span_(tracing_context->createEntrySpan ()) {
277278 span_->startSpan (operation_name.data ());
278279 }
@@ -291,7 +292,7 @@ class StartEntrySpan {
291292class StartExitSpan {
292293 public:
293294 StartExitSpan (TracingContextPtr tracing_context, TracingSpanPtr parent_span,
294- std ::string_view operation_name)
295+ absl ::string_view operation_name)
295296 : span_(tracing_context->createExitSpan (parent_span)) {
296297 span_->startSpan (operation_name.data ());
297298 }
0 commit comments