log
This commit is contained in:
47
src/core/CoreService.cpp
Normal file
47
src/core/CoreService.cpp
Normal file
@@ -0,0 +1,47 @@
|
||||
#include "CoreService.h"
|
||||
#include "../utils/logs/logging.h"
|
||||
|
||||
CoreService* CoreService::instance()
|
||||
{
|
||||
static CoreService inst;
|
||||
return &inst;
|
||||
}
|
||||
|
||||
CoreService::CoreService(QObject* parent)
|
||||
: QObject(parent)
|
||||
, m_initialized(false)
|
||||
{
|
||||
}
|
||||
|
||||
CoreService::~CoreService()
|
||||
{
|
||||
shutdown();
|
||||
}
|
||||
|
||||
bool CoreService::initialize()
|
||||
{
|
||||
if (m_initialized) {
|
||||
LOG_WARNING() << "CoreService already initialized";
|
||||
return true;
|
||||
}
|
||||
|
||||
LOG_INFO() << "CoreService initializing";
|
||||
m_initialized = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CoreService::shutdown()
|
||||
{
|
||||
if (!m_initialized) {
|
||||
LOG_DEBUG() << "CoreService shutdown called while not initialized";
|
||||
return;
|
||||
}
|
||||
|
||||
LOG_INFO() << "CoreService shutting down";
|
||||
m_initialized = false;
|
||||
}
|
||||
|
||||
bool CoreService::isInitialized() const
|
||||
{
|
||||
return m_initialized;
|
||||
}
|
||||
23
src/core/CoreService.h
Normal file
23
src/core/CoreService.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class CoreService : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static CoreService* instance();
|
||||
|
||||
bool initialize();
|
||||
void shutdown();
|
||||
bool isInitialized() const;
|
||||
|
||||
private:
|
||||
explicit CoreService(QObject* parent = nullptr);
|
||||
~CoreService();
|
||||
|
||||
CoreService(const CoreService&) = delete;
|
||||
CoreService& operator=(const CoreService&) = delete;
|
||||
|
||||
bool m_initialized = false;
|
||||
};
|
||||
7
src/core/memory/LockFreeQueue.h
Normal file
7
src/core/memory/LockFreeQueue.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
// Placeholder for a lock-free ring queue.
|
||||
class LockFreeQueue {
|
||||
public:
|
||||
LockFreeQueue() = default;
|
||||
};
|
||||
7
src/core/memory/MemoryPool.h
Normal file
7
src/core/memory/MemoryPool.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
// Placeholder for a preallocated memory pool.
|
||||
class MemoryPool {
|
||||
public:
|
||||
MemoryPool() = default;
|
||||
};
|
||||
5
src/core/metadata/DataTrace.h
Normal file
5
src/core/metadata/DataTrace.h
Normal file
@@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
// Placeholder for data trace model.
|
||||
struct DataTrace {
|
||||
};
|
||||
5
src/core/metadata/Metadata.h
Normal file
5
src/core/metadata/Metadata.h
Normal file
@@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
// Placeholder for metadata model.
|
||||
struct Metadata {
|
||||
};
|
||||
7
src/core/plugin_system/IProtocolPlugin.h
Normal file
7
src/core/plugin_system/IProtocolPlugin.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
// Placeholder protocol plugin interface.
|
||||
class IProtocolPlugin {
|
||||
public:
|
||||
virtual ~IProtocolPlugin() = default;
|
||||
};
|
||||
7
src/core/plugin_system/PluginManager.h
Normal file
7
src/core/plugin_system/PluginManager.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
// Placeholder for plugin manager.
|
||||
class PluginManager {
|
||||
public:
|
||||
PluginManager() = default;
|
||||
};
|
||||
Reference in New Issue
Block a user