RouterListItem Class Reference

#include <routerlistitem.h>

List of all members.

Public Member Functions

 RouterListItem (RouterListWidget *list, RouterDescriptor rd)
 ~RouterListItem ()
void update (RouterDescriptor rd)
QString id () const
QString name () const
RouterDescriptor descriptor () const
void setLocation (GeoIp geoip)
virtual bool operator< (const QTreeWidgetItem &other) const

Private Attributes

RouterDescriptor_rd
RouterListWidget_list
qint64 _statusValue
QString _country


Detailed Description

Definition at line 42 of file routerlistitem.h.


Constructor & Destructor Documentation

RouterListItem::RouterListItem ( RouterListWidget list,
RouterDescriptor  rd 
)

Default constructor.

Definition at line 47 of file routerlistitem.cpp.

References _country, _list, _rd, COUNTRY_COLUMN, IMG_FLAG_UNKNOWN, and update().

RouterListItem::~RouterListItem (  ) 

Destructor.

Definition at line 58 of file routerlistitem.cpp.

References _rd.


Member Function Documentation

void RouterListItem::update ( RouterDescriptor  rd  ) 

Updates this router item using a new descriptor.

Updates the router descriptor for this item.

Definition at line 66 of file routerlistitem.cpp.

References _rd, _statusValue, RouterDescriptor::hibernating(), IMG_NODE_HIGH_BW, IMG_NODE_LOW_BW, IMG_NODE_MED_BW, IMG_NODE_NO_BW, IMG_NODE_OFFLINE, IMG_NODE_SLEEPING, RouterDescriptor::name(), NAME_COLUMN, RouterDescriptor::observedBandwidth(), RouterDescriptor::offline(), RouterDescriptor::platform(), and STATUS_COLUMN.

Referenced by RouterListItem().

QString RouterListItem::id (  )  const [inline]

Returns the router's ID.

Definition at line 55 of file routerlistitem.h.

References _rd, and RouterDescriptor::id().

Referenced by RouterListWidget::mouseReleaseEvent(), and NetViewer::resolved().

QString RouterListItem::name (  )  const [inline]

Returns the router's name.

Definition at line 57 of file routerlistitem.h.

References _rd, and RouterDescriptor::name().

Referenced by operator<().

RouterDescriptor RouterListItem::descriptor (  )  const [inline]

Returns the descriptor for this router.

Definition at line 59 of file routerlistitem.h.

References _rd.

Referenced by RouterListWidget::addRouter(), NetViewer::circuitPathIDs(), NetViewer::circuitPathNames(), and NetViewer::circuitSelected().

void RouterListItem::setLocation ( GeoIp  geoip  ) 

Sets the location information for this router item.

Sets the location information for this item's router descriptor.

Definition at line 105 of file routerlistitem.cpp.

References _country, _rd, GeoIp::country(), COUNTRY_COLUMN, RouterDescriptor::setLocation(), and GeoIp::toLocation().

Referenced by NetViewer::resolved().

bool RouterListItem::operator< ( const QTreeWidgetItem &  other  )  const [virtual]

Overload the comparison operator.

Definition at line 121 of file routerlistitem.cpp.

References _country, _list, _statusValue, b(), RouterListWidget::CountryColumn, name(), RouterListWidget::NameColumn, and RouterListWidget::StatusColumn.


Member Data Documentation

RouterDescriptor* RouterListItem::_rd [private]

Descriptor for this router item.

Definition at line 67 of file routerlistitem.h.

Referenced by descriptor(), id(), name(), RouterListItem(), setLocation(), update(), and ~RouterListItem().

RouterListWidget* RouterListItem::_list [private]

The list for this list item.

Definition at line 68 of file routerlistitem.h.

Referenced by operator<(), and RouterListItem().

qint64 RouterListItem::_statusValue [private]

Value used to sort items by status.

Definition at line 69 of file routerlistitem.h.

Referenced by operator<(), and update().

QString RouterListItem::_country [private]

Country in which this router is likely located.

Definition at line 70 of file routerlistitem.h.

Referenced by operator<(), RouterListItem(), and setLocation().


The documentation for this class was generated from the following files:
Generated on Wed Sep 5 15:49:29 2007 for Vidalia by  doxygen 1.5.3