PLCnext API Documentation  22.9.0.33
StorageFileFormatMigrationPayload.hpp
1 //
3 // Copyright PHOENIX CONTACT Electronics GmbH
4 //
6 
7 #pragma once
8 
9 #include "Arp/System/Nm/SpecializedPayload.hpp"
10 #include "Arp/System/NmPayload/NotificationLogger/StorageFileFormatMigrationResult.hpp"
11 #include <tuple>
12 
13 namespace Arp { namespace System { namespace NmPayload { namespace NotificationLogger
14 {
15 
18 class StorageFileFormatMigrationPayload : public Arp::System::Nm::SpecializedPayload<StorageFileFormatMigrationPayload>
19 {
20 public:
22  using ArgumentsType = std::tuple<const char*, const char*, StorageFileFormatMigrationResult, int, int, const char*>;
23 
24  using SpecializedPayload::SpecializedPayload;
25 
28 
31  StorageFileFormatMigrationPayload(const String& archiveName, const String& filePath,
32  StorageFileFormatMigrationResult result, int sourceVersion, int destinationVersion,
33  const String& backupFilePath);
34 
37 
40 
42  StorageFileFormatMigrationResult GetResult() const;
43 
45  int GetSourceVersion() const;
46 
48  int GetDestinationVersion() const;
49 
52 
53 private:
54  static String GetFormatString(StorageFileFormatMigrationResult result);
55 
56 private:
57  // Do not change the order of the field initialization!
58  const size_t indexArchiveName = this->AddField<String>();
59  const size_t indexFilePath = this->AddField<String>();
60  const size_t indexResult = this->AddField<StorageFileFormatMigrationResult>();
61  const size_t indexSourceVersion = this->AddField<int>();
62  const size_t indexDestinationVersion = this->AddField<int>();
63  const size_t indexBackupFilePath = this->AddField<String>();
64 };
65 
66 }}}} // namespace Arp::System::NmPayload::NotificationLogger
Payload class for a message regarding the migration of the storage file format
Definition: StorageFileFormatMigrationPayload.hpp:19
int GetDestinationVersion() const
Returns the file version after the migration
int GetSourceVersion() const
Returns the file version before the migration
StorageFileFormatMigrationPayload(const ArgumentsType &args)
Creates a payload object
String GetBackupFilePath() const
Returns the path of the backup file if it was created
StorageFileFormatMigrationResult GetResult() const
Returns the result of the migration
String GetFilePath() const
Returns the name of the migrated file
std::tuple< const char *, const char *, StorageFileFormatMigrationResult, int, int, const char * > ArgumentsType
ArgumentsType to be used with NonBlockingNotificationRegistration3
Definition: StorageFileFormatMigrationPayload.hpp:22
StorageFileFormatMigrationPayload(const String &archiveName, const String &filePath, StorageFileFormatMigrationResult result, int sourceVersion, int destinationVersion, const String &backupFilePath)
Creates a payload object
Base class for custom Payload classes
Definition: SpecializedPayload.hpp:43
@ System
System components used by the System, Device, Plc or Io domains.
Root namespace for the PLCnext API