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)
ComputeOptionsgetComputeOptions ()
const ComputeOptionsgetComputeOptions () const
ThissetAsynchronous (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
SignalTypegetSignalEnd ()

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

Detailed Description

Definition at line 22 of file ThreadEnv.hpp.


Member Typedef Documentation

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.


Constructor & Destructor Documentation

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

Definition at line 28 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).

Definition at line 55 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() 
)

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().

Here is the call graph for this function:

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]

Definition at line 61 of file ThreadEnv.hpp.

References _signalEnd.

Referenced by runProcessFunc().

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().

Here is the call graph for this function:

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]

Definition at line 67 of file ThreadEnv.hpp.

References _result.

Referenced by runProcessFunc().


Field Documentation

Definition at line 73 of file ThreadEnv.hpp.

Referenced by compute(), and setAsynchronous().

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.

Referenced by compute(), and join().


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