pass const references to user handler now

This commit is contained in:
Robin Müller 2022-08-24 15:43:58 +02:00
parent 2c730c8632
commit 267466be9d
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
4 changed files with 36 additions and 32 deletions

View File

@ -89,7 +89,7 @@ class DestHandler {
cfdp::FileSize fileSize;
TransactionId transactionId;
PduConfig pduConf;
RemoteEntityCfg* remoteCfg;
RemoteEntityCfg* remoteCfg = nullptr;
};
TransactionStep step = TransactionStep::IDLE;

View File

@ -68,9 +68,9 @@ class UserBase {
explicit UserBase(HasFileSystemIF& vfs);
virtual void transactionIndication(TransactionId id) = 0;
virtual void eofSentIndication(TransactionId id) = 0;
virtual void transactionFinishedIndication(TransactionFinishedParams params) = 0;
virtual void transactionIndication(const TransactionId& id) = 0;
virtual void eofSentIndication(const TransactionId& id) = 0;
virtual void transactionFinishedIndication(const TransactionFinishedParams& params) = 0;
/**
* Will be called if metadata was received.
*
@ -82,13 +82,13 @@ class UserBase {
* @param params
*/
virtual void metadataRecvdIndication(const MetadataRecvdParams& params) = 0;
virtual void fileSegmentRecvdIndication(FileSegmentRecvdParams params) = 0;
virtual void reportIndication(TransactionId id, StatusReportIF& report) = 0;
virtual void suspendedIndication(TransactionId id, ConditionCode code) = 0;
virtual void resumedIndication(TransactionId id, size_t progress) = 0;
virtual void faultIndication(TransactionId id, ConditionCode code, size_t progress) = 0;
virtual void abandonedIndication(TransactionId id, ConditionCode code, size_t progress) = 0;
virtual void eofRecvIndication(TransactionId id) = 0;
virtual void fileSegmentRecvdIndication(const FileSegmentRecvdParams& params) = 0;
virtual void reportIndication(const TransactionId& id, StatusReportIF& report) = 0;
virtual void suspendedIndication(const TransactionId& id, ConditionCode code) = 0;
virtual void resumedIndication(const TransactionId& id, size_t progress) = 0;
virtual void faultIndication(const TransactionId& id, ConditionCode code, size_t progress) = 0;
virtual void abandonedIndication(const TransactionId& id, ConditionCode code, size_t progress) = 0;
virtual void eofRecvIndication(const TransactionId& id) = 0;
private:
HasFileSystemIF& vfs;

View File

@ -1,17 +1,21 @@
#include "UserMock.h"
namespace cfdp {
cfdp::UserMock::UserMock(HasFileSystemIF& vfs) : UserBase(vfs) {}
void cfdp::UserMock::transactionIndication(cfdp::TransactionId id) {}
void cfdp::UserMock::eofSentIndication(cfdp::TransactionId id) {}
void cfdp::UserMock::abandonedIndication(cfdp::TransactionId id, cfdp::ConditionCode code,
void UserMock::transactionIndication(const TransactionId& id) {}
void UserMock::eofSentIndication(const TransactionId& id) {}
void UserMock::abandonedIndication(const TransactionId& id, cfdp::ConditionCode code,
uint64_t progress) {}
void cfdp::UserMock::eofRecvIndication(cfdp::TransactionId id) {}
void cfdp::UserMock::transactionFinishedIndication(TransactionFinishedParams finishedParams) {}
void cfdp::UserMock::metadataRecvdIndication(const MetadataRecvdParams& params) {}
void cfdp::UserMock::fileSegmentRecvdIndication(FileSegmentRecvdParams params) {}
void cfdp::UserMock::reportIndication(TransactionId id, StatusReportIF& report) {}
void cfdp::UserMock::suspendedIndication(TransactionId id, ConditionCode code) {}
void cfdp::UserMock::resumedIndication(TransactionId id, size_t progress) {}
void cfdp::UserMock::faultIndication(cfdp::TransactionId id, cfdp::ConditionCode code,
void UserMock::eofRecvIndication(const TransactionId& id) {}
void UserMock::transactionFinishedIndication(const TransactionFinishedParams& finishedParams) {}
void UserMock::metadataRecvdIndication(const MetadataRecvdParams& params) {}
void UserMock::fileSegmentRecvdIndication(const FileSegmentRecvdParams& params) {}
void UserMock::reportIndication(const TransactionId& id, StatusReportIF& report) {}
void UserMock::suspendedIndication(const TransactionId& id, ConditionCode code) {}
void UserMock::resumedIndication(const TransactionId& id, size_t progress) {}
void UserMock::faultIndication(const TransactionId& id, cfdp::ConditionCode code,
size_t progress) {}
}

View File

@ -8,17 +8,17 @@ class UserMock : public UserBase {
public:
explicit UserMock(HasFileSystemIF& vfs);
void transactionIndication(TransactionId id) override;
void eofSentIndication(TransactionId id) override;
void abandonedIndication(TransactionId id, ConditionCode code, size_t progress) override;
void eofRecvIndication(TransactionId id) override;
void transactionFinishedIndication(TransactionFinishedParams params) override;
void transactionIndication(const TransactionId& id) override;
void eofSentIndication(const TransactionId& id) override;
void abandonedIndication(const TransactionId& id, ConditionCode code, size_t progress) override;
void eofRecvIndication(const TransactionId& id) override;
void transactionFinishedIndication(const TransactionFinishedParams& params) override;
void metadataRecvdIndication(const MetadataRecvdParams& params) override;
void fileSegmentRecvdIndication(FileSegmentRecvdParams params) override;
void reportIndication(TransactionId id, StatusReportIF& report) override;
void suspendedIndication(TransactionId id, ConditionCode code) override;
void resumedIndication(TransactionId id, size_t progress) override;
void faultIndication(TransactionId id, ConditionCode code, size_t progress) override;
void fileSegmentRecvdIndication(const FileSegmentRecvdParams& params) override;
void reportIndication(const TransactionId& id, StatusReportIF& report) override;
void suspendedIndication(const TransactionId& id, ConditionCode code) override;
void resumedIndication(const TransactionId& id, size_t progress) override;
void faultIndication(const TransactionId& id, ConditionCode code, size_t progress) override;
};
} // namespace cfdp