/* Copyright 2017 The MathWorks, Inc. */ #ifndef ENGINE_FACTORY_HPP #define ENGINE_FACTORY_HPP #include #include #include #include "engine_util.hpp" namespace matlab { namespace engine { class MATLABEngine; /** * Start MATLAB synchronously with startup options * * @param options - Startup options used to launch MATLAB * @return std::unique_ptr - A unique pointer of MATLABEngine object * * @throw EngineException if failed to start MATLAB */ std::unique_ptr startMATLAB(const std::vector& options = std::vector()); /** * Start MATLAB asynchronously with startup options * * @param options - Startup options used to launch MATLAB * @return FutureResult> - A future of a unique pointer of a MATLABEngine object * * @throw none */ FutureResult> startMATLABAsync(const std::vector& options = std::vector()); /** * Find all shared MATLAB sessions synchronously * * @return std::vector - A vector of names of shared MATLAB sessions * * @throw none */ std::vector findMATLAB(); /** * Find all shared MATLAB sessions synchronously * * @return FutureResult> - A future of a vector of names of shared MATLAB sessions * * @throw none */ FutureResult> findMATLABAsync(); /** * Start or connect to a shared MATLAB session synchronously * * @return std::unique_ptr - A unique pointer of a MATLABEngine object * * @throw EngineException if failed to start or connect to a shared MATLAB session */ std::unique_ptr connectMATLAB(); /** * Connect to a shared MATLAB session synchronously * * @param String - The name of a shared MATLAB session * @return std::unique_ptr - A unique pointer of a MATLABEngine object * * @throw EngineException if failed to connect to a shared MATLAB session */ std::unique_ptr connectMATLAB(const String& name); /** * Start or connect to a shared MATLAB session asynchronously * * @return FutureResult> - A future of a unique pointer of a MATLABEngine object * * @throw none */ FutureResult> connectMATLABAsync(); /** * Connect to a shared MATLAB session asynchronously * * @param String - The name of a shared MATLAB session * @return FutureResult> - A future of a unique pointer of a MATLABEngine object * * @throw none */ FutureResult> connectMATLABAsync(const String& name); /** * Terminate the engine client. The Engine application will be no longer able to start MATLAB after calling this function. * * @return void * * @throw none */ void terminateEngineClient(); } } #endif //ENGINE_FACTORY_HPP