]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/base.h
Move non-oneliner functions out of RefPtr class declaration
[libs/core.git] / source / io / base.h
index 1fe143e10e18eed4668aac843c3d4905b54f3ede..b6d1ff65a2a83f1b793d10fb5a4d36fd9f966efa 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <sigc++/sigc++.h>
 #include <msp/core/mutex.h>
+#include <msp/core/noncopyable.h>
 #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; }