X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fio%2Fhandle.h;fp=source%2Fio%2Fhandle.h;h=44b59371e56ef5262f1e0ba0dd621eb73ef0192a;hp=0000000000000000000000000000000000000000;hb=3b8384a993aed55b348bf51bb02900b3aa010ef8;hpb=e46de55d3c8f65d3b0eeaee76247476695e9eb7c diff --git a/source/io/handle.h b/source/io/handle.h new file mode 100644 index 0000000..44b5937 --- /dev/null +++ b/source/io/handle.h @@ -0,0 +1,33 @@ +#ifndef MSP_IO_HANDLE_H_ +#define MSP_IO_HANDLE_H_ + +namespace Msp { +namespace IO { + +class Handle +{ +public: + struct Private; + +private: + Private *priv; + +public: + Handle(); + Handle(const Handle &); + Handle &operator=(const Handle &); + ~Handle(); + + Private &operator*() { return *priv; } + const Private &operator*() const { return *priv; } + + /** This is effectively a boolean conversion, but avoids accidental + conversion to OS native handles. Unix-based systems use int and win32 uses + void *; const void * is not implicitly convertible to either. */ + operator const void *() const; +}; + +} // namespace IO +} // namespace Msp + +#endif