ControlConnection::ReceiveWaiter Class Reference

List of all members.

Public Member Functions

 ReceiveWaiter ()
bool getResult (ControlReply *reply, QString *errmsg=0)
void setResult (bool success, ControlReply reply, QString errmsg=QString())

Private Types

enum  ReceiveStatus { Waiting, Failed, Success }

Private Attributes

enum ControlConnection::ReceiveWaiter::ReceiveStatus _status
ControlReply _reply
QMutex _mutex
QWaitCondition _waitCond
QString _errmsg

Detailed Description

Private class used to wait for a response to a control command.

Definition at line 105 of file controlconnection.h.


Member Enumeration Documentation

enum ControlConnection::ReceiveWaiter::ReceiveStatus [private]

Status of the receive waiter.

Enumerator:
Waiting 
Failed 
Success 

Definition at line 116 of file controlconnection.h.


Constructor & Destructor Documentation

ControlConnection::ReceiveWaiter::ReceiveWaiter (  )  [inline]

Default constructor.

Definition at line 108 of file controlconnection.h.

References _status, and Waiting.


Member Function Documentation

bool ControlConnection::ReceiveWaiter::getResult ( ControlReply reply,
QString *  errmsg = 0 
)

Waits for and gets the reply from a control command.

Definition at line 294 of file controlconnection.cpp.

References _errmsg, _mutex, _reply, _status, _waitCond, Success, and Waiting.

Referenced by ControlConnection::send().

void ControlConnection::ReceiveWaiter::setResult ( bool  success,
ControlReply  reply,
QString  errmsg = QString() 
)

Sets the result and reply from a control command.

Definition at line 316 of file controlconnection.cpp.

References _errmsg, _reply, _status, _waitCond, Failed, and Success.

Referenced by ControlConnection::onReadyRead(), and ControlConnection::run().


Member Data Documentation

enum ControlConnection::ReceiveWaiter::ReceiveStatus ControlConnection::ReceiveWaiter::_status [private]

Status of the receive waiter.

Referenced by getResult(), ReceiveWaiter(), and setResult().

ControlReply ControlConnection::ReceiveWaiter::_reply [private]

Reply to a previous command.

Definition at line 117 of file controlconnection.h.

Referenced by getResult(), and setResult().

QMutex ControlConnection::ReceiveWaiter::_mutex [private]

Mutex around the wait condition.

Definition at line 118 of file controlconnection.h.

Referenced by getResult().

QWaitCondition ControlConnection::ReceiveWaiter::_waitCond [private]

Waits for a control rpely.

Definition at line 119 of file controlconnection.h.

Referenced by getResult(), and setResult().

QString ControlConnection::ReceiveWaiter::_errmsg [private]

Error message if the reply fails.

Definition at line 120 of file controlconnection.h.

Referenced by getResult(), and setResult().


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