Boost logo

Boost :

Subject: Re: [boost] [gsoc] Boost.Process done
From: Ilya Sokolov (ilyasokol_at_[hidden])
Date: 2010-09-01 11:27:11


On 01.09.2010 18:55, Ilya Sokolov wrote:
> class stream // I don't like this name
> {
> public:
> virtual ~stream() {};
> // create_child() calls this method
> virtual void create_parent_and_child_end(handle&, handle&);
> };

Another try:

class stream
{
public:
   virtual ~stream() {};
   virtual void set_fileno(int);
   virtual std::pair<handle, handle> create_parent_and_child_end();
};

class inherit : public stream
{
public:
   void set_fileno(int);
   void create_parent_and_child_end(handle& pe, handle& ce)
   {
     handle pe;
     handle ce(GetStdHandle(DWORD(fileno_ - 10)));
     return std::make_pair(pe, ce);
   };

private:
   int fileno_;
};

class context
{
public:
   context& stdin(stream s)
   {
     s.set_fileno(0);
     stdin_ = s;
     return *this;
   }
   ...
};


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk