fixed build issue on msvc

This commit is contained in:
Arvid Norberg 2008-01-27 21:03:33 +00:00
parent d5d769f67d
commit 5527a8e9b1
5 changed files with 8 additions and 11 deletions

View File

@ -206,7 +206,7 @@ struct bandwidth_manager
++i->priority; ++i->priority;
++i; ++i;
} }
m_queue.insert(i.base(), bw_queue_entry<PeerConnection>(peer, blk, priority)); m_queue.insert(i.base(), bw_queue_entry<PeerConnection, Torrent>(peer, blk, priority));
if (!m_queue.empty()) hand_out_bandwidth(l); if (!m_queue.empty()) hand_out_bandwidth(l);
} }
@ -330,7 +330,7 @@ private:
queue_t tmp; queue_t tmp;
while (!m_queue.empty() && amount > 0) while (!m_queue.empty() && amount > 0)
{ {
bw_queue_entry<PeerConnection> qe = m_queue.front(); bw_queue_entry<PeerConnection, Torrent> qe = m_queue.front();
TORRENT_ASSERT(qe.max_block_size > 0); TORRENT_ASSERT(qe.max_block_size > 0);
m_queue.pop_front(); m_queue.pop_front();
@ -435,7 +435,7 @@ private:
int m_current_quota; int m_current_quota;
// these are the consumers that want bandwidth // these are the consumers that want bandwidth
typedef std::deque<bw_queue_entry<PeerConnection> > queue_t; typedef std::deque<bw_queue_entry<PeerConnection, Torrent> > queue_t;
queue_t m_queue; queue_t m_queue;
// these are the consumers that have received bandwidth // these are the consumers that have received bandwidth

View File

@ -37,16 +37,15 @@ POSSIBILITY OF SUCH DAMAGE.
namespace libtorrent { namespace libtorrent {
template<class PeerConnection> template<class PeerConnection, class Torrent>
struct bw_queue_entry struct bw_queue_entry
{ {
typedef typename PeerConnection::torrent_type torrent_type;
bw_queue_entry(boost::intrusive_ptr<PeerConnection> const& pe bw_queue_entry(boost::intrusive_ptr<PeerConnection> const& pe
, int blk, int prio) , int blk, int prio)
: peer(pe), torrent(peer->associated_torrent()) : peer(pe), torrent(peer->associated_torrent())
, max_block_size(blk), priority(prio) {} , max_block_size(blk), priority(prio) {}
boost::intrusive_ptr<PeerConnection> peer; boost::intrusive_ptr<PeerConnection> peer;
boost::weak_ptr<torrent_type> torrent; boost::weak_ptr<Torrent> torrent;
int max_block_size; int max_block_size;
int priority; // 0 is low prio int priority; // 0 is low prio
}; };

View File

@ -98,8 +98,6 @@ namespace libtorrent
friend class invariant_access; friend class invariant_access;
public: public:
typedef torrent torrent_type;
enum channels enum channels
{ {
upload_channel, upload_channel,

View File

@ -696,7 +696,7 @@ namespace libtorrent
boost::scoped_ptr<piece_picker> m_picker; boost::scoped_ptr<piece_picker> m_picker;
// the queue of peer_connections that want more bandwidth // the queue of peer_connections that want more bandwidth
typedef std::deque<bw_queue_entry<peer_connection> > queue_t; typedef std::deque<bw_queue_entry<peer_connection, torrent> > queue_t;
queue_t m_bandwidth_queue[2]; queue_t m_bandwidth_queue[2];
std::vector<announce_entry> m_trackers; std::vector<announce_entry> m_trackers;

View File

@ -2299,7 +2299,7 @@ namespace libtorrent
++i->priority; ++i->priority;
++i; ++i;
} }
m_bandwidth_queue[channel].insert(i.base(), bw_queue_entry<peer_connection>( m_bandwidth_queue[channel].insert(i.base(), bw_queue_entry<peer_connection, torrent>(
p, block_size, priority)); p, block_size, priority));
} }
} }
@ -2315,7 +2315,7 @@ namespace libtorrent
queue_t tmp; queue_t tmp;
while (!m_bandwidth_queue[channel].empty()) while (!m_bandwidth_queue[channel].empty())
{ {
bw_queue_entry<peer_connection> qe = m_bandwidth_queue[channel].front(); bw_queue_entry<peer_connection, torrent> qe = m_bandwidth_queue[channel].front();
if (m_bandwidth_limit[channel].max_assignable() == 0) if (m_bandwidth_limit[channel].max_assignable() == 0)
break; break;
m_bandwidth_queue[channel].pop_front(); m_bandwidth_queue[channel].pop_front();