Skip to content

refactor(layout): migrate legacy headers into include/kcenon/thread/ with deprecated forwarding #684

Description

@kcenon

What

Migrate the remaining legacy headers under utilities/include/ and core/{base,sync}/include/ into the standard layout include/kcenon/thread/{utils,impl,core}/. Add [[deprecated]] forwarding headers at the original paths so dependent code keeps compiling for one release.

Part of #683.

Why

The dual layout forces every contributor and every downstream consumer to keep both header trees in mind. Eight headers still live outside the standard tree:

  • utilities/include/: formatter.h, formatter_macros.h, convert_string.h, span.h
  • core/sync/include/: cancellation_token.h, sync_primitives.h, error_handling.h
  • core/base/include/detail/: thread_impl.h

Until they are moved, the auto-detection branching in CMake cannot be removed (#683 sub-issue B), and downstream verification (#683 sub-issue D) cannot run against the final layout.

How

  1. Decide the canonical destination per header by reading existing include/kcenon/thread/ substructure (e.g. utilities → utils/, sync primitives → existing core/ or new core/sync/).

  2. git mv each header into its destination. Keep the file content unchanged.

  3. Replace the original path with a one-line forwarding header:

    #pragma once
    // Deprecated: include <kcenon/thread/utils/formatter.h> instead.
    // Slated for removal in the next minor release.
    #include <kcenon/thread/utils/formatter.h>

    Mark each forwarding header with [[deprecated]] via a pragma message so users get a compile-time hint.

  4. Update internal includes inside thread_system to point at the new paths.

  5. Run a full local build (cmake --preset debug && cmake --build --preset debug) and unit tests; verify no regressions.

Acceptance Criteria

  • All 8 headers physically reside under include/kcenon/thread/
  • Each old path contains a deprecated forwarding header
  • Internal #include statements use the new canonical paths
  • debug preset builds clean with zero warnings (deprecation messages excluded)
  • ctest --output-on-failure passes on the debug preset

Where

Path Action
utilities/include/*.h Move to include/kcenon/thread/utils/; replace with forwarding
core/sync/include/*.h Move to include/kcenon/thread/core/sync/ (or merge into existing core/)
core/base/include/detail/thread_impl.h Move to include/kcenon/thread/impl/detail/
Internal callers under src/, tests/, examples/ Update include paths

No CMake changes in this issue (deferred to sub-issue B).

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions