diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-05-31 16:29:19 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-05-31 16:29:19 +0100 |
| commit | 634bb00a9a4d07dccee6d13f8120793bd0bc55dc (patch) | |
| tree | f7a79b57e9479232a6bd6e8292ab1abff4e73af3 /processmodel/processmodel.cpp | |
| parent | 8af6944baa8b48ba544106053c48fc6fd11adfad (diff) | |
investigating using a processes rather than threads
Diffstat (limited to 'processmodel/processmodel.cpp')
| -rw-r--r-- | processmodel/processmodel.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/processmodel/processmodel.cpp b/processmodel/processmodel.cpp new file mode 100644 index 0000000..ee75638 --- /dev/null +++ b/processmodel/processmodel.cpp @@ -0,0 +1,32 @@ +#include "Poco/Process.h" +#include "Poco/PipeStream.h" +#include "Poco/StreamCopier.h" +#include <fstream> +#include <iostream> +using Poco::Process; +using Poco::ProcessHandle; + +//1. make a basic executable that represents a render context +//get message passing going +//incorporate in REST server +//fill in the details + +int main(int argc, char** argv) +{ + std::string cmd("rendercontext"); + std::vector<std::string> args; + args.push_back("-ax"); + Poco::Pipe outPipe; + Poco::Pipe inPipe; + ProcessHandle ph = Process::launch(cmd, args, &inPipe, &outPipe, 0); + Poco::PipeInputStream istr(outPipe); + Poco::PipeOutputStream ostr(inPipe); + //std::ofstream ostr("processes.txt"); + // + while (true){ + //Poco::StreamCopier::copyStream(istr,std::cout); + ostr<<std::cin; + std::cout<<istr; + } + return 0; +}
\ No newline at end of file |
