Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
ProjectSynchronization.hpp
Go to the documentation of this file.
1#ifndef IV_SRC_COMMS_PROJECTSYNCHRONIZATION_HPP
2#define IV_SRC_COMMS_PROJECTSYNCHRONIZATION_HPP
3
9
10#include <memory>
11
12namespace iv::comms
13{
14
16{
17public:
18 // Singleton
19 static std::unique_ptr<iv::comms::ProjectSynchronization> &create();
20
24
27
28 static bool sendProjectInfoMessage();
29 static bool sendProjectRequestMessage(const iv::types::stationId &station);
30 static bool sendProject(const iv::types::stationId &station,
32
33 static bool
34 processProjectInfoMessage(const std::shared_ptr<iv::comms::redundancy::RedundancyMessageProjectInfo> &message);
36 const std::shared_ptr<iv::comms::redundancy::RedundancyMessageProjectRequest> &message);
38 const std::shared_ptr<iv::comms::redundancy::RedundancyMessageProjectResponse> &message);
39
40private:
42
43 static bool prvSendMessage(const std::vector<std::byte> &message,
44 const iv::model::comms::net::IpSettings &ipSettings);
45 static bool prvSendFile(std::string_view projectFolder, std::string_view filePath,
47 const iv::model::comms::net::IpSettings &ipSettings);
48
49 static std::unique_ptr<iv::comms::ProjectSynchronization> instance;
50
58
59 std::vector<std::weak_ptr<iv::comms::ip::IPCommunicationDriver>> m_redundancyDrivers;
60 std::map<iv::types::stationId, iv::model::comms::net::IpSettings> m_peerStationsIps;
61
62 std::map<iv::types::stationId, SyncStationsInfo> m_stationsSyncInfo;
64
69};
70
71}// namespace iv::comms
72
73#endif//IV_SRC_COMMS_PROJECTSYNCHRONIZATION_HPP
Definition ProjectSynchronization.hpp:16
ProjectSynchronization(const ProjectSynchronization &other)=delete
iv::types::stationId m_station
Definition ProjectSynchronization.hpp:63
static bool processProjectRequestMessage(const std::shared_ptr< iv::comms::redundancy::RedundancyMessageProjectRequest > &message)
Definition ProjectSynchronization.cpp:248
ProjectSynchronization()
Definition ProjectSynchronization.cpp:305
static bool prvSendMessage(const std::vector< std::byte > &message, const iv::model::comms::net::IpSettings &ipSettings)
Definition ProjectSynchronization.cpp:333
static bool processProjectResponseMessage(const std::shared_ptr< iv::comms::redundancy::RedundancyMessageProjectResponse > &message)
Definition ProjectSynchronization.cpp:266
static bool processProjectInfoMessage(const std::shared_ptr< iv::comms::redundancy::RedundancyMessageProjectInfo > &message)
Definition ProjectSynchronization.cpp:190
static std::unique_ptr< iv::comms::ProjectSynchronization > instance
Definition ProjectSynchronization.hpp:49
std::vector< std::weak_ptr< iv::comms::ip::IPCommunicationDriver > > m_redundancyDrivers
Definition ProjectSynchronization.hpp:59
std::map< iv::types::stationId, iv::model::comms::net::IpSettings > m_peerStationsIps
Definition ProjectSynchronization.hpp:60
ProjectSynchronization & operator=(const ProjectSynchronization &other)=delete
static bool sendProject(const iv::types::stationId &station, iv::comms::redundancy::eProjectSyncronizationFile fileType)
Definition ProjectSynchronization.cpp:91
static bool sendProjectInfoMessage()
Definition ProjectSynchronization.cpp:28
ProjectSynchronization(ProjectSynchronization &&other)=delete
static std::unique_ptr< iv::comms::ProjectSynchronization > & create()
Definition ProjectSynchronization.cpp:18
static bool prvSendFile(std::string_view projectFolder, std::string_view filePath, iv::comms::redundancy::eProjectSyncronizationFile fileType, const iv::model::comms::net::IpSettings &ipSettings)
Definition ProjectSynchronization.cpp:70
std::map< iv::types::stationId, SyncStationsInfo > m_stationsSyncInfo
Definition ProjectSynchronization.hpp:62
static bool sendProjectRequestMessage(const iv::types::stationId &station)
Definition ProjectSynchronization.cpp:49
ProjectSynchronization & operator=(ProjectSynchronization &&other)=delete
eProjectSyncronizationFile
Definition enums.hpp:44
Definition ApiCommunicationController.cpp:12
static constexpr iv::types::timestamp MillisecondsInSeconds
Definition constants.hpp:35
uint64_t timestamp
Definition types.hpp:21
std::string stationId
Definition types.hpp:75
Definition ProjectSynchronization.hpp:66
static constexpr iv::types::timestamp lastUpdateDifference
Definition ProjectSynchronization.hpp:67
Definition ProjectSynchronization.hpp:52
std::string reference
Definition ProjectSynchronization.hpp:55
iv::types::timestamp lastUpdateTime
Definition ProjectSynchronization.hpp:54
std::string lastVersion
Definition ProjectSynchronization.hpp:56
iv::types::stationId station
Definition ProjectSynchronization.hpp:53
Definition IpSettings.hpp:17