2022-07-21 17:00:41 +03:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
#include <map>
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
|
|
|
|
#include "profinet_submodule.hpp"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ProfinetModule {
|
|
|
|
|
|
public:
|
2022-07-29 09:25:07 +03:00
|
|
|
|
static std::shared_ptr<ProfinetModule> Create(uint32_t module_id, std::string module_name) {
|
|
|
|
|
|
return std::shared_ptr<ProfinetModule>(new ProfinetModule(module_id, module_name));
|
|
|
|
|
|
}
|
2022-07-21 17:00:41 +03:00
|
|
|
|
|
2022-07-29 09:25:07 +03:00
|
|
|
|
ProfinetModule(uint32_t module_id, std::string module_name);
|
|
|
|
|
|
|
2022-07-21 17:00:41 +03:00
|
|
|
|
bool addSubmodule(std::shared_ptr<ProfinetSubmodule>& submodule_ptr);
|
|
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<ProfinetSubmodule> getSubmodulePtr(uint32_t submodule_id);
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
const uint32_t m_id; /// module id
|
|
|
|
|
|
const std::string m_name; /// module name
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
/// Набор поддерживаемых подмодулей
|
|
|
|
|
|
std::map<uint32_t, std::shared_ptr<ProfinetSubmodule>> m_submodules;
|
|
|
|
|
|
};
|