TuttleOFX  1
ThreadEnv.cpp
Go to the documentation of this file.
00001 #include "ThreadEnv.hpp"
00002 
00003 #include "Graph.hpp"
00004 #include "ComputeOptions.hpp"
00005 
00006 namespace tuttle {
00007 namespace host {
00008 
00009 void ThreadEnv::runProcessFunc( ThreadEnv* threadEnv, Graph* graph, const std::list<std::string>& nodes, const ComputeOptions* const options )
00010 {
00011         threadEnv->setResult( graph->compute( nodes, *options ) );
00012         threadEnv->getSignalEnd()();
00013 }
00014 
00015 void ThreadEnv::compute( Graph& graph, const NodeListArg& nodes )
00016 {
00017         if( _asynchronous )
00018         {
00019                 _thread = boost::thread( runProcessFunc, this, &graph, nodes.getNodes(), &_options );
00020         }
00021         else
00022         {
00023                 graph.compute( nodes, _options );
00024         }
00025 }
00026 
00027 }
00028 }