Skip to content

[phase 1] Add areg:: root namespace and organize sub-namespaces #656

@aregtech

Description

@aregtech

Important

Refactoring changes should be rebased and merged against this branch:
feature/655-api-modernization-and-refactoring

Summary

Wrap the entire AREG SDK framework in an areg:: root namespace, and organize internal modules into sub-namespaces that replace the current NE prefix convention.

Current state

All classes and functions live in the global namespace. Module grouping is done through filename prefixes:

// Current — global namespace, NE prefix
#include "areg/base/NECommon.hpp"
NECommon::INVALID_INDEX;
NEString::CharPos pos = NEString::START_POS;

Target state

// After — proper namespaces
#include "areg/base/common.hpp"
areg::common::INVALID_INDEX;
areg::string::CharPos pos = areg::string::START_POS;

// Or with using-directive
using namespace areg;
common::INVALID_INDEX;

Namespace mapping

Current prefix/file New namespace
NECommon areg::common
NEString areg::string
NEMath areg::math
NEMemory areg::memory
NESocket areg::net (or areg::socket)
NEUtilities areg::util
NEService areg::service
NERegistry areg::registry
NELogging areg::logging
All classes (e.g., String, Thread, Component) areg:: root

Scope

Files to modify

  • framework/areg/base/ — 53 headers + corresponding .cpp files
  • framework/areg/component/ — 37 headers + corresponding .cpp files
  • framework/areg/ipc/ — all headers and sources
  • framework/areg/logging/ — all headers and sources
  • framework/areg/persist/ — all headers and sources
  • framework/areg/appbase/ — all headers and sources
  • framework/areg/system/ — all headers and sources

Work order

Process module by module. Each module can be a separate PR:

  1. framework/areg/base/
  2. framework/areg/component/
  3. framework/areg/ipc/
  4. framework/areg/logging/
  5. framework/areg/persist/
  6. framework/areg/appbase/
  7. framework/areg/system/

Rules

  • Every public header gets namespace areg { wrapper
  • NE-prefixed utility namespaces become real sub-namespaces
  • Platform-specific private implementations (e.g., posix/, win32/) also go inside areg:: but remain in private/ directories
  • Macros (GEMacros.h, GEGlobal.h) remain outside namespaces (macros are not namespace-aware), but filenames should drop the GE prefix
  • Internal linkage (private/ directories) uses areg::internal:: or anonymous namespaces

Acceptance criteria

  • All public classes and functions are inside namespace areg
  • All NE-prefixed utility classes are converted to sub-namespaces
  • Project compiles on all supported platforms
  • All existing unit tests pass
  • No symbols remain in the global namespace except macros

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions