Logo Search packages:      
Sourcecode: webissues version File versions  Download package

WebIssues::BatchJobQueue< BATCH > Class Template Reference

#include <batchjob.h>

List of all members.

Detailed Description

template<class BATCH>
class WebIssues::BatchJobQueue< BATCH >

A queue of jobs for a batch of commands.

This template siplifies implementing a batch of commands by providing a queue of jobs. Each job in the queue creates a single command to execute by calling an appropriate method. Each job may store additional arguments.

Example implementation of a batch:

 class MyBatch : public AbstractBatch
     void addJob1( int arg )
         Job job( &MyBatch::job1 );
         job.addArg( arg );
         m_queue.addJob( job );

     Command* fetchNext()
         if ( m_queue.moreJobs() )
             return m_queue.callJob( this );
         return NULL;

     typedef BatchJob<MyBatch> Job;
     typedef BatchJobQueue<MyBatch> JobQueue;

     Command* job1( const Job& job )
         // create the command

     JobQueue m_queue;

Definition at line 156 of file batchjob.h.

Public Types

typedef BatchJob< BATCH > Job

Public Member Functions

void addJob (const Job &job)
 BatchJobQueue ()
CommandcallJob (BATCH *batch)
bool moreJobs () const
 ~BatchJobQueue ()

Private Attributes

QList< Jobm_jobs
uint m_next

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

Generated by  Doxygen 1.6.0   Back to index