7 #include "console/Plugin.hpp" 9 #include <fwRuntime/profile/Profile.hpp> 10 #include <fwRuntime/utils/GenericExecutableFactoryRegistrar.hpp> 12 #include <fwServices/registry/ActiveWorkers.hpp> 18 static ::fwRuntime::utils::GenericExecutableFactoryRegistrar<Plugin> registrar(
"::console::Plugin");
30 m_worker = ::fwThread::Worker::New();
33 ::fwRuntime::profile::getCurrentProfile()->setRunCallback(std::bind(&
Plugin::run,
this));
50 m_worker->post( []() {::fwRuntime::profile::getCurrentProfile()->setup(); } );
51 m_worker->getFuture().wait();
53 ::fwRuntime::profile::getCurrentProfile()->cleanup();
54 const std::uint64_t result = ::boost::any_cast<std::uint64_t>(m_worker->getFuture().get());
CONSOLE_API int run() noexcept
Run callback.
static FWSERVICES_API void setDefaultWorker(::fwThread::Worker::sptr worker)
Register the default active worker.
static FWSERVICES_API ActiveWorkers::sptr getDefault()
Returns an instance of ActiveWorkers.
CONSOLE_API void stop() noexcept
The namespace console contains no service. It is only used to launch a main loop for console applicat...
CONSOLE_API ~Plugin() noexcept
Destructor.