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:
2025-09-13 21:30:07 +02:00
parent bf17684dc6
commit 554c6ff38d
38 changed files with 78 additions and 72 deletions

View File

@@ -1,5 +1,5 @@
#pragma once
#include "ApiServer.h"
#include "spore/core/ApiServer.h"
class Service {
public:

View File

@@ -4,12 +4,12 @@
#include <memory>
#include <initializer_list>
#include <utility>
#include "NodeContext.h"
#include "NetworkManager.h"
#include "ClusterManager.h"
#include "ApiServer.h"
#include "TaskManager.h"
#include "services/Service.h"
#include "core/NodeContext.h"
#include "core/NetworkManager.h"
#include "core/ClusterManager.h"
#include "core/ApiServer.h"
#include "core/TaskManager.h"
#include "Service.h"
class Spore {
public:

View File

@@ -7,10 +7,10 @@
#include <vector>
#include <tuple>
#include "NodeContext.h"
#include "NodeInfo.h"
#include "TaskManager.h"
#include "ApiTypes.h"
#include "spore/core/NodeContext.h"
#include "spore/types/NodeInfo.h"
#include "spore/core/TaskManager.h"
#include "spore/types/ApiTypes.h"
class Service; // Forward declaration

View File

@@ -1,7 +1,7 @@
#pragma once
#include "NodeContext.h"
#include "NodeInfo.h"
#include "TaskManager.h"
#include "spore/core/NodeContext.h"
#include "spore/types/NodeInfo.h"
#include "spore/core/TaskManager.h"
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ArduinoJson.h>

View File

@@ -1,5 +1,5 @@
#pragma once
#include "NodeContext.h"
#include "spore/core/NodeContext.h"
#include <ESP8266WiFi.h>
#include <vector>

View File

@@ -2,12 +2,12 @@
#include <WiFiUdp.h>
#include <map>
#include "NodeInfo.h"
#include "spore/types/NodeInfo.h"
#include <functional>
#include <string>
#include <initializer_list>
#include "Config.h"
#include "ApiTypes.h"
#include "spore/types/Config.h"
#include "spore/types/ApiTypes.h"
class NodeContext {
public:

View File

@@ -4,7 +4,7 @@
#include <functional>
#include <string>
#include <map>
#include "NodeContext.h"
#include "spore/core/NodeContext.h"
#include <ArduinoJson.h>
// Define our own callback type to avoid conflict with TaskScheduler

View File

@@ -1,6 +1,6 @@
#pragma once
#include "services/Service.h"
#include "NodeContext.h"
#include "spore/Service.h"
#include "spore/core/NodeContext.h"
#include <ArduinoJson.h>
class ClusterService : public Service {

View File

@@ -1,7 +1,7 @@
#pragma once
#include "services/Service.h"
#include "NetworkManager.h"
#include "NodeContext.h"
#include "spore/Service.h"
#include "spore/core/NetworkManager.h"
#include "spore/core/NodeContext.h"
class NetworkService : public Service {
public:

View File

@@ -1,6 +1,6 @@
#pragma once
#include "services/Service.h"
#include "NodeContext.h"
#include "spore/Service.h"
#include "spore/core/NodeContext.h"
#include <ArduinoJson.h>
#include <Updater.h>

View File

@@ -1,6 +1,6 @@
#pragma once
#include "services/Service.h"
#include "TaskManager.h"
#include "spore/Service.h"
#include "spore/core/TaskManager.h"
#include <ArduinoJson.h>
class TaskService : public Service {