11 #ifndef smtk_extension_qtOperationLauncher_h
12 #define smtk_extension_qtOperationLauncher_h
14 #include "smtk/extension/qt/Exports.h"
16 #include "smtk/attribute/Attribute.h"
17 #include "smtk/attribute/Resource.h"
19 #include "smtk/common/ThreadPool.h"
21 #include "smtk/operation/Operation.h"
43 smtk::operation::Operation::Result waitForResult();
44 std::shared_future<smtk::operation::Operation::Result>& future() {
return m_future; }
49 void resultReady(smtk::operation::Operation::Result result);
53 friend class Launcher;
54 std::shared_future<smtk::operation::Operation::Result> m_future;
68 static constexpr
const char*
const type_name =
"smtk::extension::qtOperationLauncher";
73 std::shared_ptr<ResultHandler> operator()(
const smtk::operation::Operation::Ptr& operation);
86 static bool setBusyCursorBehavior(
bool enabled);
91 void operationHasResult(QString parametersName, QString resultName, QPrivateSignal);
95 smtk::operation::Operation::Result run(smtk::operation::Operation::Ptr operation);
98 void decrementCount(smtk::operation::Operation::Result result);
107 std::atomic<int> m_operationCount{ 0 };
109 static bool s_busyCursorEnabled;
132 : m_launcher{ other.m_launcher }
134 other.m_launcher =
nullptr;
142 m_launcher = other.m_launcher;
143 other.m_launcher =
nullptr;
150 std::shared_future<smtk::operation::Operation::Result> operator()(
151 const smtk::operation::Operation::Ptr& operation)
153 auto resHandler = (*m_launcher)(operation);
154 return resHandler->future();