Files
MapLibreParticleLab/include/mbgl/util/work_task.hpp
Thiago Marcos P. Santos 36581f3d30 [core] Do not pass uv_loop_t around
This should be abstracted by util::RunLoop
2015-11-16 12:25:47 -08:00

22 lines
513 B
C++

#ifndef MBGL_UTIL_WORK_TASK
#define MBGL_UTIL_WORK_TASK
#include <mbgl/util/noncopyable.hpp>
namespace mbgl {
// A movable type-erasing function wrapper. This allows to store arbitrary invokable
// things (like std::function<>, or the result of a movable-only std::bind()) in the queue.
// Source: http://stackoverflow.com/a/29642072/331379
class WorkTask : private util::noncopyable {
public:
virtual ~WorkTask() = default;
virtual void operator()() = 0;
virtual void cancel() = 0;
};
}
#endif