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;
}
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);
}
@ -330,7 +330,7 @@ private:
queue_t tmp;
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);
m_queue.pop_front();
@ -435,7 +435,7 @@ private:
int m_current_quota;
// 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;
// these are the consumers that have received bandwidth

View File

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

View File

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

View File

@ -696,7 +696,7 @@ namespace libtorrent
boost::scoped_ptr<piece_picker> m_picker;
// 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];
std::vector<announce_entry> m_trackers;

View File

@ -2299,7 +2299,7 @@ namespace libtorrent
++i->priority;
++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));
}
}
@ -2315,7 +2315,7 @@ namespace libtorrent
queue_t tmp;
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)
break;
m_bandwidth_queue[channel].pop_front();