Stream Class Reference

#include <stream.h>

List of all members.

Public Types

enum  Status {
  Unknown, Launched, Built, Extended,
  Failed, Closed, Disconnected, Connecting,
  Connected, Unknown, New, Launched,
  Connected, Failed, Closed, Unknown,
  New, NewResolve, SentConnect, SentResolve,
  Succeeded, Failed, Closed, Detached
}

Public Member Functions

 Stream ()
 Stream (quint64 streamId, Status status, quint64 circuitId, QString target)
bool isEmpty ()
quint64 id ()
Status status ()
QString statusString ()
quint64 circuitId ()
QString target ()

Static Public Member Functions

static Stream fromString (QString stream)
static Status toStatus (QString strStatus)

Private Attributes

quint64 _streamId
Status _status
quint64 _circuitId
QString _target


Detailed Description

Definition at line 35 of file stream.h.


Member Enumeration Documentation

enum Stream::Status

Stream status values

Enumerator:
Unknown  Unknown circuit status
Launched  Circuit ID assigned to new circuit
Built  All hops finished
Extended  Circuit extended by one hop
Failed  Circuit closed (was not built)
Closed  Circuit closed (was built)
Disconnected  Control connection disconnected.
Connecting  Control connection attempt pending.
Connected  Control connection established.
Unknown  Unknown OR status.
New  Incoming connection.
Launched  Outgoing connection.
Connected  TLS handshake finished.
Failed  Connection closed before handshake completed.
Closed  Connection closed that had previously handshaked.
Unknown  Unknown status type given
New  New request to connect
NewResolve  New request to resolve an address
SentConnect  Sent a connect cell
SentResolve  Sent a resolve cell
Succeeded  Stream established
Failed  Stream failed
Closed  Stream closed
Detached  Detached from circuit

Definition at line 41 of file stream.h.


Constructor & Destructor Documentation

Stream::Stream (  ) 

Default constructor

Definition at line 34 of file stream.cpp.

References _circuitId, _status, _streamId, _target, and Unknown.

Referenced by fromString().

Stream::Stream ( quint64  streamId,
Status  status,
quint64  circuitId,
QString  target 
)

Constructor

Definition at line 43 of file stream.cpp.

References _circuitId, _status, _streamId, and _target.


Member Function Documentation

Stream Stream::fromString ( QString  stream  )  [static]

Parses the given string for a stream, in Tor control protocol format.

Definition at line 57 of file stream.cpp.

References status(), Stream(), target(), and toStatus().

Referenced by TorControl::getStreams(), and TorEvents::handleStreamStatus().

Stream::Status Stream::toStatus ( QString  strStatus  )  [static]

Converts a string description of a stream's status to its enum value

Definition at line 77 of file stream.cpp.

References Closed, Detached, Failed, New, NewResolve, SentConnect, SentResolve, status(), Succeeded, and Unknown.

Referenced by fromString().

bool Stream::isEmpty (  ) 

Returns true if the Stream object's fields are all empty.

Definition at line 125 of file stream.cpp.

References _circuitId, _status, _streamId, _target, and Unknown.

Referenced by TorControl::getStreams().

quint64 Stream::id (  )  [inline]

Returns the ID for this stream.

Definition at line 67 of file stream.h.

References _streamId.

Referenced by CircuitListWidget::addStream(), StreamEvent::id(), and StreamItem::StreamItem().

Status Stream::status (  )  [inline]

Returns the status for this stream.

Definition at line 69 of file stream.h.

References _status.

Referenced by CircuitListWidget::addStream(), fromString(), StreamEvent::status(), statusString(), and toStatus().

QString Stream::statusString (  ) 

Returns a string representation of this stream's status.

Definition at line 106 of file stream.cpp.

References _status, Closed, Detached, Failed, New, NewResolve, SentConnect, SentResolve, status(), and Succeeded.

Referenced by StreamItem::StreamItem(), and StreamItem::update().

quint64 Stream::circuitId (  )  [inline]

Returns the ID of the circuit to which this stream is assigned.

Definition at line 73 of file stream.h.

References _circuitId.

Referenced by CircuitListWidget::addStream(), and StreamEvent::circuitId().

QString Stream::target (  )  [inline]

Returns the target for this stream.

Definition at line 75 of file stream.h.

References _target.

Referenced by fromString(), StreamItem::StreamItem(), and StreamEvent::target().


Member Data Documentation

quint64 Stream::_streamId [private]

Unique ID associated with this stream.

Definition at line 78 of file stream.h.

Referenced by id(), isEmpty(), and Stream().

Status Stream::_status [private]

Stream status value.

Definition at line 79 of file stream.h.

Referenced by isEmpty(), status(), statusString(), and Stream().

quint64 Stream::_circuitId [private]

ID of the circuit carrying this stream.

Definition at line 80 of file stream.h.

Referenced by circuitId(), isEmpty(), and Stream().

QString Stream::_target [private]

Stream target address.

Definition at line 81 of file stream.h.

Referenced by isEmpty(), Stream(), and target().


The documentation for this class was generated from the following files:
Generated on Mon Oct 23 20:08:16 2006 for Vidalia by  doxygen 1.5.0