aria2/test/MockBtMessageDispatcher.h

84 lines
1.9 KiB
C
Raw Normal View History

#ifndef D_MOCK_BT_MESSAGE_DISPATCHER_H
#define D_MOCK_BT_MESSAGE_DISPATCHER_H
2006-12-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten a portion of bittorrent implementation: * src/BtMessageValidator.h: New class. * src/BtBitfieldMessageValidator.h: New class. * src/BtHandshakeMessageValidator.h: New class. * src/BtRequestMessageValidator.h: New class. * src/BtSuggestPieceMessageValidator.h: New class. * src/BtAllowedFastMessageValidator.h: New class. * src/BtRejectMessageValidator.h: New class. * src/BtCancelMessageValidator.h: New class. * src/BtPieceMessageValidator.h: New class. * src/BtHaveMessageValidator.h: New class. * src/BtEventListener.h: New class. * src/AbstractBtEventListener.h: New class. * src/BtEvent.h: New class. * src/BtChokingEvent.h: New class. * src/BtChokedEvent.h: New class. * src/BtCancelSendingPieceEvent.h: New class. * src/BtAbortOutstandingRequestEvent.h: New class. * src/Randomizer.h: New class. * src/SimpleRandomizer.h: New class. * src/BtMessage.h: New class. * src/AbstractBtMessage.h: New class. * src/SimpleBtMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtInterestedMessage.h: New class. * src/BtAllowedFastMessage.h: New class. * src/BtUnchokeMessage.h: New class. * src/BtCancelMessage.h: New class. * src/BtNotInterestedMessage.h: New class. * src/BtChokeMessage.h: New class. * src/BtHaveNoneMessage.h: New class. * src/BtHandshakeMessage.h: New class. * src/BtSuggestPieceMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtPieceMessage.h: New class. * src/BtHaveAllMessage.h: New class. * src/BtKeepAliveMessage.h: New class. * src/BtPortMessage.h: New class. * src/BtRejectMessage.h: New class. * src/BtBitfieldMessage.h: New class. * src/BtRequestMessage.h: New class. * src/DefaultBtRequestFactory.h: New class. * src/DefaultBtMessageReceiver.h: New class. * src/BtInteractive.h: New class. * src/BtMessageDispatcher.h: New class. * src/DefaultBtMessageDispatcher.h: New class. * src/DefaultBtInteractive.h: New class. * src/BitfieldManFactory.h: New class. * src/HandleRegistry.h: New class. * src/BtMessageFactory.h: New class. * src/BtMessageReceiver.h: New class. * src/DefaultBtMessageFactory.h: New class. * src/PeerObject.h: New class. * src/BtRequestFactory.h: New class.
2006-12-24 06:25:21 +00:00
#include "BtMessageDispatcher.h"
#include <algorithm>
#include "BtMessage.h"
#include "Piece.h"
namespace aria2 {
2006-12-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten a portion of bittorrent implementation: * src/BtMessageValidator.h: New class. * src/BtBitfieldMessageValidator.h: New class. * src/BtHandshakeMessageValidator.h: New class. * src/BtRequestMessageValidator.h: New class. * src/BtSuggestPieceMessageValidator.h: New class. * src/BtAllowedFastMessageValidator.h: New class. * src/BtRejectMessageValidator.h: New class. * src/BtCancelMessageValidator.h: New class. * src/BtPieceMessageValidator.h: New class. * src/BtHaveMessageValidator.h: New class. * src/BtEventListener.h: New class. * src/AbstractBtEventListener.h: New class. * src/BtEvent.h: New class. * src/BtChokingEvent.h: New class. * src/BtChokedEvent.h: New class. * src/BtCancelSendingPieceEvent.h: New class. * src/BtAbortOutstandingRequestEvent.h: New class. * src/Randomizer.h: New class. * src/SimpleRandomizer.h: New class. * src/BtMessage.h: New class. * src/AbstractBtMessage.h: New class. * src/SimpleBtMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtInterestedMessage.h: New class. * src/BtAllowedFastMessage.h: New class. * src/BtUnchokeMessage.h: New class. * src/BtCancelMessage.h: New class. * src/BtNotInterestedMessage.h: New class. * src/BtChokeMessage.h: New class. * src/BtHaveNoneMessage.h: New class. * src/BtHandshakeMessage.h: New class. * src/BtSuggestPieceMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtPieceMessage.h: New class. * src/BtHaveAllMessage.h: New class. * src/BtKeepAliveMessage.h: New class. * src/BtPortMessage.h: New class. * src/BtRejectMessage.h: New class. * src/BtBitfieldMessage.h: New class. * src/BtRequestMessage.h: New class. * src/DefaultBtRequestFactory.h: New class. * src/DefaultBtMessageReceiver.h: New class. * src/BtInteractive.h: New class. * src/BtMessageDispatcher.h: New class. * src/DefaultBtMessageDispatcher.h: New class. * src/DefaultBtInteractive.h: New class. * src/BitfieldManFactory.h: New class. * src/HandleRegistry.h: New class. * src/BtMessageFactory.h: New class. * src/BtMessageReceiver.h: New class. * src/DefaultBtMessageFactory.h: New class. * src/PeerObject.h: New class. * src/BtRequestFactory.h: New class.
2006-12-24 06:25:21 +00:00
class MockBtMessageDispatcher : public BtMessageDispatcher {
public:
std::deque<std::unique_ptr<BtMessage>> messageQueue;
2006-12-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten a portion of bittorrent implementation: * src/BtMessageValidator.h: New class. * src/BtBitfieldMessageValidator.h: New class. * src/BtHandshakeMessageValidator.h: New class. * src/BtRequestMessageValidator.h: New class. * src/BtSuggestPieceMessageValidator.h: New class. * src/BtAllowedFastMessageValidator.h: New class. * src/BtRejectMessageValidator.h: New class. * src/BtCancelMessageValidator.h: New class. * src/BtPieceMessageValidator.h: New class. * src/BtHaveMessageValidator.h: New class. * src/BtEventListener.h: New class. * src/AbstractBtEventListener.h: New class. * src/BtEvent.h: New class. * src/BtChokingEvent.h: New class. * src/BtChokedEvent.h: New class. * src/BtCancelSendingPieceEvent.h: New class. * src/BtAbortOutstandingRequestEvent.h: New class. * src/Randomizer.h: New class. * src/SimpleRandomizer.h: New class. * src/BtMessage.h: New class. * src/AbstractBtMessage.h: New class. * src/SimpleBtMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtInterestedMessage.h: New class. * src/BtAllowedFastMessage.h: New class. * src/BtUnchokeMessage.h: New class. * src/BtCancelMessage.h: New class. * src/BtNotInterestedMessage.h: New class. * src/BtChokeMessage.h: New class. * src/BtHaveNoneMessage.h: New class. * src/BtHandshakeMessage.h: New class. * src/BtSuggestPieceMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtPieceMessage.h: New class. * src/BtHaveAllMessage.h: New class. * src/BtKeepAliveMessage.h: New class. * src/BtPortMessage.h: New class. * src/BtRejectMessage.h: New class. * src/BtBitfieldMessage.h: New class. * src/BtRequestMessage.h: New class. * src/DefaultBtRequestFactory.h: New class. * src/DefaultBtMessageReceiver.h: New class. * src/BtInteractive.h: New class. * src/BtMessageDispatcher.h: New class. * src/DefaultBtMessageDispatcher.h: New class. * src/DefaultBtInteractive.h: New class. * src/BitfieldManFactory.h: New class. * src/HandleRegistry.h: New class. * src/BtMessageFactory.h: New class. * src/BtMessageReceiver.h: New class. * src/DefaultBtMessageFactory.h: New class. * src/PeerObject.h: New class. * src/BtRequestFactory.h: New class.
2006-12-24 06:25:21 +00:00
virtual ~MockBtMessageDispatcher() {}
2013-07-06 09:15:09 +00:00
virtual void addMessageToQueue(std::unique_ptr<BtMessage> btMessage)
CXX11_OVERRIDE
{
messageQueue.push_back(std::move(btMessage));
2006-12-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten a portion of bittorrent implementation: * src/BtMessageValidator.h: New class. * src/BtBitfieldMessageValidator.h: New class. * src/BtHandshakeMessageValidator.h: New class. * src/BtRequestMessageValidator.h: New class. * src/BtSuggestPieceMessageValidator.h: New class. * src/BtAllowedFastMessageValidator.h: New class. * src/BtRejectMessageValidator.h: New class. * src/BtCancelMessageValidator.h: New class. * src/BtPieceMessageValidator.h: New class. * src/BtHaveMessageValidator.h: New class. * src/BtEventListener.h: New class. * src/AbstractBtEventListener.h: New class. * src/BtEvent.h: New class. * src/BtChokingEvent.h: New class. * src/BtChokedEvent.h: New class. * src/BtCancelSendingPieceEvent.h: New class. * src/BtAbortOutstandingRequestEvent.h: New class. * src/Randomizer.h: New class. * src/SimpleRandomizer.h: New class. * src/BtMessage.h: New class. * src/AbstractBtMessage.h: New class. * src/SimpleBtMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtInterestedMessage.h: New class. * src/BtAllowedFastMessage.h: New class. * src/BtUnchokeMessage.h: New class. * src/BtCancelMessage.h: New class. * src/BtNotInterestedMessage.h: New class. * src/BtChokeMessage.h: New class. * src/BtHaveNoneMessage.h: New class. * src/BtHandshakeMessage.h: New class. * src/BtSuggestPieceMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtPieceMessage.h: New class. * src/BtHaveAllMessage.h: New class. * src/BtKeepAliveMessage.h: New class. * src/BtPortMessage.h: New class. * src/BtRejectMessage.h: New class. * src/BtBitfieldMessage.h: New class. * src/BtRequestMessage.h: New class. * src/DefaultBtRequestFactory.h: New class. * src/DefaultBtMessageReceiver.h: New class. * src/BtInteractive.h: New class. * src/BtMessageDispatcher.h: New class. * src/DefaultBtMessageDispatcher.h: New class. * src/DefaultBtInteractive.h: New class. * src/BitfieldManFactory.h: New class. * src/HandleRegistry.h: New class. * src/BtMessageFactory.h: New class. * src/BtMessageReceiver.h: New class. * src/DefaultBtMessageFactory.h: New class. * src/PeerObject.h: New class. * src/BtRequestFactory.h: New class.
2006-12-24 06:25:21 +00:00
}
2013-07-06 09:15:09 +00:00
virtual void sendMessages() CXX11_OVERRIDE {}
2006-12-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten a portion of bittorrent implementation: * src/BtMessageValidator.h: New class. * src/BtBitfieldMessageValidator.h: New class. * src/BtHandshakeMessageValidator.h: New class. * src/BtRequestMessageValidator.h: New class. * src/BtSuggestPieceMessageValidator.h: New class. * src/BtAllowedFastMessageValidator.h: New class. * src/BtRejectMessageValidator.h: New class. * src/BtCancelMessageValidator.h: New class. * src/BtPieceMessageValidator.h: New class. * src/BtHaveMessageValidator.h: New class. * src/BtEventListener.h: New class. * src/AbstractBtEventListener.h: New class. * src/BtEvent.h: New class. * src/BtChokingEvent.h: New class. * src/BtChokedEvent.h: New class. * src/BtCancelSendingPieceEvent.h: New class. * src/BtAbortOutstandingRequestEvent.h: New class. * src/Randomizer.h: New class. * src/SimpleRandomizer.h: New class. * src/BtMessage.h: New class. * src/AbstractBtMessage.h: New class. * src/SimpleBtMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtInterestedMessage.h: New class. * src/BtAllowedFastMessage.h: New class. * src/BtUnchokeMessage.h: New class. * src/BtCancelMessage.h: New class. * src/BtNotInterestedMessage.h: New class. * src/BtChokeMessage.h: New class. * src/BtHaveNoneMessage.h: New class. * src/BtHandshakeMessage.h: New class. * src/BtSuggestPieceMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtPieceMessage.h: New class. * src/BtHaveAllMessage.h: New class. * src/BtKeepAliveMessage.h: New class. * src/BtPortMessage.h: New class. * src/BtRejectMessage.h: New class. * src/BtBitfieldMessage.h: New class. * src/BtRequestMessage.h: New class. * src/DefaultBtRequestFactory.h: New class. * src/DefaultBtMessageReceiver.h: New class. * src/BtInteractive.h: New class. * src/BtMessageDispatcher.h: New class. * src/DefaultBtMessageDispatcher.h: New class. * src/DefaultBtInteractive.h: New class. * src/BitfieldManFactory.h: New class. * src/HandleRegistry.h: New class. * src/BtMessageFactory.h: New class. * src/BtMessageReceiver.h: New class. * src/DefaultBtMessageFactory.h: New class. * src/PeerObject.h: New class. * src/BtRequestFactory.h: New class.
2006-12-24 06:25:21 +00:00
virtual void doCancelSendingPieceAction
2013-07-06 09:15:09 +00:00
(size_t index, int32_t begin, int32_t length) CXX11_OVERRIDE {}
2006-12-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten a portion of bittorrent implementation: * src/BtMessageValidator.h: New class. * src/BtBitfieldMessageValidator.h: New class. * src/BtHandshakeMessageValidator.h: New class. * src/BtRequestMessageValidator.h: New class. * src/BtSuggestPieceMessageValidator.h: New class. * src/BtAllowedFastMessageValidator.h: New class. * src/BtRejectMessageValidator.h: New class. * src/BtCancelMessageValidator.h: New class. * src/BtPieceMessageValidator.h: New class. * src/BtHaveMessageValidator.h: New class. * src/BtEventListener.h: New class. * src/AbstractBtEventListener.h: New class. * src/BtEvent.h: New class. * src/BtChokingEvent.h: New class. * src/BtChokedEvent.h: New class. * src/BtCancelSendingPieceEvent.h: New class. * src/BtAbortOutstandingRequestEvent.h: New class. * src/Randomizer.h: New class. * src/SimpleRandomizer.h: New class. * src/BtMessage.h: New class. * src/AbstractBtMessage.h: New class. * src/SimpleBtMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtInterestedMessage.h: New class. * src/BtAllowedFastMessage.h: New class. * src/BtUnchokeMessage.h: New class. * src/BtCancelMessage.h: New class. * src/BtNotInterestedMessage.h: New class. * src/BtChokeMessage.h: New class. * src/BtHaveNoneMessage.h: New class. * src/BtHandshakeMessage.h: New class. * src/BtSuggestPieceMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtPieceMessage.h: New class. * src/BtHaveAllMessage.h: New class. * src/BtKeepAliveMessage.h: New class. * src/BtPortMessage.h: New class. * src/BtRejectMessage.h: New class. * src/BtBitfieldMessage.h: New class. * src/BtRequestMessage.h: New class. * src/DefaultBtRequestFactory.h: New class. * src/DefaultBtMessageReceiver.h: New class. * src/BtInteractive.h: New class. * src/BtMessageDispatcher.h: New class. * src/DefaultBtMessageDispatcher.h: New class. * src/DefaultBtInteractive.h: New class. * src/BitfieldManFactory.h: New class. * src/HandleRegistry.h: New class. * src/BtMessageFactory.h: New class. * src/BtMessageReceiver.h: New class. * src/DefaultBtMessageFactory.h: New class. * src/PeerObject.h: New class. * src/BtRequestFactory.h: New class.
2006-12-24 06:25:21 +00:00
2013-07-06 09:15:09 +00:00
virtual void doCancelSendingPieceAction(const std::shared_ptr<Piece>& piece)
CXX11_OVERRIDE
{}
2006-12-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten a portion of bittorrent implementation: * src/BtMessageValidator.h: New class. * src/BtBitfieldMessageValidator.h: New class. * src/BtHandshakeMessageValidator.h: New class. * src/BtRequestMessageValidator.h: New class. * src/BtSuggestPieceMessageValidator.h: New class. * src/BtAllowedFastMessageValidator.h: New class. * src/BtRejectMessageValidator.h: New class. * src/BtCancelMessageValidator.h: New class. * src/BtPieceMessageValidator.h: New class. * src/BtHaveMessageValidator.h: New class. * src/BtEventListener.h: New class. * src/AbstractBtEventListener.h: New class. * src/BtEvent.h: New class. * src/BtChokingEvent.h: New class. * src/BtChokedEvent.h: New class. * src/BtCancelSendingPieceEvent.h: New class. * src/BtAbortOutstandingRequestEvent.h: New class. * src/Randomizer.h: New class. * src/SimpleRandomizer.h: New class. * src/BtMessage.h: New class. * src/AbstractBtMessage.h: New class. * src/SimpleBtMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtInterestedMessage.h: New class. * src/BtAllowedFastMessage.h: New class. * src/BtUnchokeMessage.h: New class. * src/BtCancelMessage.h: New class. * src/BtNotInterestedMessage.h: New class. * src/BtChokeMessage.h: New class. * src/BtHaveNoneMessage.h: New class. * src/BtHandshakeMessage.h: New class. * src/BtSuggestPieceMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtPieceMessage.h: New class. * src/BtHaveAllMessage.h: New class. * src/BtKeepAliveMessage.h: New class. * src/BtPortMessage.h: New class. * src/BtRejectMessage.h: New class. * src/BtBitfieldMessage.h: New class. * src/BtRequestMessage.h: New class. * src/DefaultBtRequestFactory.h: New class. * src/DefaultBtMessageReceiver.h: New class. * src/BtInteractive.h: New class. * src/BtMessageDispatcher.h: New class. * src/DefaultBtMessageDispatcher.h: New class. * src/DefaultBtInteractive.h: New class. * src/BitfieldManFactory.h: New class. * src/HandleRegistry.h: New class. * src/BtMessageFactory.h: New class. * src/BtMessageReceiver.h: New class. * src/DefaultBtMessageFactory.h: New class. * src/PeerObject.h: New class. * src/BtRequestFactory.h: New class.
2006-12-24 06:25:21 +00:00
2013-07-06 09:15:09 +00:00
virtual void doAbortOutstandingRequestAction
(const std::shared_ptr<Piece>& piece) CXX11_OVERRIDE {}
2006-12-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten a portion of bittorrent implementation: * src/BtMessageValidator.h: New class. * src/BtBitfieldMessageValidator.h: New class. * src/BtHandshakeMessageValidator.h: New class. * src/BtRequestMessageValidator.h: New class. * src/BtSuggestPieceMessageValidator.h: New class. * src/BtAllowedFastMessageValidator.h: New class. * src/BtRejectMessageValidator.h: New class. * src/BtCancelMessageValidator.h: New class. * src/BtPieceMessageValidator.h: New class. * src/BtHaveMessageValidator.h: New class. * src/BtEventListener.h: New class. * src/AbstractBtEventListener.h: New class. * src/BtEvent.h: New class. * src/BtChokingEvent.h: New class. * src/BtChokedEvent.h: New class. * src/BtCancelSendingPieceEvent.h: New class. * src/BtAbortOutstandingRequestEvent.h: New class. * src/Randomizer.h: New class. * src/SimpleRandomizer.h: New class. * src/BtMessage.h: New class. * src/AbstractBtMessage.h: New class. * src/SimpleBtMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtInterestedMessage.h: New class. * src/BtAllowedFastMessage.h: New class. * src/BtUnchokeMessage.h: New class. * src/BtCancelMessage.h: New class. * src/BtNotInterestedMessage.h: New class. * src/BtChokeMessage.h: New class. * src/BtHaveNoneMessage.h: New class. * src/BtHandshakeMessage.h: New class. * src/BtSuggestPieceMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtPieceMessage.h: New class. * src/BtHaveAllMessage.h: New class. * src/BtKeepAliveMessage.h: New class. * src/BtPortMessage.h: New class. * src/BtRejectMessage.h: New class. * src/BtBitfieldMessage.h: New class. * src/BtRequestMessage.h: New class. * src/DefaultBtRequestFactory.h: New class. * src/DefaultBtMessageReceiver.h: New class. * src/BtInteractive.h: New class. * src/BtMessageDispatcher.h: New class. * src/DefaultBtMessageDispatcher.h: New class. * src/DefaultBtInteractive.h: New class. * src/BitfieldManFactory.h: New class. * src/HandleRegistry.h: New class. * src/BtMessageFactory.h: New class. * src/BtMessageReceiver.h: New class. * src/DefaultBtMessageFactory.h: New class. * src/PeerObject.h: New class. * src/BtRequestFactory.h: New class.
2006-12-24 06:25:21 +00:00
2013-07-06 09:15:09 +00:00
virtual void doChokedAction() CXX11_OVERRIDE {}
2006-12-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten a portion of bittorrent implementation: * src/BtMessageValidator.h: New class. * src/BtBitfieldMessageValidator.h: New class. * src/BtHandshakeMessageValidator.h: New class. * src/BtRequestMessageValidator.h: New class. * src/BtSuggestPieceMessageValidator.h: New class. * src/BtAllowedFastMessageValidator.h: New class. * src/BtRejectMessageValidator.h: New class. * src/BtCancelMessageValidator.h: New class. * src/BtPieceMessageValidator.h: New class. * src/BtHaveMessageValidator.h: New class. * src/BtEventListener.h: New class. * src/AbstractBtEventListener.h: New class. * src/BtEvent.h: New class. * src/BtChokingEvent.h: New class. * src/BtChokedEvent.h: New class. * src/BtCancelSendingPieceEvent.h: New class. * src/BtAbortOutstandingRequestEvent.h: New class. * src/Randomizer.h: New class. * src/SimpleRandomizer.h: New class. * src/BtMessage.h: New class. * src/AbstractBtMessage.h: New class. * src/SimpleBtMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtInterestedMessage.h: New class. * src/BtAllowedFastMessage.h: New class. * src/BtUnchokeMessage.h: New class. * src/BtCancelMessage.h: New class. * src/BtNotInterestedMessage.h: New class. * src/BtChokeMessage.h: New class. * src/BtHaveNoneMessage.h: New class. * src/BtHandshakeMessage.h: New class. * src/BtSuggestPieceMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtPieceMessage.h: New class. * src/BtHaveAllMessage.h: New class. * src/BtKeepAliveMessage.h: New class. * src/BtPortMessage.h: New class. * src/BtRejectMessage.h: New class. * src/BtBitfieldMessage.h: New class. * src/BtRequestMessage.h: New class. * src/DefaultBtRequestFactory.h: New class. * src/DefaultBtMessageReceiver.h: New class. * src/BtInteractive.h: New class. * src/BtMessageDispatcher.h: New class. * src/DefaultBtMessageDispatcher.h: New class. * src/DefaultBtInteractive.h: New class. * src/BitfieldManFactory.h: New class. * src/HandleRegistry.h: New class. * src/BtMessageFactory.h: New class. * src/BtMessageReceiver.h: New class. * src/DefaultBtMessageFactory.h: New class. * src/PeerObject.h: New class. * src/BtRequestFactory.h: New class.
2006-12-24 06:25:21 +00:00
2013-07-06 09:15:09 +00:00
virtual void doChokingAction() CXX11_OVERRIDE {}
2006-12-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten a portion of bittorrent implementation: * src/BtMessageValidator.h: New class. * src/BtBitfieldMessageValidator.h: New class. * src/BtHandshakeMessageValidator.h: New class. * src/BtRequestMessageValidator.h: New class. * src/BtSuggestPieceMessageValidator.h: New class. * src/BtAllowedFastMessageValidator.h: New class. * src/BtRejectMessageValidator.h: New class. * src/BtCancelMessageValidator.h: New class. * src/BtPieceMessageValidator.h: New class. * src/BtHaveMessageValidator.h: New class. * src/BtEventListener.h: New class. * src/AbstractBtEventListener.h: New class. * src/BtEvent.h: New class. * src/BtChokingEvent.h: New class. * src/BtChokedEvent.h: New class. * src/BtCancelSendingPieceEvent.h: New class. * src/BtAbortOutstandingRequestEvent.h: New class. * src/Randomizer.h: New class. * src/SimpleRandomizer.h: New class. * src/BtMessage.h: New class. * src/AbstractBtMessage.h: New class. * src/SimpleBtMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtInterestedMessage.h: New class. * src/BtAllowedFastMessage.h: New class. * src/BtUnchokeMessage.h: New class. * src/BtCancelMessage.h: New class. * src/BtNotInterestedMessage.h: New class. * src/BtChokeMessage.h: New class. * src/BtHaveNoneMessage.h: New class. * src/BtHandshakeMessage.h: New class. * src/BtSuggestPieceMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtPieceMessage.h: New class. * src/BtHaveAllMessage.h: New class. * src/BtKeepAliveMessage.h: New class. * src/BtPortMessage.h: New class. * src/BtRejectMessage.h: New class. * src/BtBitfieldMessage.h: New class. * src/BtRequestMessage.h: New class. * src/DefaultBtRequestFactory.h: New class. * src/DefaultBtMessageReceiver.h: New class. * src/BtInteractive.h: New class. * src/BtMessageDispatcher.h: New class. * src/DefaultBtMessageDispatcher.h: New class. * src/DefaultBtInteractive.h: New class. * src/BitfieldManFactory.h: New class. * src/HandleRegistry.h: New class. * src/BtMessageFactory.h: New class. * src/BtMessageReceiver.h: New class. * src/DefaultBtMessageFactory.h: New class. * src/PeerObject.h: New class. * src/BtRequestFactory.h: New class.
2006-12-24 06:25:21 +00:00
2013-07-06 09:15:09 +00:00
virtual void checkRequestSlotAndDoNecessaryThing() CXX11_OVERRIDE {}
2006-12-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten a portion of bittorrent implementation: * src/BtMessageValidator.h: New class. * src/BtBitfieldMessageValidator.h: New class. * src/BtHandshakeMessageValidator.h: New class. * src/BtRequestMessageValidator.h: New class. * src/BtSuggestPieceMessageValidator.h: New class. * src/BtAllowedFastMessageValidator.h: New class. * src/BtRejectMessageValidator.h: New class. * src/BtCancelMessageValidator.h: New class. * src/BtPieceMessageValidator.h: New class. * src/BtHaveMessageValidator.h: New class. * src/BtEventListener.h: New class. * src/AbstractBtEventListener.h: New class. * src/BtEvent.h: New class. * src/BtChokingEvent.h: New class. * src/BtChokedEvent.h: New class. * src/BtCancelSendingPieceEvent.h: New class. * src/BtAbortOutstandingRequestEvent.h: New class. * src/Randomizer.h: New class. * src/SimpleRandomizer.h: New class. * src/BtMessage.h: New class. * src/AbstractBtMessage.h: New class. * src/SimpleBtMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtInterestedMessage.h: New class. * src/BtAllowedFastMessage.h: New class. * src/BtUnchokeMessage.h: New class. * src/BtCancelMessage.h: New class. * src/BtNotInterestedMessage.h: New class. * src/BtChokeMessage.h: New class. * src/BtHaveNoneMessage.h: New class. * src/BtHandshakeMessage.h: New class. * src/BtSuggestPieceMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtPieceMessage.h: New class. * src/BtHaveAllMessage.h: New class. * src/BtKeepAliveMessage.h: New class. * src/BtPortMessage.h: New class. * src/BtRejectMessage.h: New class. * src/BtBitfieldMessage.h: New class. * src/BtRequestMessage.h: New class. * src/DefaultBtRequestFactory.h: New class. * src/DefaultBtMessageReceiver.h: New class. * src/BtInteractive.h: New class. * src/BtMessageDispatcher.h: New class. * src/DefaultBtMessageDispatcher.h: New class. * src/DefaultBtInteractive.h: New class. * src/BitfieldManFactory.h: New class. * src/HandleRegistry.h: New class. * src/BtMessageFactory.h: New class. * src/BtMessageReceiver.h: New class. * src/DefaultBtMessageFactory.h: New class. * src/PeerObject.h: New class. * src/BtRequestFactory.h: New class.
2006-12-24 06:25:21 +00:00
2013-07-06 09:15:09 +00:00
virtual bool isSendingInProgress() CXX11_OVERRIDE {
2006-12-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten a portion of bittorrent implementation: * src/BtMessageValidator.h: New class. * src/BtBitfieldMessageValidator.h: New class. * src/BtHandshakeMessageValidator.h: New class. * src/BtRequestMessageValidator.h: New class. * src/BtSuggestPieceMessageValidator.h: New class. * src/BtAllowedFastMessageValidator.h: New class. * src/BtRejectMessageValidator.h: New class. * src/BtCancelMessageValidator.h: New class. * src/BtPieceMessageValidator.h: New class. * src/BtHaveMessageValidator.h: New class. * src/BtEventListener.h: New class. * src/AbstractBtEventListener.h: New class. * src/BtEvent.h: New class. * src/BtChokingEvent.h: New class. * src/BtChokedEvent.h: New class. * src/BtCancelSendingPieceEvent.h: New class. * src/BtAbortOutstandingRequestEvent.h: New class. * src/Randomizer.h: New class. * src/SimpleRandomizer.h: New class. * src/BtMessage.h: New class. * src/AbstractBtMessage.h: New class. * src/SimpleBtMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtInterestedMessage.h: New class. * src/BtAllowedFastMessage.h: New class. * src/BtUnchokeMessage.h: New class. * src/BtCancelMessage.h: New class. * src/BtNotInterestedMessage.h: New class. * src/BtChokeMessage.h: New class. * src/BtHaveNoneMessage.h: New class. * src/BtHandshakeMessage.h: New class. * src/BtSuggestPieceMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtPieceMessage.h: New class. * src/BtHaveAllMessage.h: New class. * src/BtKeepAliveMessage.h: New class. * src/BtPortMessage.h: New class. * src/BtRejectMessage.h: New class. * src/BtBitfieldMessage.h: New class. * src/BtRequestMessage.h: New class. * src/DefaultBtRequestFactory.h: New class. * src/DefaultBtMessageReceiver.h: New class. * src/BtInteractive.h: New class. * src/BtMessageDispatcher.h: New class. * src/DefaultBtMessageDispatcher.h: New class. * src/DefaultBtInteractive.h: New class. * src/BitfieldManFactory.h: New class. * src/HandleRegistry.h: New class. * src/BtMessageFactory.h: New class. * src/BtMessageReceiver.h: New class. * src/DefaultBtMessageFactory.h: New class. * src/PeerObject.h: New class. * src/BtRequestFactory.h: New class.
2006-12-24 06:25:21 +00:00
return false;
}
2013-07-06 09:15:09 +00:00
virtual size_t countMessageInQueue() CXX11_OVERRIDE {
2006-12-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten a portion of bittorrent implementation: * src/BtMessageValidator.h: New class. * src/BtBitfieldMessageValidator.h: New class. * src/BtHandshakeMessageValidator.h: New class. * src/BtRequestMessageValidator.h: New class. * src/BtSuggestPieceMessageValidator.h: New class. * src/BtAllowedFastMessageValidator.h: New class. * src/BtRejectMessageValidator.h: New class. * src/BtCancelMessageValidator.h: New class. * src/BtPieceMessageValidator.h: New class. * src/BtHaveMessageValidator.h: New class. * src/BtEventListener.h: New class. * src/AbstractBtEventListener.h: New class. * src/BtEvent.h: New class. * src/BtChokingEvent.h: New class. * src/BtChokedEvent.h: New class. * src/BtCancelSendingPieceEvent.h: New class. * src/BtAbortOutstandingRequestEvent.h: New class. * src/Randomizer.h: New class. * src/SimpleRandomizer.h: New class. * src/BtMessage.h: New class. * src/AbstractBtMessage.h: New class. * src/SimpleBtMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtInterestedMessage.h: New class. * src/BtAllowedFastMessage.h: New class. * src/BtUnchokeMessage.h: New class. * src/BtCancelMessage.h: New class. * src/BtNotInterestedMessage.h: New class. * src/BtChokeMessage.h: New class. * src/BtHaveNoneMessage.h: New class. * src/BtHandshakeMessage.h: New class. * src/BtSuggestPieceMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtPieceMessage.h: New class. * src/BtHaveAllMessage.h: New class. * src/BtKeepAliveMessage.h: New class. * src/BtPortMessage.h: New class. * src/BtRejectMessage.h: New class. * src/BtBitfieldMessage.h: New class. * src/BtRequestMessage.h: New class. * src/DefaultBtRequestFactory.h: New class. * src/DefaultBtMessageReceiver.h: New class. * src/BtInteractive.h: New class. * src/BtMessageDispatcher.h: New class. * src/DefaultBtMessageDispatcher.h: New class. * src/DefaultBtInteractive.h: New class. * src/BitfieldManFactory.h: New class. * src/HandleRegistry.h: New class. * src/BtMessageFactory.h: New class. * src/BtMessageReceiver.h: New class. * src/DefaultBtMessageFactory.h: New class. * src/PeerObject.h: New class. * src/BtRequestFactory.h: New class.
2006-12-24 06:25:21 +00:00
return messageQueue.size();
}
2013-07-06 09:15:09 +00:00
virtual size_t countOutstandingRequest() CXX11_OVERRIDE {
2006-12-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten a portion of bittorrent implementation: * src/BtMessageValidator.h: New class. * src/BtBitfieldMessageValidator.h: New class. * src/BtHandshakeMessageValidator.h: New class. * src/BtRequestMessageValidator.h: New class. * src/BtSuggestPieceMessageValidator.h: New class. * src/BtAllowedFastMessageValidator.h: New class. * src/BtRejectMessageValidator.h: New class. * src/BtCancelMessageValidator.h: New class. * src/BtPieceMessageValidator.h: New class. * src/BtHaveMessageValidator.h: New class. * src/BtEventListener.h: New class. * src/AbstractBtEventListener.h: New class. * src/BtEvent.h: New class. * src/BtChokingEvent.h: New class. * src/BtChokedEvent.h: New class. * src/BtCancelSendingPieceEvent.h: New class. * src/BtAbortOutstandingRequestEvent.h: New class. * src/Randomizer.h: New class. * src/SimpleRandomizer.h: New class. * src/BtMessage.h: New class. * src/AbstractBtMessage.h: New class. * src/SimpleBtMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtInterestedMessage.h: New class. * src/BtAllowedFastMessage.h: New class. * src/BtUnchokeMessage.h: New class. * src/BtCancelMessage.h: New class. * src/BtNotInterestedMessage.h: New class. * src/BtChokeMessage.h: New class. * src/BtHaveNoneMessage.h: New class. * src/BtHandshakeMessage.h: New class. * src/BtSuggestPieceMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtPieceMessage.h: New class. * src/BtHaveAllMessage.h: New class. * src/BtKeepAliveMessage.h: New class. * src/BtPortMessage.h: New class. * src/BtRejectMessage.h: New class. * src/BtBitfieldMessage.h: New class. * src/BtRequestMessage.h: New class. * src/DefaultBtRequestFactory.h: New class. * src/DefaultBtMessageReceiver.h: New class. * src/BtInteractive.h: New class. * src/BtMessageDispatcher.h: New class. * src/DefaultBtMessageDispatcher.h: New class. * src/DefaultBtInteractive.h: New class. * src/BitfieldManFactory.h: New class. * src/HandleRegistry.h: New class. * src/BtMessageFactory.h: New class. * src/BtMessageReceiver.h: New class. * src/DefaultBtMessageFactory.h: New class. * src/PeerObject.h: New class. * src/BtRequestFactory.h: New class.
2006-12-24 06:25:21 +00:00
return 0;
}
2013-07-06 09:15:09 +00:00
virtual bool isOutstandingRequest(size_t index, size_t blockIndex)
CXX11_OVERRIDE
{
2006-12-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten a portion of bittorrent implementation: * src/BtMessageValidator.h: New class. * src/BtBitfieldMessageValidator.h: New class. * src/BtHandshakeMessageValidator.h: New class. * src/BtRequestMessageValidator.h: New class. * src/BtSuggestPieceMessageValidator.h: New class. * src/BtAllowedFastMessageValidator.h: New class. * src/BtRejectMessageValidator.h: New class. * src/BtCancelMessageValidator.h: New class. * src/BtPieceMessageValidator.h: New class. * src/BtHaveMessageValidator.h: New class. * src/BtEventListener.h: New class. * src/AbstractBtEventListener.h: New class. * src/BtEvent.h: New class. * src/BtChokingEvent.h: New class. * src/BtChokedEvent.h: New class. * src/BtCancelSendingPieceEvent.h: New class. * src/BtAbortOutstandingRequestEvent.h: New class. * src/Randomizer.h: New class. * src/SimpleRandomizer.h: New class. * src/BtMessage.h: New class. * src/AbstractBtMessage.h: New class. * src/SimpleBtMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtInterestedMessage.h: New class. * src/BtAllowedFastMessage.h: New class. * src/BtUnchokeMessage.h: New class. * src/BtCancelMessage.h: New class. * src/BtNotInterestedMessage.h: New class. * src/BtChokeMessage.h: New class. * src/BtHaveNoneMessage.h: New class. * src/BtHandshakeMessage.h: New class. * src/BtSuggestPieceMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtPieceMessage.h: New class. * src/BtHaveAllMessage.h: New class. * src/BtKeepAliveMessage.h: New class. * src/BtPortMessage.h: New class. * src/BtRejectMessage.h: New class. * src/BtBitfieldMessage.h: New class. * src/BtRequestMessage.h: New class. * src/DefaultBtRequestFactory.h: New class. * src/DefaultBtMessageReceiver.h: New class. * src/BtInteractive.h: New class. * src/BtMessageDispatcher.h: New class. * src/DefaultBtMessageDispatcher.h: New class. * src/DefaultBtInteractive.h: New class. * src/BitfieldManFactory.h: New class. * src/HandleRegistry.h: New class. * src/BtMessageFactory.h: New class. * src/BtMessageReceiver.h: New class. * src/DefaultBtMessageFactory.h: New class. * src/PeerObject.h: New class. * src/BtRequestFactory.h: New class.
2006-12-24 06:25:21 +00:00
return false;
}
virtual const RequestSlot* getOutstandingRequest
2013-07-06 09:15:09 +00:00
(size_t index, int32_t begin, int32_t length) CXX11_OVERRIDE
{
return nullptr;
2006-12-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten a portion of bittorrent implementation: * src/BtMessageValidator.h: New class. * src/BtBitfieldMessageValidator.h: New class. * src/BtHandshakeMessageValidator.h: New class. * src/BtRequestMessageValidator.h: New class. * src/BtSuggestPieceMessageValidator.h: New class. * src/BtAllowedFastMessageValidator.h: New class. * src/BtRejectMessageValidator.h: New class. * src/BtCancelMessageValidator.h: New class. * src/BtPieceMessageValidator.h: New class. * src/BtHaveMessageValidator.h: New class. * src/BtEventListener.h: New class. * src/AbstractBtEventListener.h: New class. * src/BtEvent.h: New class. * src/BtChokingEvent.h: New class. * src/BtChokedEvent.h: New class. * src/BtCancelSendingPieceEvent.h: New class. * src/BtAbortOutstandingRequestEvent.h: New class. * src/Randomizer.h: New class. * src/SimpleRandomizer.h: New class. * src/BtMessage.h: New class. * src/AbstractBtMessage.h: New class. * src/SimpleBtMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtInterestedMessage.h: New class. * src/BtAllowedFastMessage.h: New class. * src/BtUnchokeMessage.h: New class. * src/BtCancelMessage.h: New class. * src/BtNotInterestedMessage.h: New class. * src/BtChokeMessage.h: New class. * src/BtHaveNoneMessage.h: New class. * src/BtHandshakeMessage.h: New class. * src/BtSuggestPieceMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtPieceMessage.h: New class. * src/BtHaveAllMessage.h: New class. * src/BtKeepAliveMessage.h: New class. * src/BtPortMessage.h: New class. * src/BtRejectMessage.h: New class. * src/BtBitfieldMessage.h: New class. * src/BtRequestMessage.h: New class. * src/DefaultBtRequestFactory.h: New class. * src/DefaultBtMessageReceiver.h: New class. * src/BtInteractive.h: New class. * src/BtMessageDispatcher.h: New class. * src/DefaultBtMessageDispatcher.h: New class. * src/DefaultBtInteractive.h: New class. * src/BitfieldManFactory.h: New class. * src/HandleRegistry.h: New class. * src/BtMessageFactory.h: New class. * src/BtMessageReceiver.h: New class. * src/DefaultBtMessageFactory.h: New class. * src/PeerObject.h: New class. * src/BtRequestFactory.h: New class.
2006-12-24 06:25:21 +00:00
}
2013-07-06 09:15:09 +00:00
virtual void removeOutstandingRequest(const RequestSlot* slot)
CXX11_OVERRIDE
{}
2012-10-01 14:52:22 +00:00
2013-07-06 09:15:09 +00:00
virtual void addOutstandingRequest(std::unique_ptr<RequestSlot> slot)
CXX11_OVERRIDE
{}
2013-07-06 09:15:09 +00:00
virtual size_t countOutstandingUpload() CXX11_OVERRIDE
{
return 0;
}
2006-12-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten a portion of bittorrent implementation: * src/BtMessageValidator.h: New class. * src/BtBitfieldMessageValidator.h: New class. * src/BtHandshakeMessageValidator.h: New class. * src/BtRequestMessageValidator.h: New class. * src/BtSuggestPieceMessageValidator.h: New class. * src/BtAllowedFastMessageValidator.h: New class. * src/BtRejectMessageValidator.h: New class. * src/BtCancelMessageValidator.h: New class. * src/BtPieceMessageValidator.h: New class. * src/BtHaveMessageValidator.h: New class. * src/BtEventListener.h: New class. * src/AbstractBtEventListener.h: New class. * src/BtEvent.h: New class. * src/BtChokingEvent.h: New class. * src/BtChokedEvent.h: New class. * src/BtCancelSendingPieceEvent.h: New class. * src/BtAbortOutstandingRequestEvent.h: New class. * src/Randomizer.h: New class. * src/SimpleRandomizer.h: New class. * src/BtMessage.h: New class. * src/AbstractBtMessage.h: New class. * src/SimpleBtMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtInterestedMessage.h: New class. * src/BtAllowedFastMessage.h: New class. * src/BtUnchokeMessage.h: New class. * src/BtCancelMessage.h: New class. * src/BtNotInterestedMessage.h: New class. * src/BtChokeMessage.h: New class. * src/BtHaveNoneMessage.h: New class. * src/BtHandshakeMessage.h: New class. * src/BtSuggestPieceMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtPieceMessage.h: New class. * src/BtHaveAllMessage.h: New class. * src/BtKeepAliveMessage.h: New class. * src/BtPortMessage.h: New class. * src/BtRejectMessage.h: New class. * src/BtBitfieldMessage.h: New class. * src/BtRequestMessage.h: New class. * src/DefaultBtRequestFactory.h: New class. * src/DefaultBtMessageReceiver.h: New class. * src/BtInteractive.h: New class. * src/BtMessageDispatcher.h: New class. * src/DefaultBtMessageDispatcher.h: New class. * src/DefaultBtInteractive.h: New class. * src/BitfieldManFactory.h: New class. * src/HandleRegistry.h: New class. * src/BtMessageFactory.h: New class. * src/BtMessageReceiver.h: New class. * src/DefaultBtMessageFactory.h: New class. * src/PeerObject.h: New class. * src/BtRequestFactory.h: New class.
2006-12-24 06:25:21 +00:00
};
} // namespace aria2
2006-12-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten a portion of bittorrent implementation: * src/BtMessageValidator.h: New class. * src/BtBitfieldMessageValidator.h: New class. * src/BtHandshakeMessageValidator.h: New class. * src/BtRequestMessageValidator.h: New class. * src/BtSuggestPieceMessageValidator.h: New class. * src/BtAllowedFastMessageValidator.h: New class. * src/BtRejectMessageValidator.h: New class. * src/BtCancelMessageValidator.h: New class. * src/BtPieceMessageValidator.h: New class. * src/BtHaveMessageValidator.h: New class. * src/BtEventListener.h: New class. * src/AbstractBtEventListener.h: New class. * src/BtEvent.h: New class. * src/BtChokingEvent.h: New class. * src/BtChokedEvent.h: New class. * src/BtCancelSendingPieceEvent.h: New class. * src/BtAbortOutstandingRequestEvent.h: New class. * src/Randomizer.h: New class. * src/SimpleRandomizer.h: New class. * src/BtMessage.h: New class. * src/AbstractBtMessage.h: New class. * src/SimpleBtMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtInterestedMessage.h: New class. * src/BtAllowedFastMessage.h: New class. * src/BtUnchokeMessage.h: New class. * src/BtCancelMessage.h: New class. * src/BtNotInterestedMessage.h: New class. * src/BtChokeMessage.h: New class. * src/BtHaveNoneMessage.h: New class. * src/BtHandshakeMessage.h: New class. * src/BtSuggestPieceMessage.h: New class. * src/BtHaveMessage.h: New class. * src/BtPieceMessage.h: New class. * src/BtHaveAllMessage.h: New class. * src/BtKeepAliveMessage.h: New class. * src/BtPortMessage.h: New class. * src/BtRejectMessage.h: New class. * src/BtBitfieldMessage.h: New class. * src/BtRequestMessage.h: New class. * src/DefaultBtRequestFactory.h: New class. * src/DefaultBtMessageReceiver.h: New class. * src/BtInteractive.h: New class. * src/BtMessageDispatcher.h: New class. * src/DefaultBtMessageDispatcher.h: New class. * src/DefaultBtInteractive.h: New class. * src/BitfieldManFactory.h: New class. * src/HandleRegistry.h: New class. * src/BtMessageFactory.h: New class. * src/BtMessageReceiver.h: New class. * src/DefaultBtMessageFactory.h: New class. * src/PeerObject.h: New class. * src/BtRequestFactory.h: New class.
2006-12-24 06:25:21 +00:00
#endif // D_MOCK_BT_MESSAGE_DISPATCHER_H