refactor: reorganize project structure with modern C++ namespace organization
- Restructure include/ and src/ directories with logical grouping - Move core components to spore/core/ (NodeContext, NetworkManager, TaskManager, ClusterManager, ApiServer) - Move services to spore/services/ (NodeService, NetworkService, ClusterService, TaskService) - Move types to spore/types/ (NodeInfo, ApiTypes, Config) - Move internal components to spore/internal/ (Globals) - Update all #include statements to use new namespace paths - Update platformio.ini build filters for all environments - Update all example files to use new include paths - Maintain backward compatibility for public API - Improve code organization, maintainability, and scalability This reorganization follows modern C++ project structure patterns and provides clear separation between public API, internal implementation, and utilities. All examples compile successfully with the new structure.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#include "Spore.h"
|
||||
#include "services/NodeService.h"
|
||||
#include "services/NetworkService.h"
|
||||
#include "services/ClusterService.h"
|
||||
#include "services/TaskService.h"
|
||||
#include "spore/Spore.h"
|
||||
#include "spore/services/NodeService.h"
|
||||
#include "spore/services/NetworkService.h"
|
||||
#include "spore/services/ClusterService.h"
|
||||
#include "spore/services/TaskService.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
Spore::Spore() : ctx(), network(ctx), taskManager(ctx), cluster(ctx, taskManager),
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "ApiServer.h"
|
||||
#include "services/Service.h"
|
||||
#include "spore/core/ApiServer.h"
|
||||
#include "spore/Service.h"
|
||||
#include <algorithm>
|
||||
|
||||
const char* ApiServer::methodToStr(int method) {
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "ClusterManager.h"
|
||||
#include "Globals.h"
|
||||
#include "spore/core/ClusterManager.h"
|
||||
#include "spore/internal/Globals.h"
|
||||
|
||||
ClusterManager::ClusterManager(NodeContext& ctx, TaskManager& taskMgr) : ctx(ctx), taskManager(taskMgr) {
|
||||
// Register callback for node_discovered event
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "NetworkManager.h"
|
||||
#include "spore/core/NetworkManager.h"
|
||||
|
||||
// SSID and password are now configured via Config class
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "NodeContext.h"
|
||||
#include "spore/core/NodeContext.h"
|
||||
|
||||
NodeContext::NodeContext() {
|
||||
udp = new WiFiUDP();
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "TaskManager.h"
|
||||
#include "spore/core/TaskManager.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
TaskManager::TaskManager(NodeContext& ctx) : ctx(ctx) {}
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "services/ClusterService.h"
|
||||
#include "ApiServer.h"
|
||||
#include "spore/services/ClusterService.h"
|
||||
#include "spore/core/ApiServer.h"
|
||||
|
||||
ClusterService::ClusterService(NodeContext& ctx) : ctx(ctx) {}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "services/NetworkService.h"
|
||||
#include "spore/services/NetworkService.h"
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
NetworkService::NetworkService(NetworkManager& networkManager)
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "services/NodeService.h"
|
||||
#include "ApiServer.h"
|
||||
#include "spore/services/NodeService.h"
|
||||
#include "spore/core/ApiServer.h"
|
||||
|
||||
NodeService::NodeService(NodeContext& ctx, ApiServer& apiServer) : ctx(ctx), apiServer(apiServer) {}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "services/TaskService.h"
|
||||
#include "ApiServer.h"
|
||||
#include "spore/services/TaskService.h"
|
||||
#include "spore/core/ApiServer.h"
|
||||
#include <algorithm>
|
||||
|
||||
TaskService::TaskService(TaskManager& taskManager) : taskManager(taskManager) {}
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "Config.h"
|
||||
#include "spore/types/Config.h"
|
||||
|
||||
Config::Config() {
|
||||
// WiFi Configuration
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "NodeInfo.h"
|
||||
#include "Globals.h"
|
||||
#include "spore/types/NodeInfo.h"
|
||||
#include "spore/internal/Globals.h"
|
||||
|
||||
const char* statusToStr(NodeInfo::Status status) {
|
||||
switch (status) {
|
||||
Reference in New Issue
Block a user