/* */ #include "AbstractBtMessage.h" #include "Peer.h" #include "PieceStorage.h" #include "BtMessageValidator.h" #include "LogFactory.h" #include "Logger.h" namespace aria2 { AbstractBtMessage::AbstractBtMessage(uint8_t id, const std::string& name): BtMessage(id), _sendingInProgress(false), _invalidate(false), _uploading(false), _cuid(0), _name(name), _metadataGetMode(false), _logger(LogFactory::getInstance()) {} AbstractBtMessage::~AbstractBtMessage() {} void AbstractBtMessage::setPeer(const SharedHandle& peer) { _peer = peer; } void AbstractBtMessage::validate() { if(!_validator.isNull()) { _validator->validate(); } } void AbstractBtMessage::setBtMessageValidator(const SharedHandle& validator) { _validator = validator; } void AbstractBtMessage::setPieceStorage (const SharedHandle& pieceStorage) { _pieceStorage = pieceStorage; } void AbstractBtMessage::setBtMessageDispatcher (const WeakHandle& dispatcher) { _dispatcher = dispatcher; } void AbstractBtMessage::setPeerConnection(const WeakHandle& peerConnection) { _peerConnection = peerConnection; } void AbstractBtMessage::setBtMessageFactory(const WeakHandle& factory) { _messageFactory = factory; } void AbstractBtMessage::setBtRequestFactory(const WeakHandle& factory) { _requestFactory = factory; } } // namespace aria2