43 lines
767 B
C++
43 lines
767 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
namespace gencpp {
|
|
namespace core {
|
|
|
|
/**
|
|
* @brief Base class for all components in the system.
|
|
*/
|
|
template <typename T>
|
|
class BaseComponent {
|
|
public:
|
|
virtual ~BaseComponent() = default;
|
|
|
|
virtual void Initialize() = 0;
|
|
virtual void Shutdown() = 0;
|
|
|
|
virtual const std::string& GetName() const = 0;
|
|
|
|
struct Config {
|
|
std::string name;
|
|
int priority;
|
|
bool enabled;
|
|
|
|
class Metadata {
|
|
public:
|
|
std::string author;
|
|
std::string version;
|
|
};
|
|
Metadata metadata;
|
|
};
|
|
|
|
protected:
|
|
BaseComponent(const Config& config) : m_config(config) {}
|
|
Config m_config;
|
|
};
|
|
|
|
} // namespace core
|
|
} // namespace gencpp
|