PACK Qt Binding  $VERSION$
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
Classes | Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | Friends | List of all members
WTransaction Class Reference

#include <transaction.h>

Inheritance diagram for WTransaction:
WHelper

Classes

class  WaitForAll
 
class  WaitForAny
 

Public Types

enum  Stage { Uninitialized =0, Request =1, Success =6, Error =10 }
 

Public Slots

virtual bool waitForFinished (int tmout=30000)
 

Signals

void finished ()
 

Public Member Functions

virtual Stage stage () const
 
virtual bool isInProgress () const
 returns true if the transaction is currently in progress More...
 
virtual bool isFinished () const
 returns true if the transaction is finished More...
 
virtual bool isUnstarted () const
 returns true if the transaction has not started yet More...
 
virtual bool hasError () const
 
virtual QString errorType () const
 
virtual QString errorString () const
 
virtual QString interface () const
 
virtual ~WTransaction ()
 
 Log (WTransaction *parent, const QString &request, const QString &interface=QString())
 
 ~Log ()
 deletes the logger More...
 
void setRequ (const QString &, const QString &)
 logs/stores a request message More...
 
void setResp (const QString &, const QString &)
 logs/stores a response message More...
 
void setError (const QString &)
 logs an error, if the interface is set up to log only on errors it also logs the stored request and response More...
 
void setInfo (const QString &)
 logs some informational message More...
 
 LogWrap (WTransaction *parent, const QString &request, const QString &interface=QString())
 
void setRequ (const QString &, const QString &)
 logs/stores a request message More...
 
void setResp (const QString &, const QString &)
 logs/stores a response message More...
 
void setError (const QString &)
 logs an error, if the interface is set up to log only on errors it also logs the stored request and response More...
 
void setInfo (const QString &)
 logs some informational message More...
 

Static Public Member Functions

static void setLogPrefix (QString)
 sets the logging prefix for transactions, per default it is "T" More...
 

Protected Slots

virtual void endQuery ()
 

Protected Member Functions

 WTransaction (QString iface=QString())
 
 WTransaction (const WTransaction &)
 
virtual WTransactionoperator= (const WTransaction &)
 
virtual QByteArray executeQuery (QString, QByteArray)
 
virtual void startQuery (QString, QByteArray)
 
virtual QByteArray encodeError () const
 
virtual bool canLogRequest () const
 internal: returns true if this transaction can log requests (default: true) More...
 
virtual bool canLogResponse () const
 internal: returns true if this transaction can log responses (default: true) More...
 
- Protected Member Functions inherited from WHelper
bool str2bool (QString s)
 

Protected Attributes

WTransaction_Privated
 

Friends

class WTransaction::Log
 
class WTransaction::LogWrap
 
class WTransaction_Private
 

Additional Inherited Members

- Static Protected Member Functions inherited from WHelper
static QList< QDomElement > elementsByTagName (const QDomElement &, QString)
 

Detailed Description

base class of all transactions

Member Enumeration Documentation

stage the transaction is in

Enumerator
Uninitialized 

transaction has not started yet

Request 

transaction is running

Success 

transaction ended successfully

Error 

transaction ended with an error

Constructor & Destructor Documentation

WTransaction::~WTransaction ( )
virtual

deconstructor

WTransaction::WTransaction ( QString  iface = QString())
protected

internal: construct the transaction

WTransaction::WTransaction ( const WTransaction t)
protected

internal: copy the transaction

WTransaction::~Log ( )

deletes the logger

Member Function Documentation

bool WTransaction::canLogRequest ( ) const
protectedvirtual

internal: returns true if this transaction can log requests (default: true)

bool WTransaction::canLogResponse ( ) const
protectedvirtual

internal: returns true if this transaction can log responses (default: true)

QByteArray WTransaction::encodeError ( ) const
protectedvirtual

internal: encode an error, used by server

void WTransaction::endQuery ( )
protectedvirtualslot

internal: collect query data

virtual QString WTransaction::errorString ( ) const
virtual

returns the (translated) human readable error string

virtual QString WTransaction::errorType ( ) const
virtual

returns the error type (usually the component causing it)

QByteArray WTransaction::executeQuery ( QString  hreq,
QByteArray  data 
)
protectedvirtual

internal: execute a query synchronously on the web, used by subclasses

void WTransaction::finished ( )
signal

this signal is raised when the transaction is finished successfully or with an error, data or an error information is available

virtual bool WTransaction::hasError ( ) const
virtual

returns whether the transaction had an error while executing

QString WTransaction::interface ( ) const
virtual

returns the interface that is used for the transaction

virtual bool WTransaction::isFinished ( ) const
inlinevirtual

returns true if the transaction is finished

virtual bool WTransaction::isInProgress ( ) const
inlinevirtual

returns true if the transaction is currently in progress

virtual bool WTransaction::isUnstarted ( ) const
inlinevirtual

returns true if the transaction has not started yet

WTransaction::Log ( WTransaction parent,
const QString &  request,
const QString &  interface = QString() 
)

instantiates the logger

A logger object is used by transactions to output information about the message exchange that is going on. Depending on the log level of the interface the logger will log very tersely or verbosely. It can log messages immediately or store them to be logged in case of errors.

Parameters
parentthe transaction this is about
requestthe name of the request this transaction issues
interfacethe name of the interface that is used
WTransaction::LogWrap ( WTransaction parent,
const QString &  request,
const QString &  interface = QString() 
)

instantiates a log wrapper using the logger of the parent or creates a new one in the parent

WTransaction & WTransaction::operator= ( const WTransaction t)
protectedvirtual

internal: copy the transaction

void WTransaction::setError ( const QString &  )

logs an error, if the interface is set up to log only on errors it also logs the stored request and response

void WTransaction::setError ( const QString &  )

logs an error, if the interface is set up to log only on errors it also logs the stored request and response

void WTransaction::setInfo ( const QString &  )

logs some informational message

void WTransaction::setInfo ( const QString &  )

logs some informational message

void WTransaction::setLogPrefix ( QString  p)
static

sets the logging prefix for transactions, per default it is "T"

void WTransaction::setRequ ( const QString &  ,
const QString &   
)

logs/stores a request message

void WTransaction::setRequ ( const QString &  ,
const QString &   
)

logs/stores a request message

void WTransaction::setResp ( const QString &  ,
const QString &   
)

logs/stores a response message

void WTransaction::setResp ( const QString &  ,
const QString &   
)

logs/stores a response message

virtual Stage WTransaction::stage ( ) const
virtual

returns the stage the transaction is in

void WTransaction::startQuery ( QString  hreq,
QByteArray  data 
)
protectedvirtual

internal: execute a query on the web asynchronously

bool WTransaction::waitForFinished ( int  tmout = 30000)
virtualslot

waits for this transaction to finish, returns true if the transaction was successful, returns immediately if the transaction is not running

Parameters
tmoutthe maximum amount of milli seconds to wait, if 0 it will not time out

Friends And Related Function Documentation

friend class WTransaction::Log
friend
friend class WTransaction::LogWrap
friend
friend class WTransaction_Private
friend

Member Data Documentation

WTransaction_Private* WTransaction::d
protected

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