X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fio%2Fbase.h;h=b6d1ff65a2a83f1b793d10fb5a4d36fd9f966efa;hp=1fe143e10e18eed4668aac843c3d4905b54f3ede;hb=be8ea216d23bf36bdfb2d3e302638782575fc136;hpb=481b844ed7d180ffbf70223075f2fc1ffdb5b444 diff --git a/source/io/base.h b/source/io/base.h index 1fe143e..b6d1ff6 100644 --- a/source/io/base.h +++ b/source/io/base.h @@ -3,6 +3,7 @@ #include #include +#include #include "handle.h" #include "mode.h" #include "poll.h" @@ -13,7 +14,7 @@ namespace IO { /** Common interface for all I/O objects. */ -class Base +class Base: private NonCopyable { public: /** RAII synchronization primitive. Prevents concurrent access to the @@ -45,9 +46,6 @@ protected: Mutex *mutex; Base(); -private: - Base(const Base &); - Base &operator=(const Base &); public: virtual ~Base(); @@ -59,6 +57,12 @@ public: Blocking is enabled by default. */ virtual void set_block(bool) = 0; + /** Sets inheritance mode. When inheritance is enabled, the file descriptor + will persist through Process::execute. + + Inheritance is disabled by default. */ + virtual void set_inherit(bool) = 0; + /** Returns the current mode flags. */ Mode get_mode() const { return mode; }