DYT/Tool/matlab/include/cppmex/mexTaskReference.hpp

31 lines
908 B
C++
Raw Permalink Normal View History

2024-11-22 15:19:31 +00:00
/* Copyright 2017 The MathWorks, Inc. */
#ifndef __MEX_TASK_REFERENCE_HPP__
#define __MEX_TASK_REFERENCE_HPP__
#include <string>
#include <functional>
namespace matlab {
namespace engine {
class TaskReference {
public:
TaskReference();
TaskReference(std::function<bool(uintptr_t, bool)>&& cancel);
TaskReference(uintptr_t aHandle, std::function<bool(uintptr_t, bool)>&& cancel);
uintptr_t getHandle() const ;
virtual ~TaskReference();
virtual bool cancel(bool allowInterrupt);
private:
TaskReference(TaskReference& handle) = delete;
TaskReference& operator=(TaskReference&) = delete;
uintptr_t handle;
std::function<bool(uintptr_t, bool)> cancelImpl;
};
}
}
#endif //__MEX_TASK_REFERENCE_HPP__