chord_routing_table Class Reference

#include <source/ariba/overlay/modules/chord/detail/chord_routing_table.hpp>

Collaboration diagram for chord_routing_table:

Collaboration graph
[legend]

List of all members.

Public Types

typedef minimizer_table
< nodeid_t, succ_compare_type,
self
succ_table
typedef minimizer_table
< nodeid_t, pred_compare_type,
self
pred_table
typedef minimizer_table
< nodeid_t,
finger_compare_type, self
finger_table
typedef vector< itemroute_table

Public Member Functions

template<class Table>
void on_table (table_listener::type_ type, const Table &tab, typename Table::iterator pos)
 chord_routing_table (const nodeid_t &id, int redundancy=2)
 constructs the reactive chord routing table
bool is_insertable (const nodeid_t &value)
 check whether a node could fit the routing table
itemget (const nodeid_t &value)
 searches an item
itemoperator[] (size_t index)
size_t size () const
iteminsert (const nodeid_t &value)
 adds a node
iteminsert_orphan (const nodeid_t &value)
 adds an orphan
const itemremove (const nodeid_t &value)
 removes an node
itemremove_orphan (const nodeid_t &value)
 removes an orphan
const itemget_next_hop (const nodeid_t &value)
 returns the next hop
const nodeid_tget_successor ()
const nodeid_tget_predesessor ()
bool is_closest_to (const nodeid_t &value)
vector< item > & get_table ()
 returns the whole routing table
const itemget_removed_item () const
 returns the last removed item
const succ_tableget_succ_table () const
 return successor table
const pred_tableget_pred_table () const
 return predecessor table
finger_tableget_finger_table (size_t index)
 return finger table
size_t get_finger_table_size () const
 return number of finger tables

Private Types

typedef chord_routing_table self
typedef distance_compare
< nodeid_t &, nodeid_t,
ring_succ_distance
succ_compare_type
typedef distance_compare
< nodeid_t &, nodeid_t,
ring_pred_distance
pred_compare_type
typedef distance_compare
< nodeid_t, nodeid_t,
ring_distance
finger_compare_type

Private Member Functions

itemfind_item (const nodeid_t &id)
itemadd_item (const nodeid_t &id)
 Adds a item to the routing table.
bool remove_item (const nodeid_t &id)
 Removes an item from the routing table.

Private Attributes

nodeid_t id
succ_table succ
pred_table pred
finger_tablefinger [max_fingers *2]
route_table table
itemitem_added
item item_removed
bool item_removed_flag
bool simulate

Static Private Attributes

static const int max_fingers = 32

Classes

class  item


Detailed Description

Implementation of a chord routing table.

Author:
Sebastian Mies <mies@tm.uka.de>

Definition at line 67 of file chord_routing_table.hpp.


Member Typedef Documentation

Definition at line 69 of file chord_routing_table.hpp.

Definition at line 71 of file chord_routing_table.hpp.

Definition at line 73 of file chord_routing_table.hpp.

Definition at line 75 of file chord_routing_table.hpp.

Definition at line 78 of file chord_routing_table.hpp.

Definition at line 79 of file chord_routing_table.hpp.

Definition at line 80 of file chord_routing_table.hpp.

Definition at line 89 of file chord_routing_table.hpp.


Constructor & Destructor Documentation

chord_routing_table::chord_routing_table ( const nodeid_t id,
int  redundancy = 2 
) [inline, explicit]

constructs the reactive chord routing table

Definition at line 169 of file chord_routing_table.hpp.

References finger, and max_fingers.


Member Function Documentation

item* chord_routing_table::find_item ( const nodeid_t id  )  [inline, private]

Definition at line 114 of file chord_routing_table.hpp.

References chord_routing_table::item::id, and table.

Referenced by get(), insert_orphan(), is_insertable(), and on_table().

item* chord_routing_table::add_item ( const nodeid_t id  )  [inline, private]

Adds a item to the routing table.

Definition at line 121 of file chord_routing_table.hpp.

References chord_routing_table::item::id, item_added, chord_routing_table::item::ref_count, and table.

Referenced by on_table().

bool chord_routing_table::remove_item ( const nodeid_t id  )  [inline, private]

Removes an item from the routing table.

Definition at line 131 of file chord_routing_table.hpp.

References item_removed, item_removed_flag, and table.

Referenced by on_table(), and remove_orphan().

template<class Table>
void chord_routing_table::on_table ( table_listener::type_  type,
const Table &  tab,
typename Table::iterator  pos 
) [inline]

bool chord_routing_table::is_insertable ( const nodeid_t value  )  [inline]

check whether a node could fit the routing table

Definition at line 187 of file chord_routing_table.hpp.

References find_item(), finger, minimizer_table< Value, Comparator, Listener >::insertable(), max_fingers, pred, and succ.

Referenced by ariba::overlay::Chord::onMessage().

item* chord_routing_table::get ( const nodeid_t value  )  [inline]

item* chord_routing_table::operator[] ( size_t  index  )  [inline]

Definition at line 202 of file chord_routing_table.hpp.

References table.

size_t chord_routing_table::size (  )  const [inline]

item* chord_routing_table::insert ( const nodeid_t value  )  [inline]

item* chord_routing_table::insert_orphan ( const nodeid_t value  )  [inline]

const item* chord_routing_table::remove ( const nodeid_t value  )  [inline]

item* chord_routing_table::remove_orphan ( const nodeid_t value  )  [inline]

removes an orphan

Definition at line 243 of file chord_routing_table.hpp.

References item_removed, item_removed_flag, and remove_item().

Referenced by remove().

const item* chord_routing_table::get_next_hop ( const nodeid_t value  )  [inline]

const nodeid_t* chord_routing_table::get_successor (  )  [inline]

const nodeid_t* chord_routing_table::get_predesessor (  )  [inline]

bool chord_routing_table::is_closest_to ( const nodeid_t value  )  [inline]

Definition at line 281 of file chord_routing_table.hpp.

References get_predesessor(), and get_successor().

Referenced by ariba::overlay::Chord::onMessage().

vector<item>& chord_routing_table::get_table (  )  [inline]

returns the whole routing table

Definition at line 292 of file chord_routing_table.hpp.

References table.

const item* chord_routing_table::get_removed_item (  )  const [inline]

returns the last removed item

Definition at line 297 of file chord_routing_table.hpp.

References item_removed, and item_removed_flag.

const succ_table& chord_routing_table::get_succ_table (  )  const [inline]

return successor table

Definition at line 302 of file chord_routing_table.hpp.

References succ.

Referenced by operator<<().

const pred_table& chord_routing_table::get_pred_table (  )  const [inline]

return predecessor table

Definition at line 307 of file chord_routing_table.hpp.

References pred.

Referenced by operator<<().

finger_table& chord_routing_table::get_finger_table ( size_t  index  )  [inline]

return finger table

Definition at line 312 of file chord_routing_table.hpp.

References finger.

Referenced by ariba::overlay::Chord::eventFunction().

size_t chord_routing_table::get_finger_table_size (  )  const [inline]

return number of finger tables

Definition at line 317 of file chord_routing_table.hpp.

References max_fingers.

Referenced by ariba::overlay::Chord::eventFunction().


Member Data Documentation

const int chord_routing_table::max_fingers = 32 [static, private]

Definition at line 97 of file chord_routing_table.hpp.

Referenced by insert_orphan().

Definition at line 100 of file chord_routing_table.hpp.

Referenced by get_succ_table(), get_successor(), insert(), is_insertable(), and remove().

Definition at line 108 of file chord_routing_table.hpp.

Referenced by add_item(), and insert().

Definition at line 109 of file chord_routing_table.hpp.

Referenced by get_removed_item(), remove(), remove_item(), and remove_orphan().

Definition at line 110 of file chord_routing_table.hpp.

Referenced by get_removed_item(), insert(), remove(), remove_item(), and remove_orphan().

Definition at line 111 of file chord_routing_table.hpp.


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

Generated on Wed May 27 18:23:40 2009 for Ariba by  doxygen 1.5.6