16 #ifndef __PYIPSDKBASE_PYTHONPROCESSORMACROS_H__ 17 #define __PYIPSDKBASE_PYTHONPROCESSORMACROS_H__ 21 #include <IPSDKImage/Image/BaseImage.h> 22 #include <IPSDKCore/Processing/Action/BaseAction.h> 23 #include <boost/noncopyable.hpp> 31 #if (defined(_MSC_VER) && _MSC_VER == 1900) 32 #define IPSDK_REGISTER_PROCESSOR_TO_PYTHON_BOOST_WORKAROUND(processorName) \ 33 static_cast<BOOST_PP_CAT(processorName, Lvl1) const volatile* (*)(class BOOST_PP_CAT(processorName, Lvl1) const volatile*)>(boost::get_pointer<BOOST_PP_CAT(processorName, Lvl1) const volatile>); 35 #define IPSDK_REGISTER_PROCESSOR_TO_PYTHON_BOOST_WORKAROUND(processorName) 41 #define IPSDK_REGISTER_PROCESSOR_TO_PYTHON(processorName) \ 42 boost::python::class_<BOOST_PP_CAT(processorName, Lvl1), \ 43 boost::shared_ptr<BOOST_PP_CAT(processorName, Lvl1)>, \ 44 boost::noncopyable>( \ 45 BOOST_PP_STRINGIZE(BOOST_PP_CAT(processorName, Lvl1)), \ 46 BOOST_PP_CAT(processorName, Lvl1)::getToolTipStr().c_str(), \ 47 boost::python::no_init) \ 49 &BOOST_PP_CAT(processorName, Lvl1)::getToolTip, \ 50 boost::python::return_value_policy<boost::python::copy_const_reference>(), \ 51 "retrieve object tool tip") \ 52 .def("requestCancellation", &core::BaseAction::requestCancellation, "action execution cancellation request")\ 53 .def("waitForCompletion", &core::BaseAction::waitForCompletion, "method allowing to wait for execution end")\ 54 .def("getStatus", &core::BaseAction::getStatus, "retrieve action result")\ 55 .def("getActionResult", &core::BaseAction::getActionResult, "check for action execution status")\ 56 .def("getFullInfoStr", &BOOST_PP_CAT(processorName, Lvl1)::getFullInfoStr, "retrieve full processor informations string including attributes tooltip, rules and initialization information")\ 57 .def("isProgressAvailable", &BOOST_PP_CAT(processorName, Lvl1)::isProgressAvailable, "method indicating if the processor progression is available")\ 58 .def("getProgressAvailability", &BOOST_PP_CAT(processorName, Lvl1)::getProgressAvailability, "method indicating if the processor progression is available")\ 59 .def("getProgress", &ipsdk::processor::BaseAsyncProcessor::getProgress, "retrieve processor progress")\ 60 .def("getCurIterIdx", &ipsdk::processor::BaseAsyncProcessor::getCurIterIdx, "Returns the index of current iteration")\ 61 .def("getTotalNbIterations", &BOOST_PP_CAT(processorName, Lvl1)::getTotalNbIterations, "method indicating the processor total number of iterations. Returns 0 for unknown number of iterations (ITER_ASYNC and REP_ASYNC)")\ 62 .def("getFullActionDuration", &core::BaseAction::getFullActionDuration, " retrieve elasped execution duration between call to run and termination");\ 63 IPSDK_REGISTER_PROCESSOR_TO_PYTHON_BOOST_WORKAROUND(processorName) 68 #endif // __PYIPSDKBASE_PYTHONPROCESSORMACROS_H__ Macros allowing to handle ipsdk to python wrapping.
Predefined types for processor management.