TuttleOFX  1
tuttle::host::ThreadEnv Class Reference

#include <ThreadEnv.hpp>

Collaboration diagram for tuttle::host::ThreadEnv:

Public Types

typedef ThreadEnv This
typedef
boost::signals2::signal< void()> 
SignalType

Public Member Functions

 ThreadEnv (const bool asynchronous=true)
memory::MemoryCachegetImageCache ()
const memory::MemoryCachegetImageCache () const
ComputeOptionsgetComputeOptions ()
const ComputeOptionsgetComputeOptions () const
ThissetAsynchronous (const bool v=true)
bool isRunning ()
 Main functions.
void compute (Graph &graph, const NodeListArg &nodes=NodeListArg())
 Launch the graph computation in a synchrone or asynchrone way.
void abort ()
 The application would like to abort the process (from another thread). Thread Safe.
void join ()
bool getResult () const
 Result status of the lastest compute. Thread Safe.
SignalTypegetSignalEnd ()

Private Member Functions

void setResult (const bool res)
 Result status of the lastest compute. Thread Safe.
void setIsRunning (const bool res)
 Is this ThreadEnv executing a compute? Thread Safe.

Static Private Member Functions

static void runProcessFunc (ThreadEnv *threadEnv, Graph &graph, const std::list< std::string > &nodes)

Private Attributes

boost::thread _thread
bool _asynchronous
memory::MemoryCache _imageCache
ComputeOptions _options
boost::atomic_bool _isRunning
boost::atomic_bool _result
SignalType _signalEnd

Detailed Description

Utility class to compute a graph inside a thread.

Definition at line 25 of file ThreadEnv.hpp.


Member Typedef Documentation

typedef boost::signals2::signal<void ()> tuttle::host::ThreadEnv::SignalType

Definition at line 29 of file ThreadEnv.hpp.

Definition at line 28 of file ThreadEnv.hpp.


Constructor & Destructor Documentation

tuttle::host::ThreadEnv::ThreadEnv ( const bool  asynchronous = true) [inline]

Definition at line 31 of file ThreadEnv.hpp.

References _options, and tuttle::host::ComputeOptions::setReturnBuffers().

Here is the call graph for this function:


Member Function Documentation

void tuttle::host::ThreadEnv::abort ( ) [inline]

The application would like to abort the process (from another thread). Thread Safe.

Definition at line 70 of file ThreadEnv.hpp.

References _options, and tuttle::host::ComputeOptions::abort().

Referenced by BOOST_AUTO_TEST_CASE().

Here is the call graph for this function:

void tuttle::host::ThreadEnv::compute ( Graph graph,
const NodeListArg nodes = NodeListArg() 
)

Launch the graph computation in a synchrone or asynchrone way.

Definition at line 26 of file ThreadEnv.cpp.

References _asynchronous, _imageCache, _options, _thread, tuttle::host::Graph::compute(), tuttle::host::NodeListArg::getNodes(), runProcessFunc(), setIsRunning(), and setResult().

Referenced by BOOST_AUTO_TEST_CASE().

Here is the call graph for this function:

ComputeOptions& tuttle::host::ThreadEnv::getComputeOptions ( ) [inline]

Definition at line 43 of file ThreadEnv.hpp.

References _options.

Referenced by BOOST_AUTO_TEST_CASE().

const ComputeOptions& tuttle::host::ThreadEnv::getComputeOptions ( ) const [inline]

Definition at line 44 of file ThreadEnv.hpp.

References _options.

memory::MemoryCache& tuttle::host::ThreadEnv::getImageCache ( ) [inline]

Definition at line 40 of file ThreadEnv.hpp.

References _imageCache.

const memory::MemoryCache& tuttle::host::ThreadEnv::getImageCache ( ) const [inline]

Definition at line 41 of file ThreadEnv.hpp.

References _imageCache.

bool tuttle::host::ThreadEnv::getResult ( ) const [inline]

Result status of the lastest compute. Thread Safe.

Definition at line 78 of file ThreadEnv.hpp.

References _result.

Referenced by BOOST_AUTO_TEST_CASE().

SignalType& tuttle::host::ThreadEnv::getSignalEnd ( ) [inline]

Definition at line 80 of file ThreadEnv.hpp.

References _signalEnd.

Referenced by runProcessFunc().

bool tuttle::host::ThreadEnv::isRunning ( ) [inline]

Main functions.

Is this ThreadEnv executing a compute? Thread Safe

Definition at line 59 of file ThreadEnv.hpp.

References _isRunning.

void tuttle::host::ThreadEnv::join ( ) [inline]

Definition at line 72 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 
) [static, private]
This& tuttle::host::ThreadEnv::setAsynchronous ( const bool  v = true) [inline]

Definition at line 46 of file ThreadEnv.hpp.

References _asynchronous.

void tuttle::host::ThreadEnv::setIsRunning ( const bool  res) [inline, private]

Is this ThreadEnv executing a compute? Thread Safe.

Definition at line 97 of file ThreadEnv.hpp.

References _isRunning.

Referenced by compute(), and runProcessFunc().

void tuttle::host::ThreadEnv::setResult ( const bool  res) [inline, private]

Result status of the lastest compute. Thread Safe.

Definition at line 91 of file ThreadEnv.hpp.

References _result.

Referenced by compute(), and runProcessFunc().


Field Documentation

Definition at line 102 of file ThreadEnv.hpp.

Referenced by compute(), and setAsynchronous().

boost::atomic_bool tuttle::host::ThreadEnv::_isRunning [private]

Definition at line 106 of file ThreadEnv.hpp.

Referenced by isRunning(), and setIsRunning().

boost::atomic_bool tuttle::host::ThreadEnv::_result [private]

Definition at line 107 of file ThreadEnv.hpp.

Referenced by getResult(), and setResult().

Definition at line 109 of file ThreadEnv.hpp.

Referenced by getSignalEnd().

boost::thread tuttle::host::ThreadEnv::_thread [private]

Definition at line 100 of file ThreadEnv.hpp.

Referenced by compute(), and join().


The documentation for this class was generated from the following files: