Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
structs.hpp
Go to the documentation of this file.
1#ifndef IV_SRC_SERVICES_STRUCTS_HPP_
2#define IV_SRC_SERVICES_STRUCTS_HPP_
3
4#include "alarms/enums.hpp"
5#include "core/types.hpp"
8
9#include <memory>
10#include <optional>
11#include <string>
12#include <utility>
13#include <vector>
14
15namespace iv::comms::api
16{
17
19{
20 uint32_t count {0};
21 uint32_t limit {0};
22 uint32_t offset {0};
23 uint64_t total {0};
24};
25
32
34{
35 std::vector<ApiCommunicationInfo> apiURLs;
36
37 bool load(const iv::file::xml::node &node);
38 bool save(iv::file::xml::node &node) const;
39
40private:
41 struct Keys
42 {
43 static constexpr std::string_view httpSettingIp {"Ip"};
44 static constexpr std::string_view httpSettingPort {"Port"};
45 };
46
47 struct Sections
48 {
49 static constexpr std::string_view httpSetting {"HttpSetting"};
50 };
51};
52
54{
56
57 ILoggerMessage() = default;
58 explicit ILoggerMessage(const iv::types::timestamp _timestamp) : timestamp(_timestamp) {};
59 virtual ~ILoggerMessage() = default;
60};
61
63{
65 std::optional<std::vector<std::shared_ptr<iv::comms::api::ILoggerMessage>>> messages {std::nullopt};
66};
67
69{
70 bool acknowledged {false};
71 uint32_t count {0};
72 std::optional<std::string> extraInfo {std::nullopt};
73
74 struct Fields
75 {
76 static constexpr std::string_view acknowledged {"acknowledged"};
77 static constexpr std::string_view count {"deletedCount"};
78 };
79};
80
82{
83 bool isActive {false};
84
85 std::string status;
86 std::string version;
87 std::string name;
88 std::string description;
89};
90
91namespace dataLogger
92{
93
113
114}// namespace dataLogger
115
116namespace eventLogger
117{
118
120{
121 //Common data
122 std::string id;
123 std::string description;
124 std::string source;
125 std::string type;
126 iv::model::diamar::EventCategory category;//Kept as an enum to make it easier to filter
127
128 //Access control event
129 std::string userProfileIn;
130 std::string userProfileOut;
131
132 //Request errors event or potential attack activity event
133 std::string ipAddress;
134 std::string ipPort;
135
136 //Control system event
137 std::string unitId;
138 std::string channelId;
139 std::string groupId;
140
141 //Backup and restore event
142 std::string backupName;
143};
144
145}// namespace eventLogger
146
147namespace historyLogger
148{
149
172
173}// namespace historyLogger
174
175}// namespace iv::comms::api
176
177#endif//IV_SRC_SERVICES_STRUCTS_HPP_
Definition xmlFile.hpp:15
eAlarmPriority
Definition enums.hpp:13
eAlarmType
Definition enums.hpp:56
eAlarmState
Definition enums.hpp:20
Definition ApiCommunicationController.cpp:12
EventCategory
Definition AuditableEvents.hpp:11
uint64_t timestamp
Definition types.hpp:21
uint16_t ipPort
Definition types.hpp:41
double channelValue
Definition types.hpp:67
std::string ipAddress
Definition types.hpp:40
std::string channelId
Definition types.hpp:66
Definition structs.hpp:27
iv::types::ipPort port
Definition structs.hpp:29
iv::types::ipAddress ip
Definition structs.hpp:28
std::weak_ptr< bool > isEnabled
Definition structs.hpp:30
static constexpr std::string_view acknowledged
Definition structs.hpp:76
static constexpr std::string_view count
Definition structs.hpp:77
Definition structs.hpp:69
std::optional< std::string > extraInfo
Definition structs.hpp:72
uint32_t count
Definition structs.hpp:71
bool acknowledged
Definition structs.hpp:70
Definition structs.hpp:19
uint64_t total
Definition structs.hpp:23
uint32_t limit
Definition structs.hpp:21
uint32_t offset
Definition structs.hpp:22
uint32_t count
Definition structs.hpp:20
Definition structs.hpp:82
std::string version
Definition structs.hpp:86
bool isActive
Definition structs.hpp:83
std::string status
Definition structs.hpp:85
std::string name
Definition structs.hpp:87
std::string description
Definition structs.hpp:88
Definition structs.hpp:63
std::optional< std::vector< std::shared_ptr< iv::comms::api::ILoggerMessage > > > messages
Definition structs.hpp:65
ApiPaginationInfo paginationInfo
Definition structs.hpp:64
Definition structs.hpp:42
static constexpr std::string_view httpSettingIp
Definition structs.hpp:43
static constexpr std::string_view httpSettingPort
Definition structs.hpp:44
static constexpr std::string_view httpSetting
Definition structs.hpp:49
Definition structs.hpp:34
std::vector< ApiCommunicationInfo > apiURLs
Definition structs.hpp:35
bool load(const iv::file::xml::node &node)
Definition structs.cpp:9
bool save(iv::file::xml::node &node) const
Definition structs.cpp:20
Definition structs.hpp:54
virtual ~ILoggerMessage()=default
ILoggerMessage(const iv::types::timestamp _timestamp)
Definition structs.hpp:58
iv::types::timestamp timestamp
Definition structs.hpp:55
iv::alarms::eAlarmType alarmType
Definition structs.hpp:101
iv::alarms::eAlarmState alarmState
Definition structs.hpp:100
iv::types::channelId channelId
Definition structs.hpp:96
DataLoggerMessage(const iv::types::timestamp _timestamp, iv::types::channelId _channelId, const iv::types::channelValue _value, const iv::alarms::eAlarmPriority _alarmPriority, const iv::alarms::eAlarmState _alarmState, const iv::alarms::eAlarmType _alarmType)
Definition structs.hpp:105
iv::alarms::eAlarmPriority alarmPriority
Definition structs.hpp:99
iv::types::channelValue value
Definition structs.hpp:97
std::string ipAddress
Definition structs.hpp:133
std::string id
Definition structs.hpp:122
std::string unitId
Definition structs.hpp:137
iv::model::diamar::EventCategory category
Definition structs.hpp:126
std::string source
Definition structs.hpp:124
std::string description
Definition structs.hpp:123
std::string channelId
Definition structs.hpp:138
std::string backupName
Definition structs.hpp:142
std::string groupId
Definition structs.hpp:139
std::string userProfileOut
Definition structs.hpp:130
std::string ipPort
Definition structs.hpp:134
std::string type
Definition structs.hpp:125
std::string userProfileIn
Definition structs.hpp:129
iv::types::channelId tag
Definition structs.hpp:152
iv::alarms::eAlarmState originalAlarmState
Definition structs.hpp:157
iv::types::channelValue value
Definition structs.hpp:159
iv::alarms::eAlarmType alarmType
Definition structs.hpp:158
iv::alarms::eAlarmPriority alarmPriority
Definition structs.hpp:155
HistoryLoggerMessage(const iv::types::timestamp _timestamp, iv::types::channelId _channelId, std::string _message, const iv::alarms::eAlarmPriority _alarmPriority, const iv::alarms::eAlarmState _alarmState, const iv::alarms::eAlarmType _alarmType, const iv::types::channelValue _value, const bool _isPrinted)
Definition structs.hpp:164
iv::alarms::eAlarmState alarmState
Definition structs.hpp:156
std::string message
Definition structs.hpp:153