/* */ #ifndef _D_BT_CONTEXT_H_ #define _D_BT_CONTEXT_H_ #include "DownloadContext.h" #include #include namespace aria2 { class AnnounceTier; class RequestGroup; class BtContext:public DownloadContext { protected: bool _private; public: BtContext():_private(false) {} virtual ~BtContext() {} virtual const unsigned char* getInfoHash() const = 0; virtual size_t getInfoHashLength() const = 0; virtual std::string getInfoHashAsString() const = 0; virtual std::deque > getAnnounceTiers() const = 0; virtual void load(const std::string& torrentFile) = 0; /** * Returns the peer id of localhost, 20 byte length */ virtual const unsigned char* getPeerId() = 0; bool isPrivate() const { return _private; } virtual std::deque computeFastSet(const std::string& ipaddr, size_t fastSetSize) = 0; virtual RequestGroup* getOwnerRequestGroup() = 0; virtual std::deque >& getNodes() = 0; }; class BtContext; typedef SharedHandle BtContextHandle; } // namespace aria2 #endif // _D_BT_CONTEXT_H_