TuttleOFX
1
|
#include <ThreadEnv.hpp>
Public Types | |
typedef ThreadEnv | This |
typedef boost::signals2::signal< void()> | SignalType |
Public Member Functions | |
ThreadEnv (const bool asynchronous=true) | |
ComputeOptions & | getComputeOptions () |
const ComputeOptions & | getComputeOptions () const |
This & | setAsynchronous (const bool v=true) |
void | compute (Graph &graph, const NodeListArg &nodes=NodeListArg()) |
Main functions. | |
void | abort () |
The application would like to abort the process (from another thread). | |
void | join () |
bool | getResult () const |
SignalType & | getSignalEnd () |
Private Member Functions | |
void | setResult (const bool res) |
Static Private Member Functions | |
static void | runProcessFunc (ThreadEnv *threadEnv, Graph *graph, const std::list< std::string > &nodes, const ComputeOptions *const options) |
Private Attributes | |
boost::thread | _thread |
bool | _asynchronous |
memory::MemoryCache | _memoryCache |
ComputeOptions | _options |
boost::atomic_bool | _result |
SignalType | _signalEnd |
Definition at line 22 of file ThreadEnv.hpp.
typedef boost::signals2::signal<void ()> tuttle::host::ThreadEnv::SignalType |
Definition at line 26 of file ThreadEnv.hpp.
Definition at line 25 of file ThreadEnv.hpp.
tuttle::host::ThreadEnv::ThreadEnv | ( | const bool | asynchronous = true | ) | [inline] |
Definition at line 28 of file ThreadEnv.hpp.
References _options, and tuttle::host::ComputeOptions::setReturnBuffers().
void tuttle::host::ThreadEnv::abort | ( | ) | [inline] |
The application would like to abort the process (from another thread).
Definition at line 55 of file ThreadEnv.hpp.
References _options, and tuttle::host::ComputeOptions::abort().
Referenced by BOOST_AUTO_TEST_CASE().
void tuttle::host::ThreadEnv::compute | ( | Graph & | graph, |
const NodeListArg & | nodes = NodeListArg() |
||
) |
Main functions.
Launch the graph computation in a synchrone or asynchrone way.
Definition at line 15 of file ThreadEnv.cpp.
References _asynchronous, _options, _thread, tuttle::host::Graph::compute(), tuttle::host::NodeListArg::getNodes(), and runProcessFunc().
Referenced by BOOST_AUTO_TEST_CASE().
ComputeOptions& tuttle::host::ThreadEnv::getComputeOptions | ( | ) | [inline] |
Definition at line 35 of file ThreadEnv.hpp.
References _options.
Referenced by BOOST_AUTO_TEST_CASE().
const ComputeOptions& tuttle::host::ThreadEnv::getComputeOptions | ( | ) | const [inline] |
Definition at line 36 of file ThreadEnv.hpp.
References _options.
bool tuttle::host::ThreadEnv::getResult | ( | ) | const [inline] |
Definition at line 59 of file ThreadEnv.hpp.
References _result.
Referenced by BOOST_AUTO_TEST_CASE().
SignalType& tuttle::host::ThreadEnv::getSignalEnd | ( | ) | [inline] |
void tuttle::host::ThreadEnv::join | ( | ) | [inline] |
Definition at line 57 of file ThreadEnv.hpp.
References _thread.
Referenced by BOOST_AUTO_TEST_CASE().
void tuttle::host::ThreadEnv::runProcessFunc | ( | ThreadEnv * | threadEnv, |
Graph * | graph, | ||
const std::list< std::string > & | nodes, | ||
const ComputeOptions *const | options | ||
) | [static, private] |
Definition at line 9 of file ThreadEnv.cpp.
References tuttle::host::Graph::compute(), getSignalEnd(), and setResult().
Referenced by compute().
This& tuttle::host::ThreadEnv::setAsynchronous | ( | const bool | v = true | ) | [inline] |
Definition at line 38 of file ThreadEnv.hpp.
References _asynchronous.
void tuttle::host::ThreadEnv::setResult | ( | const bool | res | ) | [inline, private] |
bool tuttle::host::ThreadEnv::_asynchronous [private] |
Definition at line 73 of file ThreadEnv.hpp.
Referenced by compute(), and setAsynchronous().
Definition at line 74 of file ThreadEnv.hpp.
Definition at line 75 of file ThreadEnv.hpp.
Referenced by abort(), compute(), getComputeOptions(), and ThreadEnv().
boost::atomic_bool tuttle::host::ThreadEnv::_result [private] |
Definition at line 77 of file ThreadEnv.hpp.
Referenced by getResult(), and setResult().
Definition at line 79 of file ThreadEnv.hpp.
Referenced by getSignalEnd().
boost::thread tuttle::host::ThreadEnv::_thread [private] |
Definition at line 70 of file ThreadEnv.hpp.