#ifndef MSP_IO_PIPE_H_
#define MSP_IO_PIPE_H_
+#include <msp/core/mspcore_api.h>
#include "eventobject.h"
#include "eventreader.h"
#include "handle.h"
namespace Msp {
namespace IO {
-class Pipe: public EventObject
+class MSPCORE_API Pipe: public EventObject
{
private:
- Handle handle[2];
+ Handle read_handle;
+ Handle write_handle;
EventReader reader;
public:
Pipe();
+private:
+ void platform_init();
+public:
~Pipe();
- void set_block(bool);
+ void set_mode(Mode);
+ void set_block(bool) override;
+ void set_inherit(bool) override;
protected:
- virtual unsigned do_write(const char *, unsigned);
- virtual unsigned do_read(char *, unsigned);
+ std::size_t do_write(const char *, std::size_t) override;
+ std::size_t do_read(char *, std::size_t) override;
public:
- virtual const Handle &get_event_handle() { return reader.get_event(); }
+ const Handle &get_handle(Mode) override;
+ const Handle &get_event_handle() override { return reader.get_event(); }
};
} // namespace IO