Skip to content

Commit 0019021

Browse files
IronsDuclaude
andauthored
refactor: move internal headers to src/internal/ (#33)
* refactor: move internal headers to src/internal/ Move implementation-detail headers out of include/ to hide them from library users. The public API now only exposes: - profiler_manager.h - web_server.h - version.h - profiler_version.h (generated) Internal headers moved: - symbolize.h - embed_flamegraph.h - embed_pprof.h - web_resources.h Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: add missing cstring header for strerror Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 77d961f commit 0019021

10 files changed

Lines changed: 12 additions & 8 deletions

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ set(PROFILER_SOURCES
102102

103103
set(PROFILER_HEADERS
104104
include/profiler_manager.h
105-
include/symbolize.h
106-
include/web_resources.h
107105
include/web_server.h
108106
)
109107

@@ -129,6 +127,8 @@ target_include_directories(profiler_lib
129127
PUBLIC
130128
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
131129
$<INSTALL_INTERFACE:include/cpp-remote-profiler>
130+
PRIVATE
131+
${PROJECT_SOURCE_DIR}/src
132132
)
133133

134134
# Example executable

include/profiler_manager.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#pragma once
55

66
#include "profiler_version.h"
7-
#include "symbolize.h"
87
#include <atomic>
98
#include <map>
109
#include <memory>
@@ -16,6 +15,9 @@
1615

1716
PROFILER_NAMESPACE_BEGIN
1817

18+
// Forward declaration
19+
class Symbolizer;
20+
1921
/// @enum ProfilerType
2022
/// @brief Types of profiling operations supported
2123
enum class ProfilerType {

src/profiler_manager.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#include "profiler_manager.h"
22
#include "absl/debugging/stacktrace.h"
33
#include "absl/debugging/symbolize.h"
4-
#include "embed_flamegraph.h"
5-
#include "embed_pprof.h"
4+
#include "internal/embed_flamegraph.h"
5+
#include "internal/embed_pprof.h"
6+
#include "internal/symbolize.h"
67
#include <algorithm>
78
#include <atomic>
89
#include <chrono>
910
#include <cstdint>
1011
#include <cstdio>
12+
#include <cstring>
1113
#include <cxxabi.h>
1214
#include <dirent.h>
1315
#include <dlfcn.h>

src/symbolize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "symbolize.h"
1+
#include "internal/symbolize.h"
22
#include <absl/debugging/symbolize.h>
33
#include <algorithm>
44
#include <backward.hpp>

src/web_resources.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "web_resources.h"
1+
#include "internal/web_resources.h"
22
#include <string>
33

44
PROFILER_NAMESPACE_BEGIN

src/web_server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "web_server.h"
2+
#include "internal/web_resources.h"
23
#include "profiler_manager.h"
3-
#include "web_resources.h"
44
#include <drogon/drogon.h>
55
#include <fstream>
66
#include <iostream>

0 commit comments

Comments
 (0)