Qt 4.8
Public Functions | Protected Functions | Protected Variables | List of all members
QScriptDebuggerFrontend Class Referenceabstract

The QScriptDebuggerFrontend class is the base class of debugger front-ends. More...

#include <qscriptdebuggerfrontend_p.h>

Inheritance diagram for QScriptDebuggerFrontend:
QScriptDebuggerCommandSchedulerInterface QScriptEngineDebuggerFrontend

Public Functions

QScriptDebuggerEventHandlerInterfaceeventHandler () const
 
 QScriptDebuggerFrontend ()
 
int scheduleCommand (const QScriptDebuggerCommand &command, QScriptDebuggerResponseHandlerInterface *responseHandler)
 Schedules the given command for execution by this front-end, and returns a unique identifier associated with this command. More...
 
int scheduledCommandCount () const
 
void setEventHandler (QScriptDebuggerEventHandlerInterface *eventHandler)
 
virtual ~QScriptDebuggerFrontend ()
 
- Public Functions inherited from QScriptDebuggerCommandSchedulerInterface
virtual ~QScriptDebuggerCommandSchedulerInterface ()
 

Protected Functions

void notifyCommandFinished (int id, const QScriptDebuggerResponse &response)
 Subclasses should call this function when the command identified by the given id has finished and produced the given response. More...
 
bool notifyEvent (const QScriptDebuggerEvent &event)
 Subclasses should call this function when the given event is received from the back-end. More...
 
virtual void processCommand (int id, const QScriptDebuggerCommand &command)=0
 Subclasses must reimplement this function to process the given command identified by id. More...
 
 QScriptDebuggerFrontend (QScriptDebuggerFrontendPrivate &dd)
 

Protected Variables

QScopedPointer< QScriptDebuggerFrontendPrivated_ptr
 

Detailed Description

The QScriptDebuggerFrontend class is the base class of debugger front-ends.

Since
4.5
Warning
This function is not part of the public interface.

Definition at line 70 of file qscriptdebuggerfrontend_p.h.

Constructors and Destructors

◆ QScriptDebuggerFrontend() [1/2]

QScriptDebuggerFrontend::QScriptDebuggerFrontend ( )

Definition at line 141 of file qscriptdebuggerfrontend.cpp.

143 {
144  d_ptr->q_ptr = this;
145 }
QScopedPointer< QScriptDebuggerFrontendPrivate > d_ptr

◆ ~QScriptDebuggerFrontend()

QScriptDebuggerFrontend::~QScriptDebuggerFrontend ( )
virtual

Definition at line 147 of file qscriptdebuggerfrontend.cpp.

148 {
149 }

◆ QScriptDebuggerFrontend() [2/2]

QScriptDebuggerFrontend::QScriptDebuggerFrontend ( QScriptDebuggerFrontendPrivate dd)
protected

Definition at line 151 of file qscriptdebuggerfrontend.cpp.

152  : d_ptr(&dd)
153 {
154  d_ptr->q_ptr = this;
155 }
QScopedPointer< QScriptDebuggerFrontendPrivate > d_ptr

Functions

◆ eventHandler()

QScriptDebuggerEventHandlerInterface * QScriptDebuggerFrontend::eventHandler ( ) const

Definition at line 157 of file qscriptdebuggerfrontend.cpp.

Referenced by setEventHandler().

158 {
160  return d->eventHandler;
161 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerFrontend class is the base class of debugger front-ends.
#define Q_D(Class)
Definition: qglobal.h:2482

◆ notifyCommandFinished()

void QScriptDebuggerFrontend::notifyCommandFinished ( int  id,
const QScriptDebuggerResponse response 
)
protected

Subclasses should call this function when the command identified by the given id has finished and produced the given response.

See also
processCommand(), notifyEvent()

Definition at line 200 of file qscriptdebuggerfrontend.cpp.

201 {
203  if (d->responseHandlers.contains(id)) {
204  QScriptDebuggerResponseHandlerInterface *handler = d->responseHandlers.take(id);
205  Q_ASSERT(handler != 0);
206  handler->handleResponse(response, id);
207  }
208 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerFrontend class is the base class of debugger front-ends.
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
#define Q_D(Class)
Definition: qglobal.h:2482
virtual void handleResponse(const QScriptDebuggerResponse &response, int commandId)=0
QImageIOHandler * handler

◆ notifyEvent()

bool QScriptDebuggerFrontend::notifyEvent ( const QScriptDebuggerEvent event)
protected

Subclasses should call this function when the given event is received from the back-end.

See also
notifyCommandFinished(), QScriptDebuggerBackend::event()

Definition at line 216 of file qscriptdebuggerfrontend.cpp.

217 {
219  if (d->eventHandler)
220  return d->eventHandler->debuggerEvent(event);
221  return false;
222 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerFrontend class is the base class of debugger front-ends.
#define Q_D(Class)
Definition: qglobal.h:2482

◆ processCommand()

void QScriptDebuggerFrontend::processCommand ( int  id,
const QScriptDebuggerCommand command 
)
protectedpure virtual

Subclasses must reimplement this function to process the given command identified by id.

Call notifyCommandFinished() when processing is complete.

Implemented in QScriptEngineDebuggerFrontend.

◆ scheduleCommand()

int QScriptDebuggerFrontend::scheduleCommand ( const QScriptDebuggerCommand command,
QScriptDebuggerResponseHandlerInterface responseHandler 
)
virtual

Schedules the given command for execution by this front-end, and returns a unique identifier associated with this command.

Subclasses can call this function to schedule custom commands.

See also
notifyCommandFinished()

Implements QScriptDebuggerCommandSchedulerInterface.

Definition at line 177 of file qscriptdebuggerfrontend.cpp.

Referenced by QScriptDebuggerPrivate::scheduleCommand().

180 {
182  int id = ++d->nextCommandId;
183  d->pendingCommands.append(command);
184  d->pendingCommandIds.append(id);
185  if (responseHandler)
186  d->responseHandlers.insert(id, responseHandler);
187  if (d->pendingCommands.size() == 1) {
188  QEvent *e = new QEvent(QEvent::Type(QEvent::User+2)); // ProcessCommands
189  d->postEvent(e);
190  }
191  return id;
192 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerFrontend class is the base class of debugger front-ends.
#define Q_D(Class)
Definition: qglobal.h:2482
Type
This enum type defines the valid event types in Qt.
Definition: qcoreevent.h:62
The QEvent class is the base class of all event classes.
Definition: qcoreevent.h:56

◆ scheduledCommandCount()

int QScriptDebuggerFrontend::scheduledCommandCount ( ) const

Definition at line 224 of file qscriptdebuggerfrontend.cpp.

225 {
227  return d->nextCommandId;
228 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerFrontend class is the base class of debugger front-ends.
#define Q_D(Class)
Definition: qglobal.h:2482

◆ setEventHandler()

void QScriptDebuggerFrontend::setEventHandler ( QScriptDebuggerEventHandlerInterface eventHandler)

Definition at line 163 of file qscriptdebuggerfrontend.cpp.

Referenced by QScriptDebugger::setFrontend().

164 {
166  d->eventHandler = eventHandler;
167 }
double d
Definition: qnumeric_p.h:62
The QScriptDebuggerFrontend class is the base class of debugger front-ends.
#define Q_D(Class)
Definition: qglobal.h:2482
QScriptDebuggerEventHandlerInterface * eventHandler() const

Properties

◆ d_ptr

QScopedPointer<QScriptDebuggerFrontendPrivate> QScriptDebuggerFrontend::d_ptr
protected

Definition at line 93 of file qscriptdebuggerfrontend_p.h.

Referenced by QScriptDebuggerFrontend().


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