mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-11-04 14:49:57 +08:00
30 lines
578 B
C++
30 lines
578 B
C++
#pragma once
|
|
#include <QObject>
|
|
|
|
#include <QObject>
|
|
#include <deque>
|
|
#include <functional>
|
|
#include <boost/thread/mutex.hpp>
|
|
#include <boost/thread/condition_variable.hpp>
|
|
|
|
namespace moveit { namespace tools {
|
|
|
|
class MainLoopProcessing : public QObject
|
|
{
|
|
Q_OBJECT
|
|
boost::mutex jobs_mutex_;
|
|
std::deque<std::function<void()> > jobs_;
|
|
boost::condition_variable idle_condition_;
|
|
|
|
public:
|
|
explicit MainLoopProcessing(QObject *parent = 0);
|
|
void addJob(const std::function<void()> &job);
|
|
void clear();
|
|
size_t numPending();
|
|
|
|
void waitForAllJobs();
|
|
void executeJobs();
|
|
};
|
|
|
|
} }
|