/* */ #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: DHTConnection* connection_; DHTMessageDispatcher* dispatcher_; DHTMessageFactory* factory_; DHTRoutingTable* routingTable_; public: DHTAbstractMessage(const std::shared_ptr& localNode, const std::shared_ptr& remoteNode, const std::string& transactionID = A2STR::NIL); virtual bool send() CXX11_OVERRIDE; virtual const std::string& getType() const = 0; virtual void fillMessage(Dict* msgDict) = 0; std::string getBencodedMessage(); DHTConnection* getConnection() const { return connection_; } void setConnection(DHTConnection* connection); DHTMessageDispatcher* getMessageDispatcher() const { return dispatcher_; } void setMessageDispatcher(DHTMessageDispatcher* dispatcher); DHTMessageFactory* getMessageFactory() const { return factory_; } void setMessageFactory(DHTMessageFactory* factory); DHTRoutingTable* getRoutingTable() const { return routingTable_; } void setRoutingTable(DHTRoutingTable* routingTable); }; } // namespace aria2 #endif // D_DHT_ABSTRACT_MESSAGE_H