libtorrent::policy Class Reference

#include <policy.hpp>

List of all members.

Public Types

typedef std::vector< peer >
::iterator 
iterator

Public Member Functions

 policy (torrent *t)
void pulse ()
void peer_from_tracker (const tcp::endpoint &remote, const peer_id &pid)
void new_connection (peer_connection &c)
void peer_failed (peer_connection const &c)
void connection_closed (const peer_connection &c)
void ban_peer (const peer_connection &c)
void peer_is_interesting (peer_connection &c)
void piece_finished (int index, bool successfully_verified)
void block_finished (peer_connection &c, piece_block b)
void choked (peer_connection &c)
void unchoked (peer_connection &c)
void interested (peer_connection &c)
void not_interested (peer_connection &c)
bool has_connection (const peer_connection *p)
void check_invariant () const
int num_peers () const
int num_uploads () const
iterator begin_peer ()
iterator end_peer ()

Private Member Functions

bool unchoke_one_peer ()
void choke_one_peer ()
peerfind_choke_candidate ()
peerfind_unchoke_candidate ()
bool seed_unchoke_one_peer ()
void seed_choke_one_peer ()
peerfind_seed_choke_candidate ()
peerfind_seed_unchoke_candidate ()
bool connect_peer (peer *)
bool connect_one_peer ()
bool disconnect_one_peer ()
peerfind_disconnect_candidate ()
peerfind_connect_candidate ()

Private Attributes

std::vector< peerm_peers
torrentm_torrent
int m_num_unchoked
size_type m_available_free_upload
boost::posix_time::ptime m_last_optimistic_disconnect

Classes

struct  old_disconnected_peer
struct  peer


Detailed Description

Definition at line 77 of file policy.hpp.


Member Typedef Documentation

Definition at line 185 of file policy.hpp.


Constructor & Destructor Documentation

libtorrent::policy::policy ( torrent t  ) 

Definition at line 347 of file policy.cpp.


Member Function Documentation

void libtorrent::policy::pulse (  ) 

void libtorrent::policy::peer_from_tracker ( const tcp::endpoint remote,
const peer_id pid 
)

void libtorrent::policy::new_connection ( peer_connection c  ) 

void libtorrent::policy::peer_failed ( peer_connection const &  c  ) 

void libtorrent::policy::connection_closed ( const peer_connection c  ) 

void libtorrent::policy::ban_peer ( const peer_connection c  ) 

void libtorrent::policy::peer_is_interesting ( peer_connection c  ) 

void libtorrent::policy::piece_finished ( int  index,
bool  successfully_verified 
)

void libtorrent::policy::block_finished ( peer_connection c,
piece_block  b 
)

void libtorrent::policy::choked ( peer_connection c  ) 

Definition at line 1043 of file policy.cpp.

void libtorrent::policy::unchoked ( peer_connection c  ) 

void libtorrent::policy::interested ( peer_connection c  ) 

void libtorrent::policy::not_interested ( peer_connection c  ) 

bool libtorrent::policy::has_connection ( const peer_connection p  ) 

void libtorrent::policy::check_invariant (  )  const

int libtorrent::policy::num_peers (  )  const [inline]

Definition at line 175 of file policy.hpp.

Referenced by pulse().

int libtorrent::policy::num_uploads (  )  const [inline]

Definition at line 180 of file policy.hpp.

iterator libtorrent::policy::begin_peer (  )  [inline]

iterator libtorrent::policy::end_peer (  )  [inline]

bool libtorrent::policy::unchoke_one_peer (  )  [private]

void libtorrent::policy::choke_one_peer (  )  [private]

policy::peer * libtorrent::policy::find_choke_candidate (  )  [private]

policy::peer * libtorrent::policy::find_unchoke_candidate (  )  [private]

bool libtorrent::policy::seed_unchoke_one_peer (  )  [private]

void libtorrent::policy::seed_choke_one_peer (  )  [private]

policy::peer * libtorrent::policy::find_seed_choke_candidate (  )  [private]

policy::peer * libtorrent::policy::find_seed_unchoke_candidate (  )  [private]

bool libtorrent::policy::connect_peer ( peer p  )  [private]

bool libtorrent::policy::connect_one_peer (  )  [private]

bool libtorrent::policy::disconnect_one_peer (  )  [private]

policy::peer * libtorrent::policy::find_disconnect_candidate (  )  [private]

policy::peer * libtorrent::policy::find_connect_candidate (  )  [private]


Member Data Documentation

std::vector<peer> libtorrent::policy::m_peers [private]

Definition at line 237 of file policy.hpp.

Referenced by connection_closed(), not_interested(), and pulse().

boost::posix_time::ptime libtorrent::policy::m_last_optimistic_disconnect [private]

Definition at line 242 of file policy.hpp.

Referenced by connect_peer(), new_connection(), and pulse().


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

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