Skip to content

Commit

Permalink
Use only lib header include style
Browse files Browse the repository at this point in the history
  • Loading branch information
cataphract committed Aug 19, 2024
1 parent 37e2e73 commit c1ebd40
Show file tree
Hide file tree
Showing 104 changed files with 434 additions and 464 deletions.
2 changes: 1 addition & 1 deletion src/datadog/base64.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "base64.h"
#include <datadog/base64.h>

#include <cstddef>
#include <cstdint>
Expand Down
4 changes: 2 additions & 2 deletions src/datadog/base64.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <string>
#include <datadog/string_view.h>

#include "string_view.h"
#include <string>

namespace datadog {
namespace tracing {
Expand Down
2 changes: 1 addition & 1 deletion src/datadog/cerr_logger.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "cerr_logger.h"
#include <datadog/cerr_logger.h>

#include <iostream>

Expand Down
4 changes: 2 additions & 2 deletions src/datadog/cerr_logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
// `CerrLogger` is the default logger used by `Tracer` unless otherwise
// configured in `TracerConfig`.

#include <datadog/logger.h>

#include <mutex>
#include <sstream>

#include "logger.h"

namespace datadog {
namespace tracing {

Expand Down
2 changes: 1 addition & 1 deletion src/datadog/clock.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "clock.h"
#include <datadog/clock.h>

namespace datadog {
namespace tracing {
Expand Down
8 changes: 4 additions & 4 deletions src/datadog/collector.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
// adjusted to increase or decrease the rate at which traces are kept. See the
// `response_handler` parameter to `Collector::send`.

#include <datadog/expected.h>
#include <datadog/optional.h>

#include <datadog/json_fwd.hpp>
#include <memory>
#include <vector>

#include "expected.h"
#include "json_fwd.hpp"
#include "optional.h"

namespace datadog {
namespace tracing {

Expand Down
2 changes: 1 addition & 1 deletion src/datadog/collector_response.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "collector_response.h"
#include <datadog/collector_response.h>

namespace datadog {
namespace tracing {
Expand Down
6 changes: 3 additions & 3 deletions src/datadog/collector_response.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
// See `TraceSampler::handle_collector_response` in `trace_sampler.h` for more
// information.

#include <datadog/rate.h>
#include <datadog/string_view.h>

#include <string>
#include <unordered_map>

#include "rate.h"
#include "string_view.h"

namespace datadog {
namespace tracing {

Expand Down
4 changes: 2 additions & 2 deletions src/datadog/config.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "error.h"
#include "optional.h"
#include <datadog/error.h>
#include <datadog/optional.h>

namespace datadog {
namespace tracing {
Expand Down
9 changes: 4 additions & 5 deletions src/datadog/config_manager.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#include "config_manager.h"

#include "parse_util.h"
#include "string_util.h"
#include "trace_sampler.h"
#include <datadog/config_manager.h>
#include <datadog/parse_util.h>
#include <datadog/string_util.h>
#include <datadog/trace_sampler.h>

namespace datadog {
namespace tracing {
Expand Down
16 changes: 8 additions & 8 deletions src/datadog/config_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
// It utilizes a mutex to ensure thread safety when updating or accessing
// the configuration.

#include <datadog/clock.h>
#include <datadog/optional.h>
#include <datadog/remote_config/listener.h>
#include <datadog/span_defaults.h>
#include <datadog/tracer_config.h>
#include <datadog/tracer_telemetry.h>

#include <datadog/json.hpp>
#include <mutex>

#include "clock.h"
#include "json.hpp"
#include "optional.h"
#include "remote_config/listener.h"
#include "span_defaults.h"
#include "tracer_config.h"
#include "tracer_telemetry.h"

namespace datadog {
namespace tracing {

Expand Down
19 changes: 9 additions & 10 deletions src/datadog/curl.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
#include "curl.h"
#include <datadog/clock.h>
#include <datadog/curl.h>
#include <datadog/dict_reader.h>
#include <datadog/dict_writer.h>
#include <datadog/http_client.h>
#include <datadog/logger.h>
#include <datadog/string_util.h>
#include <datadog/string_view.h>

#include <algorithm>
#include <cctype>
#include <chrono>
#include <condition_variable>
#include <cstddef>
#include <datadog/json.hpp>
#include <iterator>
#include <list>
#include <memory>
Expand All @@ -13,15 +21,6 @@
#include <unordered_map>
#include <unordered_set>

#include "clock.h"
#include "dict_reader.h"
#include "dict_writer.h"
#include "http_client.h"
#include "json.hpp"
#include "logger.h"
#include "string_util.h"
#include "string_view.h"

namespace datadog {
namespace tracing {
namespace {
Expand Down
7 changes: 3 additions & 4 deletions src/datadog/curl.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,16 @@
// [1]: https://curl.se/libcurl/

#include <curl/curl.h>
#include <datadog/clock.h>
#include <datadog/http_client.h>

#include <chrono>
#include <datadog/json_fwd.hpp>
#include <functional>
#include <memory>
#include <string>
#include <thread>

#include "clock.h"
#include "http_client.h"
#include "json_fwd.hpp"

namespace datadog {
namespace tracing {

Expand Down
25 changes: 12 additions & 13 deletions src/datadog/datadog_agent.cpp
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
#include "datadog_agent.h"
#include <datadog/collector_response.h>
#include <datadog/datadog_agent.h>
#include <datadog/datadog_agent_config.h>
#include <datadog/dict_writer.h>
#include <datadog/http_client.h>
#include <datadog/logger.h>
#include <datadog/msgpack.h>
#include <datadog/span_data.h>
#include <datadog/string_view.h>
#include <datadog/trace_sampler.h>
#include <datadog/tracer.h>

#include <cassert>
#include <chrono>
#include <datadog/json.hpp>
#include <string>
#include <typeinfo>
#include <unordered_map>
#include <unordered_set>

#include "collector_response.h"
#include "datadog_agent_config.h"
#include "dict_writer.h"
#include "http_client.h"
#include "json.hpp"
#include "logger.h"
#include "msgpack.h"
#include "span_data.h"
#include "string_view.h"
#include "trace_sampler.h"
#include "tracer.h"

namespace datadog {
namespace tracing {
namespace {
Expand Down
20 changes: 10 additions & 10 deletions src/datadog/datadog_agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
// `DatadogAgent` is configured by `DatadogAgentConfig`. See
// `datadog_agent_config.h`.

#include <datadog/clock.h>
#include <datadog/collector.h>
#include <datadog/config_manager.h>
#include <datadog/event_scheduler.h>
#include <datadog/http_client.h>
#include <datadog/metrics.h>
#include <datadog/remote_config/remote_config.h>
#include <datadog/tracer_signature.h>
#include <datadog/tracer_telemetry.h>

#include <memory>
#include <mutex>
#include <vector>

#include "clock.h"
#include "collector.h"
#include "config_manager.h"
#include "event_scheduler.h"
#include "http_client.h"
#include "metrics.h"
#include "remote_config/remote_config.h"
#include "tracer_signature.h"
#include "tracer_telemetry.h"

namespace datadog {
namespace tracing {

Expand Down
11 changes: 5 additions & 6 deletions src/datadog/datadog_agent_config.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#include "datadog_agent_config.h"
#include <datadog/datadog_agent_config.h>
#include <datadog/default_http_client.h>
#include <datadog/environment.h>
#include <datadog/parse_util.h>
#include <datadog/threaded_event_scheduler.h>

#include <algorithm>
#include <chrono>
#include <cstddef>

#include "default_http_client.h"
#include "environment.h"
#include "parse_util.h"
#include "threaded_event_scheduler.h"

namespace datadog {
namespace tracing {

Expand Down
14 changes: 7 additions & 7 deletions src/datadog/datadog_agent_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
// Typical usage of `DatadogAgentConfig` is implicit as part of `TracerConfig`.
// See `tracer_config.h`.

#include <datadog/clock.h>
#include <datadog/config.h>
#include <datadog/expected.h>
#include <datadog/http_client.h>
#include <datadog/remote_config/listener.h>
#include <datadog/string_view.h>

#include <chrono>
#include <memory>
#include <string>
#include <unordered_map>
#include <variant>

#include "clock.h"
#include "config.h"
#include "expected.h"
#include "http_client.h"
#include "remote_config/listener.h"
#include "string_view.h"

namespace datadog {
namespace tracing {

Expand Down
4 changes: 2 additions & 2 deletions src/datadog/default_http_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
// `default_http_client` is implemented in either `default_http_client_curl.cpp`
// or `default_http_client_null.cpp`.

#include <memory>
#include <datadog/clock.h>

#include "clock.h"
#include <memory>

namespace datadog {
namespace tracing {
Expand Down
4 changes: 2 additions & 2 deletions src/datadog/default_http_client_curl.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "curl.h"
#include "default_http_client.h"
#include <datadog/curl.h>
#include <datadog/default_http_client.h>

// This file is included in the build when libcurl is included in the build.
// It provides an implementation of `default_http_client` that returns a
Expand Down
2 changes: 1 addition & 1 deletion src/datadog/default_http_client_null.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "default_http_client.h"
#include <datadog/default_http_client.h>

// This file is included in the build when libcurl is not included in the build.
// It provides an implementation of `default_http_client` that returns null,
Expand Down
6 changes: 3 additions & 3 deletions src/datadog/dict_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
// read-only key/value mapping of strings. It's used when extracting trace
// context from externalized formats: HTTP headers, gRPC metadata, etc.

#include <functional>
#include <datadog/optional.h>
#include <datadog/string_view.h>

#include "optional.h"
#include "string_view.h"
#include <functional>

namespace datadog {
namespace tracing {
Expand Down
2 changes: 1 addition & 1 deletion src/datadog/dict_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// permitted to result from repeated invocations of `DictWriter::set` with the
// same key.

#include "string_view.h"
#include <datadog/string_view.h>

namespace datadog {
namespace tracing {
Expand Down
5 changes: 2 additions & 3 deletions src/datadog/environment.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#include "environment.h"
#include <datadog/environment.h>

#include <cstdlib>

#include "json.hpp"
#include <datadog/json.hpp>

namespace datadog {
namespace tracing {
Expand Down
7 changes: 4 additions & 3 deletions src/datadog/environment.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
//
// `lookup` retrieves the value of `Variable` in the environment.

#include "json_fwd.hpp"
#include "optional.h"
#include "string_view.h"
#include <datadog/optional.h>
#include <datadog/string_view.h>

#include <datadog/json_fwd.hpp>

namespace datadog {
namespace tracing {
Expand Down
2 changes: 1 addition & 1 deletion src/datadog/error.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "error.h"
#include <datadog/error.h>

#include <ostream>
#include <sstream>
Expand Down
4 changes: 2 additions & 2 deletions src/datadog/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
// `struct Error` is the error type used by the `Expected` class template. See
// `expected.h`.

#include <datadog/string_view.h>

#include <iosfwd>
#include <string>

#include "string_view.h"

namespace datadog {
namespace tracing {

Expand Down
Loading

0 comments on commit c1ebd40

Please sign in to comment.