mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 13:37:40 +03:00
Made protected member variable private. Added accessor funcs. * src/DHTAbstractMessage.cc * src/DHTAbstractMessage.h * src/DHTAnnouncePeerMessage.cc * src/DHTAnnouncePeerMessage.h * src/DHTAnnouncePeerReplyMessage.cc * src/DHTAnnouncePeerReplyMessage.h * src/DHTFindNodeMessage.cc * src/DHTFindNodeMessage.h * src/DHTFindNodeReplyMessage.cc * src/DHTFindNodeReplyMessage.h * src/DHTGetPeersMessage.cc * src/DHTGetPeersMessage.h * src/DHTGetPeersReplyMessage.cc * src/DHTGetPeersReplyMessage.h * src/DHTMessage.h * src/DHTPingMessage.cc * src/DHTPingMessage.h * src/DHTPingReplyMessage.cc * src/DHTPingReplyMessage.h * src/DHTQueryMessage.cc * src/DHTQueryMessage.h * src/DHTResponseMessage.cc * src/DHTResponseMessage.h * src/DHTUnknownMessage.cc * src/DHTUnknownMessage.h * test/MockDHTMessage.h
48 lines
1.1 KiB
C++
48 lines
1.1 KiB
C++
#ifndef _D_MOCK_DHT_MESSAGE_H_
|
|
#define _D_MOCK_DHT_MESSAGE_H_
|
|
|
|
#include "DHTMessage.h"
|
|
|
|
#include <deque>
|
|
|
|
#include "DHTNode.h"
|
|
#include "Peer.h"
|
|
|
|
namespace aria2 {
|
|
|
|
class MockDHTMessage:public DHTMessage {
|
|
public:
|
|
bool _isReply;
|
|
|
|
std::string _messageType;
|
|
|
|
std::vector<SharedHandle<DHTNode> > _nodes;
|
|
|
|
std::vector<SharedHandle<Peer> > _peers;
|
|
|
|
std::string _token;
|
|
public:
|
|
MockDHTMessage(const SharedHandle<DHTNode>& localNode,
|
|
const SharedHandle<DHTNode>& remoteNode,
|
|
const std::string& messageType = "mock",
|
|
const std::string& transactionID = ""):
|
|
DHTMessage(localNode, remoteNode, transactionID), _isReply(false), _messageType(messageType) {}
|
|
|
|
virtual ~MockDHTMessage() {}
|
|
|
|
virtual void doReceivedAction() {}
|
|
|
|
virtual bool send() { return true; }
|
|
|
|
virtual bool isReply() const { return _isReply; }
|
|
|
|
void setReply(bool f) { _isReply = f; }
|
|
|
|
virtual const std::string& getMessageType() const { return _messageType; }
|
|
|
|
virtual std::string toString() const { return "MockDHTMessage"; }
|
|
};
|
|
|
|
} // namespace aria2
|
|
|
|
#endif // _D_MOCK_DHT_MESSAGE_H_
|