2021-12-03 15:37:49 +01:00
|
|
|
#ifndef FSFW_SRC_FSFW_CFDP_PDU_METADATAINFO_H_
|
|
|
|
#define FSFW_SRC_FSFW_CFDP_PDU_METADATAINFO_H_
|
|
|
|
|
2022-08-23 19:37:30 +02:00
|
|
|
#include <optional>
|
|
|
|
|
2021-12-03 15:37:49 +01:00
|
|
|
#include "fsfw/cfdp/FileSize.h"
|
|
|
|
#include "fsfw/cfdp/definitions.h"
|
2022-02-02 10:29:30 +01:00
|
|
|
#include "fsfw/cfdp/tlv/Lv.h"
|
2022-08-23 19:37:30 +02:00
|
|
|
#include "fsfw/cfdp/tlv/StringLv.h"
|
2022-02-02 10:29:30 +01:00
|
|
|
#include "fsfw/cfdp/tlv/Tlv.h"
|
2021-12-03 15:37:49 +01:00
|
|
|
|
|
|
|
class MetadataInfo {
|
2022-02-02 10:29:30 +01:00
|
|
|
public:
|
2022-08-23 19:37:30 +02:00
|
|
|
MetadataInfo(cfdp::FileSize& fileSize, cfdp::StringLv& sourceFileName,
|
|
|
|
cfdp::StringLv& destFileName);
|
2022-09-15 18:41:15 +02:00
|
|
|
MetadataInfo(bool closureRequested, cfdp::ChecksumType checksumType, cfdp::FileSize& fileSize,
|
2022-08-23 19:37:30 +02:00
|
|
|
cfdp::StringLv& sourceFileName, cfdp::StringLv& destFileName);
|
2022-02-02 10:29:30 +01:00
|
|
|
|
|
|
|
size_t getSerializedSize(bool fssLarge = false);
|
|
|
|
|
2022-08-23 19:37:30 +02:00
|
|
|
void setOptionsArray(cfdp::Tlv** optionsArray, std::optional<size_t> optionsLen,
|
|
|
|
std::optional<size_t> maxOptionsLen);
|
2022-09-15 18:41:15 +02:00
|
|
|
[[nodiscard]] cfdp::ChecksumType getChecksumType() const;
|
|
|
|
void setChecksumType(cfdp::ChecksumType checksumType);
|
2022-08-08 17:53:42 +02:00
|
|
|
[[nodiscard]] bool isClosureRequested() const;
|
2022-02-02 10:29:30 +01:00
|
|
|
void setClosureRequested(bool closureRequested = false);
|
|
|
|
|
2022-08-23 19:37:30 +02:00
|
|
|
void setDestFileName(cfdp::StringLv& destFileName);
|
|
|
|
void setSourceFileName(cfdp::StringLv& sourceFileName);
|
2022-02-02 10:29:30 +01:00
|
|
|
|
2022-08-23 19:37:30 +02:00
|
|
|
cfdp::StringLv& getDestFileName();
|
|
|
|
cfdp::StringLv& getSourceFileName();
|
2022-02-02 10:29:30 +01:00
|
|
|
cfdp::FileSize& getFileSize();
|
|
|
|
|
2022-08-08 17:53:42 +02:00
|
|
|
[[nodiscard]] bool hasOptions() const;
|
|
|
|
[[nodiscard]] bool canHoldOptions() const;
|
2022-02-02 10:29:30 +01:00
|
|
|
ReturnValue_t getOptions(cfdp::Tlv*** optionsArray, size_t* optionsLen, size_t* maxOptsLen);
|
|
|
|
void setOptionsLen(size_t optionsLen);
|
2022-08-08 17:53:42 +02:00
|
|
|
[[nodiscard]] size_t getOptionsLen() const;
|
2022-02-02 10:29:30 +01:00
|
|
|
void setMaxOptionsLen(size_t maxOptionsLen);
|
2022-08-08 17:53:42 +02:00
|
|
|
[[nodiscard]] size_t getMaxOptionsLen() const;
|
2022-02-02 10:29:30 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool closureRequested = false;
|
2022-09-15 18:41:15 +02:00
|
|
|
cfdp::ChecksumType checksumType = cfdp::ChecksumType::NULL_CHECKSUM;
|
2022-02-02 10:29:30 +01:00
|
|
|
cfdp::FileSize& fileSize;
|
2022-08-23 19:37:30 +02:00
|
|
|
cfdp::StringLv& sourceFileName;
|
|
|
|
cfdp::StringLv& destFileName;
|
2022-02-02 10:29:30 +01:00
|
|
|
|
|
|
|
cfdp::Tlv** optionsArray = nullptr;
|
|
|
|
size_t optionsLen = 0;
|
|
|
|
size_t maxOptionsLen = 0;
|
2021-12-03 15:37:49 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* FSFW_SRC_FSFW_CFDP_PDU_METADATAINFO_H_ */
|