#pragma once #include #include #include "fsfw/cfdp/definitions.h" #include "fsfw/cfdp/handler/PduPacketIF.h" namespace cfdp { class OwnedPduPacket : public PduPacketIF { public: OwnedPduPacket(PduType pduType, std::optional fileDirective, const uint8_t* rawPdu, size_t pduLen) : pduType(pduType), fileDirective(fileDirective), rawPdu(rawPdu, rawPdu + pduLen) {} [[nodiscard]] cfdp::PduType getPduType() const override { return pduType; }; [[nodiscard]] std::optional getFileDirective() const override { return fileDirective; }; [[nodiscard]] const uint8_t* getRawPduData(size_t& pduLen) const override { pduLen = rawPdu.size(); return rawPdu.data(); } PduType pduType; std::optional fileDirective; std::vector rawPdu; }; } // namespace cfdp