YANE-Framework Tutorial 1.1.0
Public Member Functions | Protected Member Functions | Private Attributes

ProduceConsumeThread Class Reference

Class for the produce and consume thread. More...

#include <pcthread.h>

Inheritance diagram for ProduceConsumeThread:
[legend]
Collaboration diagram for ProduceConsumeThread:
[legend]

List of all members.

Public Member Functions

 ProduceConsumeThread (const std::string &name, yane::Utils::DebugMaster *dm, yane::Utils::Semaphore *semaphore, bool produce)
 Constructor.
 ~ProduceConsumeThread ()
 Destructor.

Protected Member Functions

virtual void run ()
 Function that produces / consumes.

Private Attributes

bool _produce

Detailed Description

This class is able to create a consume and a produce thread. For details about how threads work look at the thread demo.

Definition at line 31 of file pcthread.h.


Constructor & Destructor Documentation

ProduceConsumeThread::ProduceConsumeThread ( const std::string &  name,
yane::Utils::DebugMaster dm,
yane::Utils::Semaphore semaphore,
bool  produce 
)

This creates a new thread wich is depending on bool produce a consume or a produce thread.

Parameters:
nameName of the thread
dmDebugMaster of the thread
semaphoresemaphore that is used
producetrue if a produce thread should be created, otherwise a consume thread is created

Definition at line 23 of file pcthread.cpp.

ProduceConsumeThread::~ProduceConsumeThread ( )

Called when deleting the object.

Definition at line 32 of file pcthread.cpp.


Member Function Documentation

void ProduceConsumeThread::run ( ) [protected, virtual]

This function is called when a new thread is started

Implements yane::Utils::Thread.

Definition at line 36 of file pcthread.cpp.

Here is the call graph for this function:


Member Data Documentation

< Variables needed.

Definition at line 61 of file pcthread.h.