summaryrefslogtreecommitdiff
path: root/processmodel/processmodel.cpp
blob: ee75638bb5c238c47a2e4b62bd3c003c6527f750 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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;
}