libtorrent::bandwidth_manager Struct Reference

#include <bandwidth_manager.hpp>

List of all members.

Public Member Functions

 bandwidth_manager (io_service &ios, int channel)
void throttle (int limit)
int throttle () const
void request_bandwidth (intrusive_ptr< peer_connection > peer, bool non_prioritized)
void check_invariant () const

Private Types

typedef boost::mutex mutex_t

Private Member Functions

void add_history_entry (history_entry const &e)
void on_history_expire (asio::error_code const &e)
void hand_out_bandwidth ()

Private Attributes

mutex_t m_mutex
io_servicem_ios
deadline_timer m_history_timer
int m_limit
int m_current_quota
std::deque< bw_queue_entrym_queue
std::deque< history_entrym_history
int m_channel


Detailed Description

Definition at line 161 of file bandwidth_manager.hpp.


Member Typedef Documentation

typedef boost::mutex libtorrent::bandwidth_manager::mutex_t [private]

Definition at line 197 of file bandwidth_manager.hpp.


Constructor & Destructor Documentation

libtorrent::bandwidth_manager::bandwidth_manager ( io_service ios,
int  channel 
)

Definition at line 32 of file bandwidth_manager.cpp.


Member Function Documentation

void libtorrent::bandwidth_manager::throttle ( int  limit  )  [inline]

int libtorrent::bandwidth_manager::throttle (  )  const [inline]

Definition at line 172 of file bandwidth_manager.hpp.

References l, m_limit, and m_mutex.

void libtorrent::bandwidth_manager::request_bandwidth ( intrusive_ptr< peer_connection peer,
bool  non_prioritized 
)

void libtorrent::bandwidth_manager::check_invariant (  )  const

Definition at line 77 of file bandwidth_manager.cpp.

References m_current_quota, and m_history.

void libtorrent::bandwidth_manager::add_history_entry ( history_entry const &  e  )  [private]

void libtorrent::bandwidth_manager::on_history_expire ( asio::error_code const &  e  )  [private]

void libtorrent::bandwidth_manager::hand_out_bandwidth (  )  [private]


Member Data Documentation

Definition at line 198 of file bandwidth_manager.hpp.

Referenced by hand_out_bandwidth(), and throttle().

Definition at line 201 of file bandwidth_manager.hpp.

Definition at line 206 of file bandwidth_manager.hpp.

Referenced by add_history_entry(), and on_history_expire().

Definition at line 209 of file bandwidth_manager.hpp.

Referenced by hand_out_bandwidth(), and throttle().

Definition at line 215 of file bandwidth_manager.hpp.

Referenced by hand_out_bandwidth(), on_history_expire(), and request_bandwidth().

Definition at line 219 of file bandwidth_manager.hpp.

Referenced by add_history_entry(), check_invariant(), and on_history_expire().

Definition at line 223 of file bandwidth_manager.hpp.

Referenced by hand_out_bandwidth(), on_history_expire(), and request_bandwidth().


The documentation for this struct was generated from the following files:

Generated on Sun May 25 00:21:40 2008 by  doxygen 1.5.6