diff --git a/src/proc/play/play-process.cpp b/src/proc/play/play-process.cpp index 709b508c4..159e111df 100644 --- a/src/proc/play/play-process.cpp +++ b/src/proc/play/play-process.cpp @@ -28,7 +28,7 @@ //#include //#include -#include +//#include //#include @@ -42,6 +42,7 @@ namespace play { // using boost::scoped_ptr; // using std::tr1::bind; using lib::transform; + using lib::append_all; namespace { // Implementation details... @@ -50,6 +51,13 @@ namespace play { } // (End) hidden service impl details + PlayProcess::PlayProcess (OutputFeeds feeds) + : outputFeeds_(feeds) + { + if (isnil (feeds)) + throw error::State ("creating a PlayProcess without any usable output connections" + , LUMIERA_ERROR_CANT_PLAY); + } @@ -58,27 +66,19 @@ namespace play { * The caller gets to own and manage the returned process entry. */ PlayProcess* - PlayProcess::initiate (ModelPorts dataGenerators, function activeOutputFeedBuilder) - { - return new PlayProcess (transform (dataGenerators, - activeOutputFeedBuilder)); + PlayProcess::initiate (ModelPorts dataGenerators, FeedBuilder activeOutputFeedBuilder) + { + OutputFeeds newFeeds; + append_all (transform (dataGenerators, activeOutputFeedBuilder), newFeeds); + return new PlayProcess (newFeeds); +/////////////////////////////////////////////////////////////////////////////////////////////TICKET #874 : use a pipeline builder to write it as follows: +// treat_all(dataGenerators) +// .apply (activeOutputFeedBuilder) +// .buildVector(); } - /** @internal actually create and configure a play process instance */ - PlayProcess::PlayProcess (Connections pipeConnections) - { - if (isnil (pipeConnections)) - throw error::State ("creating a PlayProcess without any usable output connections" - , LUMIERA_ERROR_CANT_PLAY); - - UNIMPLEMENTED ("iterate over the connections and allocate/establish each of them, creating and storing Feed objects"); - while (pipeConnections) - { - - } - } /** */ diff --git a/src/proc/play/play-process.hpp b/src/proc/play/play-process.hpp index fdcb68b10..bf0733a72 100644 --- a/src/proc/play/play-process.hpp +++ b/src/proc/play/play-process.hpp @@ -103,6 +103,9 @@ namespace play { * here through the RenderConfigurator instance */ Feed (engine::CalcStreams const&); }; + + typedef function FeedBuilder; + typedef std::vector OutputFeeds; /****************************************************** @@ -124,15 +127,13 @@ namespace play { class PlayProcess : boost::noncopyable { - std::vector outputFeeds_; + OutputFeeds outputFeeds_; - typedef lib::IterSource::iterator Connections; - - PlayProcess (Connections pipeConnections); + PlayProcess (OutputFeeds feeds); public: static PlayProcess* - initiate (ModelPorts dataGenerators, function); + initiate (ModelPorts dataGenerators, FeedBuilder); };