/* */ #ifndef _D_BT_CONTEXT_H_ #define _D_BT_CONTEXT_H_ #include "DownloadContext.h" #define INFO_HASH_LENGTH 20 #define MAX_PEER_ERROR 5 #define MAX_PEERS 55 class AnnounceTier; typedef SharedHandle AnnounceTierHandle; typedef deque AnnounceTiers; class RequestGroup; class BtContext:public DownloadContext { public: virtual ~BtContext() {} virtual const unsigned char* getInfoHash() const = 0; virtual int32_t getInfoHashLength() const = 0; virtual string getInfoHashAsString() const = 0; virtual AnnounceTiers getAnnounceTiers() const = 0; virtual void load(const string& torrentFile) = 0; /** * Returns the peer id of localhost, 20 byte length */ virtual const unsigned char* getPeerId() = 0; virtual Integers computeFastSet(const string& ipaddr, int32_t fastSetSize) = 0; virtual RequestGroup* getOwnerRequestGroup() = 0; }; typedef SharedHandle BtContextHandle; #endif // _D_BT_CONTEXT_H_