Hopefully a fix of OSX compilation issue.

This commit is contained in:
bubnikv 2018-11-20 15:18:46 +01:00
parent 0ec37ae038
commit 8ecb2163b6
2 changed files with 6 additions and 10 deletions

View file

@ -15,9 +15,4 @@ std::function<void()> PrintObjectBase::cancel_callback(PrintBase *print)
return print->cancel_callback(); return print->cancel_callback();
} }
void PrintObjectBase::throw_if_canceled(PrintBase *print)
{
print->throw_if_canceled();
}
} // namespace Slic3r } // namespace Slic3r

View file

@ -190,9 +190,6 @@ protected:
// Declared here to allow access from PrintBase through friendship. // Declared here to allow access from PrintBase through friendship.
static tbb::mutex& state_mutex(PrintBase *print); static tbb::mutex& state_mutex(PrintBase *print);
static std::function<void()> cancel_callback(PrintBase *print); static std::function<void()> cancel_callback(PrintBase *print);
// If the background processing stop was requested, throw CanceledException.
// To be called by the worker thread and its sub-threads (mostly launched on the TBB thread pool) regularly.
static void throw_if_canceled(PrintBase *print);
ModelObject *m_model_object; ModelObject *m_model_object;
}; };
@ -353,9 +350,9 @@ protected:
PrintObjectBaseWithState(PrintType *print, ModelObject *model_object) : PrintObjectBase(model_object), m_print(print) {} PrintObjectBaseWithState(PrintType *print, ModelObject *model_object) : PrintObjectBase(model_object), m_print(print) {}
bool set_started(PrintObjectStepEnum step) bool set_started(PrintObjectStepEnum step)
{ return m_state.set_started(step, PrintObjectBase::state_mutex(m_print), [this](){ PrintObjectBase::throw_if_canceled(this->m_print); }); } { return m_state.set_started(step, PrintObjectBase::state_mutex(m_print), [this](){ this->throw_if_canceled(); }); }
PrintStateBase::TimeStamp set_done(PrintObjectStepEnum step) PrintStateBase::TimeStamp set_done(PrintObjectStepEnum step)
{ return m_state.set_done(step, PrintObjectBase::state_mutex(m_print), [this](){ PrintObjectBase::throw_if_canceled(this->m_print); }); } { return m_state.set_done(step, PrintObjectBase::state_mutex(m_print), [this](){ this->throw_if_canceled(); }); }
bool invalidate_step(PrintObjectStepEnum step) bool invalidate_step(PrintObjectStepEnum step)
{ return m_state.invalidate(step, PrintObjectBase::cancel_callback(m_print)); } { return m_state.invalidate(step, PrintObjectBase::cancel_callback(m_print)); }
@ -368,6 +365,10 @@ protected:
{ return m_state.invalidate_all(PrintObjectBase::cancel_callback(m_print)); } { return m_state.invalidate_all(PrintObjectBase::cancel_callback(m_print)); }
protected: protected:
// If the background processing stop was requested, throw CanceledException.
// To be called by the worker thread and its sub-threads (mostly launched on the TBB thread pool) regularly.
void throw_if_canceled() { if (m_print->canceled()) throw CanceledException(); }
friend PrintType; friend PrintType;
PrintType *m_print; PrintType *m_print;