refactor: Migrate NECommon to areg::common namespace#674
Conversation
Transform NECommon to areg::common as proof-of-concept for issue aregtech#656. - Wrap with AREG_NAMESPACE_BEGIN/END macros - Rename namespace: NECommon → common - Update internal enum references to remove NECommon:: prefix - Update documentation comments to reflect new namespace Signed-off-by: caliph1998 <ali.khoshru18@gmail.com>
Update all base module files to reference areg::common instead of NECommon. Changes are mechanical search-replace operations: - NECommon:: → areg::common:: - using NECommon:: → using areg::common:: - using namespace NECommon → using namespace areg::common Files updated include: - Template containers (TEArrayList, TEHashMap, TERingStack, etc.) - String classes (String, WideString, TEString) - Synchronization primitives (SyncObjects, Thread) - Utility classes (NEString, NEUtilities, Version) - Platform-specific implementations (POSIX, Win32) Signed-off-by: caliph1998 <ali.khoshru18@gmail.com>
Update component, IPC, and application base modules to use areg::common namespace instead of NECommon. Component module changes: - Component lifecycle and registry (NERegistry, ComponentThread) - Service interface definitions (NEService) - Event system and dispatchers - Proxy/Stub addressing - Timers and worker threads - Service manager and watchdog IPC module changes: - Client connection handling - Router client communication - Send/receive threads Appbase module changes: - Application initialization and shutdown Signed-off-by: caliph1998 <ali.khoshru18@gmail.com>
Update logging and persistence modules to use areg::common namespace instead of NECommon. Logging module changes: - LogManager timeout and queue size constants - TCP logger connection handling Persist module changes: - Configuration manager file handling - NEPersistence constants Signed-off-by: caliph1998 <ali.khoshru18@gmail.com>
Update all NECommon:: references to areg::common:: in aregextend module (console, service, db components). Part of namespace modernization per issue aregtech#656. Signed-off-by: caliph1998 <ali.khoshru18@gmail.com>
Update NECommon:: references in areglogger, logcollector, logobserver, and NESocket.cpp. Part of namespace modernization per issue aregtech#656. Signed-off-by: caliph1998 <ali.khoshru18@gmail.com>
Update NECommon:: references to areg::common:: in examples 01-15. Example-specific NECommon.hpp files kept as-is. Part of namespace modernization per issue aregtech#656. Signed-off-by: caliph1998 <ali.khoshru18@gmail.com>
Update NECommon:: references to areg::common:: in examples 16-29. Example-specific NECommon.hpp files kept as-is, only framework constant references updated (WAIT_INFINITE, DEFAULT_SPECIAL_CHAR, etc). Part of namespace modernization per issue aregtech#656. Signed-off-by: caliph1998 <ali.khoshru18@gmail.com>
Update NECommon:: references in unit tests. Part of namespace modernization per issue aregtech#656. Signed-off-by: caliph1998 <ali.khoshru18@gmail.com>
Update platform-specific synchronization objects (MutexIX, SyncLockAndWaitIX, ThreadPosix, SyncObjectsWin32, ThreadWin32) to use areg::common namespace. Part of namespace modernization per issue aregtech#656. Signed-off-by: caliph1998 <ali.khoshru18@gmail.com>
Clean up .bak backup artifacts created during the NECommon -> areg::common namespace migration. Part of namespace modernization per issue aregtech#656. Signed-off-by: caliph1998 <ali.khoshru18@gmail.com>
|
Hi @aregtech, I've been working on the namespace migration for NECommon and have a draft PR ready on branch feature/656-necommon-to-areg-common targeting feature/655-api-modernization-and-refactoring. This PR wraps all NECommon constants and types in the areg::common namespace and updates all references across framework, examples, and tests. Build passes at 100% and all 359 unit tests pass. But, I noticed the upstream branch has had significant changes since I branched off (PR #673 removing NE/IE/TE file prefixes, macro reductions, etc.), so there will be merge conflicts to resolve. Before I spend time rebasing, I wanted to check: Is the areg::common namespace approach I took on still aligned with the your intended direction? I want to make sure before resolving what will be a fairly large merge. Note: As said in the PR description, I had to directly use areg:: namespace in most directories to keep the PR buildable. The reason is we are incrementally changing the namespaces so other subnamespaces like NEServices are not yet wrapped in areg so they can't see common:: namespace. This is an intermediary step and the direct use of the areg:: namespace will be dropped once all namespaces and classes are wrapped |
|
Hi @caliph1998, Huge thanks for the PR! I’ve been doing some heavy lifting on a major refactor lately (specifically a lot of file and namespace renaming), and I want to make sure my changes don't clash with yours moving forward. To keep our workflow smooth and avoid merge conflicts:
If you’d like to be deeply involved in this refactoring project, I’d love to add you to the official Contributors list. This will give you more permissions to create issues, review code, and modify sources directly. Let me know what you think! |
|
Yes, I’d be happy to assign this issue to myself, but it seems I don’t currently have the necessary permissions. I would really appreciate it if you could assign it to me. I also agree that this is a fairly large issue and would likely benefit from being broken down into smaller sub-issues. Once I’m added to the contributors list and have the appropriate permissions, I’ll be able to help with organizing it further. Thank you very much for your help! |
|
@caliph1998 , you are now in the list of collaborators. As soon as you accept invitation, you'd be able to make changes. About There is a file describing how the structure will be changed. You are welcome to make better suggestion. If anything is unclear, you find a conflict in description or something is confusing, please feel free to ask. 2. Namespace Strategy2.1 Framework namespace is always
|
| Old NE Namespace | Types move to | Rationale |
|---|---|---|
| NEApplication | areg:: |
AppState, EntryTypesEnabling |
| NECommon | areg:: |
Constants, SortOrder, IndexPosition, CookieId, RingOverlap |
| NEMath | areg:: |
Rect, Point, Size, Coord, LargeInteger, CompareResult, DigitSign |
| NEMemory | areg:: |
BufferHeader, RawByteBuffer, BufferType, MessageResult, Align |
| NESocket | areg:: |
SocketAddress, UserData |
| NEString | areg:: |
CharDefs, Radix |
| NEUtilities | areg:: |
SystemTime |
| NEDebug | areg:: |
DebugPriority (private by file location) |
| NESyncTypesIX | areg::os:: |
POSIX sync types (platform suffix on class names) |
| NERegistry | areg:: |
ModelState, ComponentEntry, ServiceEntry |
| NEService | areg:: |
ResultType, ServiceType, RequestType, DataState, etc. |
| NEConnection | areg:: |
Connection constants (private by file location) |
| NERemoteService | areg:: |
RemoteConnection, ConnectionType, RemoteServiceId |
| NELogging | areg:: |
LogPriority, LogRecord, ScopeInfo, LogDataType, etc. |
| NELogOptions | areg:: |
ConfigKey, LayoutTag, LogStatus (private by file location) |
| NEPersistence | areg:: |
ConfigKeys, PropertyRecord |
| NESystemService | aregext:: |
ServiceOption, SystemServiceState (separate library) |
| NELogCollectorSettings | logcollector:: |
App-level, not in areg:: |
| NEMultitargetRouterSettings | mtrouter:: |
App-level, not in areg:: |
Summary
Migrates all
NECommon::references toareg::common::across the entire codebase as part of the namespace modernization effort (#656). This is the first namespace migration PR, covering the NECommon module.Changes
NECommonconstants and types in theareg::commonnamespace insideframework/areg/base/NECommon.hppareg,aregextend,areglogger,logcollector,logobserver) to usecommon::withinareg::namespace scopeareg::common::for framework constantsareg::common::NECommon.hppwith app-specific constants (e.g.,16_pubmesh,20_winchat) — only their framework constant references were updated, app-specific constants remain asNECommon::areg::common::directly (withoutAREG_NAMESPACE_USEmacro) in code not yet wrapped in theareg::namespace (examples, tests, aregextend) to keep builds working incrementallyTesting
cmake --build build --clean-first -j20at 100%ctest --test-dir build --output-on-failureproduct/generate/auto-regenerates correctly from.simlfilesNotes
feature/655-api-modernization-and-refactoringbranch, notmasterNE*namespaces following the same pattern