1#ifndef IV_SRC_CHANNELS_NETWORKINFO_HPP_
2#define IV_SRC_CHANNELS_NETWORKINFO_HPP_
30 std::shared_ptr<INetworkInfo> networkInfo {
nullptr};
31 auto protocolType = magic_enum::enum_cast<iv::comms::eProtocolType>(
37 networkInfo->load(nodeNetwork);
43 virtual void update(
const std::shared_ptr<INetworkInfo> &other)
82 m_direction = magic_enum::enum_cast<iv::channels::INetworkInfo::eDirection>(
95 static constexpr std::string_view
protocol {
"Type"};
97 static constexpr std::string_view
direction {
"Direction"};
102 static constexpr std::string
string {};
114 void update(
const std::shared_ptr<INetworkInfo> &other)
override;
137 void update(
const std::shared_ptr<INetworkInfo> &other)
override;
160 void update(
const std::shared_ptr<INetworkInfo> &other)
override;
174 static constexpr std::string_view
registerInfo {
"Nmea0183RegisterInfo"};
183 void update(
const std::shared_ptr<INetworkInfo> &other)
override;
206 void update(
const std::shared_ptr<INetworkInfo> &other)
override;
227 switch (protocolType)
230 return std::make_shared<iv::channels::J1939NetworkInfo>(networkId);
233 return std::make_shared<iv::channels::ModbusNetworkInfo>(networkId);
236 return std::make_shared<iv::channels::Nmea0183NetworkInfo>(networkId);
239 return std::make_shared<iv::channels::VdrNetworkInfo>(networkId);
242 return std::make_shared<iv::channels::Nmea2kNetworkInfo>(networkId);
Definition NetworkInfo.hpp:18
virtual bool load(const iv::file::xml::node &nodeNetwork)
Definition NetworkInfo.hpp:76
virtual void update(const std::shared_ptr< INetworkInfo > &other)
Definition NetworkInfo.hpp:43
eDirection direction() const
Definition NetworkInfo.hpp:68
virtual bool save(iv::file::xml::node &nodeNetwork) const
Definition NetworkInfo.hpp:50
static std::shared_ptr< INetworkInfo > loadStatic(const iv::file::xml::node &nodeNetwork)
Definition NetworkInfo.hpp:28
iv::types::networkId & nameNetwork()
Definition NetworkInfo.hpp:58
iv::comms::eProtocolType m_protocolType
Definition NetworkInfo.hpp:89
iv::channels::INetworkInfo::eDirection m_direction
Definition NetworkInfo.hpp:73
iv::types::networkId m_nameNetwork
Definition NetworkInfo.hpp:90
iv::comms::eProtocolType protocolType() const
Definition NetworkInfo.hpp:63
eDirection
Definition NetworkInfo.hpp:21
virtual ~INetworkInfo()=default
Definition NetworkInfo.hpp:110
void update(const std::shared_ptr< INetworkInfo > &other) override
Definition NetworkInfo.cpp:24
bool load(const iv::file::xml::node &nodeNetwork) override
Definition NetworkInfo.cpp:15
iv::channels::J1939RegisterInfo & getInfo()
Definition NetworkInfo.hpp:118
iv::channels::J1939RegisterInfo m_info
Definition NetworkInfo.hpp:124
bool save(iv::file::xml::node &nodeNetwork) const override
Definition NetworkInfo.cpp:36
J1939NetworkInfo(const iv::types::networkId &networkId)
Definition NetworkInfo.cpp:8
Definition NetworkInfo.hpp:133
iv::channels::ModbusRegisterInfo m_info
Definition NetworkInfo.hpp:146
iv::channels::ModbusRegisterInfo & getInfo()
Definition NetworkInfo.hpp:141
void update(const std::shared_ptr< INetworkInfo > &other) override
Definition NetworkInfo.cpp:69
bool save(iv::file::xml::node &nodeNetwork) const override
Definition NetworkInfo.cpp:61
bool load(const iv::file::xml::node &nodeNetwork) override
Definition NetworkInfo.cpp:52
ModbusNetworkInfo(const iv::types::networkId &networkId)
Definition NetworkInfo.cpp:45
Definition NetworkInfo.hpp:156
void update(const std::shared_ptr< INetworkInfo > &other) override
Definition NetworkInfo.cpp:105
iv::channels::Nmea0183RegisterInfo m_info
Definition NetworkInfo.hpp:169
iv::channels::Nmea0183RegisterInfo & getInfo()
Definition NetworkInfo.hpp:164
bool load(const iv::file::xml::node &nodeNetwork) override
Definition NetworkInfo.cpp:88
Nmea0183NetworkInfo(const iv::types::networkId &networkId)
Definition NetworkInfo.cpp:81
bool save(iv::file::xml::node &nodeNetwork) const override
Definition NetworkInfo.cpp:97
Definition NetworkInfo.hpp:179
bool save(iv::file::xml::node &nodeNetwork) const override
Definition NetworkInfo.cpp:175
iv::channels::Nmea2kRegisterInfo m_info
Definition NetworkInfo.hpp:192
iv::channels::Nmea2kRegisterInfo & getInfo()
Definition NetworkInfo.hpp:187
void update(const std::shared_ptr< INetworkInfo > &other) override
Definition NetworkInfo.cpp:155
Nmea2kNetworkInfo(const iv::types::networkId &networkId)
Definition NetworkInfo.cpp:149
bool load(const iv::file::xml::node &nodeNetwork) override
Definition NetworkInfo.cpp:167
Definition NetworkInfo.hpp:202
void update(const std::shared_ptr< INetworkInfo > &other) override
Definition NetworkInfo.cpp:122
iv::channels::VdrRegisterInfo m_info
Definition NetworkInfo.hpp:215
bool load(const iv::file::xml::node &nodeNetwork) override
Definition NetworkInfo.cpp:133
iv::channels::VdrRegisterInfo & getInfo()
Definition NetworkInfo.hpp:210
VdrNetworkInfo(const iv::types::networkId &networkId)
Definition NetworkInfo.cpp:116
bool save(iv::file::xml::node &nodeNetwork) const override
Definition NetworkInfo.cpp:141
Definition xmlFile.hpp:15
T getAttribute(const std::string_view key, T defaultValue) const
Definition xmlFile.hpp:33
bool addAttribute(const std::string_view key, T value)
Definition xmlFile.hpp:77
Definition AlarmsManager.hpp:17
static std::shared_ptr< iv::channels::INetworkInfo > createNetworkType(iv::comms::eProtocolType protocolType, const iv::types::networkId &networkId)
Definition NetworkInfo.hpp:224
eProtocolType
Definition enums.hpp:260
std::string networkId
Definition types.hpp:43
Definition NetworkInfo.hpp:101
static constexpr std::string string
Definition NetworkInfo.hpp:102
static constexpr iv::channels::INetworkInfo::eDirection direction
Definition NetworkInfo.hpp:105
static constexpr iv::comms::eProtocolType protocolType
Definition NetworkInfo.hpp:103
static constexpr iv::types::networkId nameNetwork
Definition NetworkInfo.hpp:104
Definition NetworkInfo.hpp:94
static constexpr std::string_view protocol
Definition NetworkInfo.hpp:95
static constexpr std::string_view direction
Definition NetworkInfo.hpp:97
static constexpr std::string_view nameNetwork
Definition NetworkInfo.hpp:96
Definition NetworkInfo.hpp:127
static constexpr std::string_view registerInfo
Definition NetworkInfo.hpp:128
Definition structs.hpp:389
Definition NetworkInfo.hpp:150
static constexpr std::string_view registerInfo
Definition NetworkInfo.hpp:151
Definition structs.hpp:509
Definition NetworkInfo.hpp:173
static constexpr std::string_view registerInfo
Definition NetworkInfo.hpp:174
Definition structs.hpp:591
Definition NetworkInfo.hpp:196
static constexpr std::string_view registerInfo
Definition NetworkInfo.hpp:197
Definition structs.hpp:288
Definition NetworkInfo.hpp:219
static constexpr std::string_view registerInfo
Definition NetworkInfo.hpp:220
Definition structs.hpp:629