--- /dev/null
+#include "handle.h"
+#include "handle_private.h"
+
+namespace Msp {
+namespace IO {
+
+Handle::Handle():
+ priv(new Private)
+{ }
+
+Handle::Handle(const Handle &other):
+ priv(new Private)
+{
+ priv->handle = other.priv->handle;
+}
+
+Handle &Handle::operator=(const Handle &other)
+{
+ priv->handle = other.priv->handle;
+ return *this;
+}
+
+Handle::~Handle()
+{
+ delete priv;
+}
+
+Handle::operator const void *() const
+{
+#ifdef WIN32
+ return priv->handle!=INVALID_HANDLE_VALUE ? this : 0;
+#else
+ return priv->handle!=-1 ? this : 0;
+#endif
+}
+
+
+Handle::Private::Private():
+#ifdef WIN32
+ handle(INVALID_HANDLE_VALUE)
+#else
+ handle(-1)
+#endif
+{ }
+
+Handle::Private &Handle::Private::operator=(H h)
+{
+ handle = h;
+ return *this;
+}
+
+} // namespace IO
+} // namespace Msp