/**
    05Robot - Computer Vision Module

    @author P.Kaczmarek,J.Tomczynski,T.Mankowski
    @version 1.0 2017
*/
#ifndef PROCESSORTHREAD_H
#define PROCESSORTHREAD_H 

#include <QThread>
#include "ProcessorObject.h"
/** \addtogroup ComputerVisionModule
 *  @{
 */
/**
 @brief Wrapper object containing single processor working thread
 */
class ProcessorThread : public QThread
{
     Q_OBJECT

public:
    /**
     @brief Pointer to corresponding ProcessorObject
     */
	ProcessorObject * processorObject;
    /**
     @brief Moves ProcessorObject to thread
     
     @param po pointer to ProcessorObject to be placed in thread
     */
	ProcessorThread(ProcessorObject * po)
	{
		processorObject = po;
		this->start();
		po->moveToThread(this);
    }
    /**
     @brief Default destructor, deletes corresponding ProcessorObject
     */
    ~ProcessorThread()
    {
		delete processorObject;
        this->quit();
        this->wait();
	}
    /**
     @brief Starts processor thread
     */
    void run();

};
/** @}*/
#endif
