libbbb  1.2.1
Groups common code used in some applications and libraries.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
autothread.h File Reference

Contains the definition for AutoThread class. More...

#include <libbbb/libbbb.h>
#include <libbbb/amorph.h>
#include <QThread>

Go to the source code of this file.

Classes

class  libbbb::AutoThread
 represents a thread that deletes itself when it has done its job More...
 

Macros

#define TH_MULTIPLE   libbbb::TH_EACH
 more than one worker threads
 
#define AutoThreadN(name, cnt)
 

Typedefs

typedef RunFuncCode(* libbbb::RunFunc )(AutoThread *th)
 function called in the context of the new thread
 

Enumerations

enum  RunFuncCode { EXIT_NOW, ENTER_EXEC }
 return values for RunFunc; decide what to do next
 
enum  ThreadStg { libbbb::TH_SAME = 0, libbbb::TH_WORKER }
 types of threads
 

Functions

 libbbb::AutoThreadN (AutoThread2, 2)
 
 libbbb::AutoThreadN (AutoThread3, 3)
 
 libbbb::AutoThreadN (AutoThread4, 4)
 
 libbbb::AutoThreadN (AutoThread5, 5)
 

Detailed Description

Contains the definition for AutoThread class.

Date
Jan 2013
Author
TNick

Macro Definition Documentation

#define AutoThreadN (   name,
  cnt 
)
Value:
class name : public AutoThread { \
Amorph d___[cnt-1]; \
public: \
virtual Amorph & data ( int i ) \
{ \
Q_ASSERT( i >= 0 ); \
Q_ASSERT( i < cnt ); \
if ( i == 0 ) \
return d_; \
else \
return d___[i-1]; \
} \
}