-
Notifications
You must be signed in to change notification settings - Fork 130
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededrefactoring
Description
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.cppfilesframework/areg/component/— 37 headers + corresponding.cppfilesframework/areg/ipc/— all headers and sourcesframework/areg/logging/— all headers and sourcesframework/areg/persist/— all headers and sourcesframework/areg/appbase/— all headers and sourcesframework/areg/system/— all headers and sources
Work order
Process module by module. Each module can be a separate PR:
framework/areg/base/framework/areg/component/framework/areg/ipc/framework/areg/logging/framework/areg/persist/framework/areg/appbase/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 insideareg::but remain inprivate/directories - Macros (
GEMacros.h,GEGlobal.h) remain outside namespaces (macros are not namespace-aware), but filenames should drop theGEprefix - Internal linkage (
private/directories) usesareg::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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededrefactoring
Projects
Status
No status