1

I managed to encapsule boost.thread into a class, in which I have a boost::thread worker, that runs a method as threadCode

    boost::thread worker = boost::thread(boost::bind(&ThreadClass::executionLoop, this));

I want to do the same for a boost.process, in which a worker runs a method as independent process.

How can I do that?

user3263577
  • 11
  • 1
  • 3

1 Answers1

0

Note that boost.process is not part of boost. See this community wiki for a full list of all the different boost.process libraries.

Generally what you are trying to do isn't possible. There is a more elaborate discussion at Boost.Process - how to make a process run a function?, but since you can't make it run a function, you won't be able to neatly encapsulate it.

Community
  • 1
  • 1
mockinterface
  • 14,452
  • 5
  • 28
  • 49