/* */ #ifndef _D_DHT_ABSTRACT_MESSAGE_H_ #define _D_DHT_ABSTRACT_MESSAGE_H_ #include "DHTMessage.h" #include "A2STR.h" #include "ValueBase.h" namespace aria2 { class DHTConnection; class DHTMessageDispatcher; class DHTMessageFactory; class DHTRoutingTable; class DHTAbstractMessage:public DHTMessage { private: WeakHandle connection_; WeakHandle dispatcher_; WeakHandle factory_; WeakHandle routingTable_; public: DHTAbstractMessage(const SharedHandle& localNode, const SharedHandle& remoteNode, const std::string& transactionID = A2STR::NIL); virtual ~DHTAbstractMessage(); virtual bool send(); virtual const std::string& getType() const = 0; virtual void fillMessage(Dict* msgDict) = 0; std::string getBencodedMessage(); const WeakHandle& getConnection() const { return connection_; } void setConnection(const WeakHandle& connection); const WeakHandle& getMessageDispatcher() const { return dispatcher_; } void setMessageDispatcher(const WeakHandle& dispatcher); const WeakHandle& getMessageFactory() const { return factory_; } void setMessageFactory(const WeakHandle& factory); const WeakHandle& getRoutingTable() const { return routingTable_; } void setRoutingTable(const WeakHandle& routingTable); }; } // namespace aria2 #endif // _D_DHT_ABSTRACT_MESSAGE_H_