#include <stream.h>
Public Types | |
| enum | Status { Unknown, New, NewResolve, SentConnect, SentResolve, Succeeded, Failed, Closed, Detached } |
Public Member Functions | |
| Stream () | |
| Stream (quint64 streamId, Status status, quint64 circuitId, QString target) | |
| Stream (quint64 streamId, Status status, quint64 circuitId, QString address, quint16 port) | |
| bool | isEmpty () |
| quint64 | id () |
| Status | status () |
| QString | statusString () |
| quint64 | circuitId () |
| QString | target () |
| QString | targetAddress () |
| quint16 | targetPort () |
Static Public Member Functions | |
| static Stream | fromString (QString stream) |
| static Status | toStatus (QString strStatus) |
Private Attributes | |
| quint64 | _streamId |
| Status | _status |
| quint64 | _circuitId |
| QString | _address |
| quint16 | _port |
Definition at line 35 of file stream.h.
| enum Stream::Status |
Stream status values
| Stream::Stream | ( | ) |
Default constructor
Default constructor.
Definition at line 34 of file stream.cpp.
References _circuitId, _port, _status, _streamId, and Unknown.
Referenced by fromString().
| Stream::Stream | ( | quint64 | streamId, | |
| Status | status, | |||
| quint64 | circuitId, | |||
| QString | target | |||
| ) |
Constructor
Definition at line 54 of file stream.cpp.
References _address, _circuitId, _port, _status, _streamId, and i().
| Stream::Stream | ( | quint64 | streamId, | |
| Status | status, | |||
| quint64 | circuitId, | |||
| QString | address, | |||
| quint16 | port | |||
| ) |
Constructor
Definition at line 43 of file stream.cpp.
References _address, _circuitId, _port, _status, and _streamId.
| Stream Stream::fromString | ( | QString | stream | ) | [static] |
Parses the given string for a stream, in Tor control protocol format.
Parses the given string for stream information, given in Tor control protocol format. The format is:
StreamID SP StreamStatus SP CircID SP Target
Definition at line 74 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 94 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.
Returns true if all fields in this Stream object are empty.
Definition at line 142 of file stream.cpp.
References _address, _circuitId, _port, _status, _streamId, and Unknown.
Referenced by TorControl::getStreams().
| quint64 Stream::id | ( | ) | [inline] |
Returns the ID for this stream.
Definition at line 70 of file stream.h.
References _streamId.
Referenced by NetViewer::addStream(), CircuitListWidget::addStream(), StreamEvent::id(), and StreamItem::StreamItem().
| Status Stream::status | ( | ) | [inline] |
Returns the status for this stream.
Definition at line 72 of file stream.h.
References _status.
Referenced by NetViewer::addStream(), CircuitListWidget::addStream(), fromString(), StreamEvent::status(), statusString(), and toStatus().
| QString Stream::statusString | ( | ) |
Returns a string representation of this stream's status.
Returns a human-understandable string representation of this stream's status.
Definition at line 123 of file stream.cpp.
References _status, Closed, Detached, Failed, New, NewResolve, SentConnect, SentResolve, status(), and Succeeded.
Referenced by StreamItem::update().
| quint64 Stream::circuitId | ( | ) | [inline] |
Returns the ID of the circuit to which this stream is assigned.
Definition at line 76 of file stream.h.
References _circuitId.
Referenced by NetViewer::addStream(), CircuitListWidget::addStream(), and StreamEvent::circuitId().
| QString Stream::target | ( | ) | [inline] |
Returns the target address and port for this stream.
Definition at line 78 of file stream.h.
References _address, and _port.
Referenced by fromString(), StreamEvent::target(), and StreamItem::update().
| QString Stream::targetAddress | ( | ) | [inline] |
Returns the target address for this stream.
Definition at line 80 of file stream.h.
References _address.
Referenced by NetViewer::addStream().
| quint16 Stream::targetPort | ( | ) | [inline] |
Returns the target port for this stream.
Definition at line 82 of file stream.h.
References _port.
Referenced by NetViewer::addStream().
quint64 Stream::_streamId [private] |
Status Stream::_status [private] |
quint64 Stream::_circuitId [private] |
ID of the circuit carrying this stream.
Definition at line 87 of file stream.h.
Referenced by circuitId(), isEmpty(), and Stream().
QString Stream::_address [private] |
quint16 Stream::_port [private] |
1.5.3