-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathdict_writer.h
More file actions
30 lines (23 loc) · 894 Bytes
/
dict_writer.h
File metadata and controls
30 lines (23 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once
// This component provides an interface, `DictWriter`, that represents a
// write-only key/value mapping of strings. It's used when injecting trace
// context into externalized formats: HTTP headers, gRPC metadata, etc.
//
// Note that while the data structure modeled is a mapping, duplicate keys are
// permitted to result from repeated invocations of `DictWriter::set` with the
// same key.
#include "string_view.h"
namespace datadog {
namespace tracing {
class DictWriter {
public:
virtual ~DictWriter() {}
// Associate the specified `value` with the specified `key`. An
// implementation may, but is not required to, overwrite any previous value at
// `key`.
virtual void set(StringView key, StringView value) = 0;
// Removes the entry associated with the given key.
virtual void erase(StringView){};
};
} // namespace tracing
} // namespace datadog