Vidalia 0.3.1
Public Types | Public Member Functions | Public Attributes | Private Attributes | List of all members
SendCommandEvent::SendWaiter Class Reference

#include <SendCommandEvent.h>

Public Types

enum  SenderStatus { Waiting , Failed , Success }
 

Public Member Functions

 SendWaiter ()
 
void setResult (bool success, const QString &errmsg=QString())
 
bool getResult (QString *errmsg=0)
 
SenderStatus status ()
 

Public Attributes

enum SendCommandEvent::SendWaiter::SenderStatus _status
 

Private Attributes

QMutex _mutex
 
QWaitCondition _waitCond
 
QString _errmsg
 

Detailed Description

Object used to wait for the result of a send operation.

Definition at line 30 of file SendCommandEvent.h.

Member Enumeration Documentation

◆ SenderStatus

Status of the send SendWaiter.

Enumerator
Waiting 
Failed 
Success 

Definition at line 33 of file SendCommandEvent.h.

Constructor & Destructor Documentation

◆ SendWaiter()

SendCommandEvent::SendWaiter::SendWaiter ( )
inline

Default constructor.

Definition at line 35 of file SendCommandEvent.h.

References _status, and Waiting.

Member Function Documentation

◆ getResult()

bool SendCommandEvent::SendWaiter::getResult ( QString *  errmsg = 0)

Waits for and returns the result of the send operation.

Waits for and gets the result of the send operation.

Definition at line 42 of file SendCommandEvent.cpp.

Referenced by ControlConnection::send().

◆ setResult()

void SendCommandEvent::SendWaiter::setResult ( bool  success,
const QString &  errmsg = QString() 
)

Sets the result of the send operation.

Definition at line 31 of file SendCommandEvent.cpp.

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

Referenced by ControlSocket::customEvent(), and ControlConnection::run().

◆ status()

SendCommandEvent::SendWaiter::SenderStatus SendCommandEvent::SendWaiter::status ( )

Returns the SendWaiter's current SenderStatus value.

Definition at line 62 of file SendCommandEvent.cpp.

Referenced by ControlConnection::run().

Member Data Documentation

◆ _errmsg

QString SendCommandEvent::SendWaiter::_errmsg
private

Error message if the send fails.

Definition at line 45 of file SendCommandEvent.h.

Referenced by setResult().

◆ _mutex

QMutex SendCommandEvent::SendWaiter::_mutex
private

Mutex around the wait condition.

Definition at line 43 of file SendCommandEvent.h.

Referenced by setResult().

◆ _status

enum SendCommandEvent::SendWaiter::SenderStatus SendCommandEvent::SendWaiter::_status

Referenced by SendWaiter(), and setResult().

◆ _waitCond

QWaitCondition SendCommandEvent::SendWaiter::_waitCond
private

Waits for the send to complete.

Definition at line 44 of file SendCommandEvent.h.

Referenced by setResult().


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