SourceForge.net Logo

DAQpp::Thread Class Reference

class Thread. More...

#include <Thread.h>

Inheritance diagram for DAQpp::Thread:

Inheritance graph
[legend]

List of all members.

Public Types

enum  CancelType { deferred, asynchronous, disable }

Public Member Functions

 Thread ()
 constructor
virtual ~Thread ()
 destructor
void nice (int x)
 Sets the nice value of the thread process.
void test_cancel ()
 test if the thread has been cancelled
void set_cancel (CancelType)
 sets the way the thread can be cancelled.
void exit (int v=0)
 exits the thread
virtual void start ()
 Starts the thread.
virtual void stop ()
 Stops the thread.
virtual void run ()=0
 The method that gets executed in the thread.
bool is_running ()
 Checks if the thread is running.
bool is_stopped ()
 Checks if the thread has stopped.

Static Public Member Functions

static void * _run (void *)
 Internal.

Private Attributes

pthread_t _thread
 The thread we are wrapping.
bool _started
 says if the thread has already started
bool _stopped
 says if the thread has stopped
int _nice
 The nice value for the trhead process.


Detailed Description

class Thread.

This class represents a thread. It is an abstract class and the objects deriving from it should implement the run() method, which defines what the thread will execute. The thread will start running when the start() method is called and can be stopped by calling the stop() method.


Member Function Documentation

void Thread::set_cancel ( CancelType  ct  ) 

sets the way the thread can be cancelled.

It is any of the options in CancelType


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

Generated on Mon Apr 21 10:00:05 2008 for DAQ++ by  doxygen 1.5.5