/* */ #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 const 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 void computeFastSet (std::deque& fastSet, const std::string& ipaddr, size_t fastSetSize) = 0; virtual RequestGroup* getOwnerRequestGroup() = 0; virtual std::deque >& getNodes() = 0; static const std::string C_NAME; static const std::string C_FILES; static const std::string C_LENGTH; static const std::string C_PATH; static const std::string C_INFO; static const std::string C_PIECES; static const std::string C_PIECE_LENGTH; static const std::string C_PRIVATE; // This is just a string "1". Used as a value of "private" flag. static const std::string C_PRIVATE_ON; static const std::string C_URL_LIST; static const std::string C_ANNOUNCE; static const std::string C_ANNOUNCE_LIST; static const std::string C_NODES; }; class BtContext; typedef SharedHandle BtContextHandle; } // namespace aria2 #endif // _D_BT_CONTEXT_H_