libtorrent::dht::routing_table Class Reference

#include <routing_table.hpp>

List of all members.

Public Types

typedef aux::routing_table_iterator iterator
typedef iterator const_iterator
typedef std::set
< udp::endpoint >
::const_iterator 
router_iterator

Public Member Functions

 routing_table (node_id const &id, int bucket_size, dht_settings const &settings)
void node_failed (node_id const &id)
void add_router_node (udp::endpoint router)
router_iterator router_begin () const
router_iterator router_end () const
bool node_seen (node_id const &id, udp::endpoint addr)
boost::posix_time::ptime next_refresh (int bucket)
void find_node (node_id const &id, std::vector< node_entry > &l, bool include_self, int count=0)
bool need_node (node_id const &id)
void touch_bucket (int bucket)
int bucket_size (int bucket)
int bucket_size () const
iterator begin () const
iterator end () const
boost::tuple< int, int > size () const
bool need_bootstrap () const
void replacement_cache (bucket_t &nodes) const
void print_state (std::ostream &os) const

Private Types

typedef boost::array
< std::pair< bucket_t,
bucket_t >, 160 > 
table_t
typedef boost::array
< boost::posix_time::ptime, 160 > 
table_activity_t

Private Attributes

int m_bucket_size
dht_settings const & m_settings
table_t m_buckets
table_activity_t m_bucket_activity
node_id m_id
std::set< udp::endpointm_router_nodes
int m_lowest_active_bucket


Detailed Description

Definition at line 150 of file routing_table.hpp.


Member Typedef Documentation

Definition at line 153 of file routing_table.hpp.

Definition at line 154 of file routing_table.hpp.

Definition at line 166 of file routing_table.hpp.

typedef boost::array<std::pair<bucket_t, bucket_t>, 160> libtorrent::dht::routing_table::table_t [private]

Definition at line 226 of file routing_table.hpp.

typedef boost::array<boost::posix_time::ptime, 160> libtorrent::dht::routing_table::table_activity_t [private]

Definition at line 229 of file routing_table.hpp.


Constructor & Destructor Documentation

libtorrent::dht::routing_table::routing_table ( node_id const &  id,
int  bucket_size,
dht_settings const &  settings 
)

Definition at line 37 of file routing_table.cpp.

References m_bucket_activity.


Member Function Documentation

void libtorrent::dht::routing_table::node_failed ( node_id const &  id  ) 

void libtorrent::dht::routing_table::add_router_node ( udp::endpoint  router  ) 

Definition at line 202 of file routing_table.cpp.

References m_router_nodes.

Referenced by libtorrent::dht::node_impl::add_router_node().

router_iterator libtorrent::dht::routing_table::router_begin (  )  const [inline]

router_iterator libtorrent::dht::routing_table::router_end (  )  const [inline]

bool libtorrent::dht::routing_table::node_seen ( node_id const &  id,
udp::endpoint  addr 
)

boost::posix_time::ptime libtorrent::dht::routing_table::next_refresh ( int  bucket  ) 

Definition at line 120 of file routing_table.cpp.

References m_bucket_activity.

Referenced by libtorrent::dht::node_impl::refresh_timeout().

void libtorrent::dht::routing_table::find_node ( node_id const &  id,
std::vector< node_entry > &  l,
bool  include_self,
int  count = 0 
)

bool libtorrent::dht::routing_table::need_node ( node_id const &  id  ) 

void libtorrent::dht::routing_table::touch_bucket ( int  bucket  ) 

Definition at line 115 of file routing_table.cpp.

References m_bucket_activity.

Referenced by libtorrent::dht::node_impl::refresh_bucket().

int libtorrent::dht::routing_table::bucket_size ( int  bucket  )  [inline]

int libtorrent::dht::routing_table::bucket_size (  )  const [inline]

Definition at line 201 of file routing_table.hpp.

References m_bucket_size.

routing_table::iterator libtorrent::dht::routing_table::begin (  )  const

routing_table::iterator libtorrent::dht::routing_table::end (  )  const

boost::tuple< int, int > libtorrent::dht::routing_table::size (  )  const

Definition at line 50 of file routing_table.cpp.

References end(), m_buckets, and nodes().

Referenced by libtorrent::dht::node_impl::refresh(), and libtorrent::dht::node_impl::size().

bool libtorrent::dht::routing_table::need_bootstrap (  )  const

Definition at line 298 of file routing_table.cpp.

References begin(), and end().

Referenced by node_seen().

void libtorrent::dht::routing_table::replacement_cache ( bucket_t nodes  )  const

Definition at line 131 of file routing_table.cpp.

References end(), and m_buckets.

Referenced by libtorrent::dht::node_impl::replacement_cache().

void libtorrent::dht::routing_table::print_state ( std::ostream &  os  )  const


Member Data Documentation

Definition at line 221 of file routing_table.hpp.

Referenced by bucket_size(), find_node(), need_node(), node_seen(), and print_state().

Definition at line 223 of file routing_table.hpp.

Referenced by node_failed().

Definition at line 230 of file routing_table.hpp.

Referenced by next_refresh(), node_seen(), print_state(), routing_table(), and touch_bucket().

Definition at line 231 of file routing_table.hpp.

Referenced by find_node(), need_node(), node_failed(), node_seen(), and print_state().

Definition at line 237 of file routing_table.hpp.

Referenced by add_router_node(), node_seen(), router_begin(), and router_end().

Definition at line 240 of file routing_table.hpp.

Referenced by node_failed(), node_seen(), and print_state().


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

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