Noux: add backend pointer to Io_channel

The backend pointer may be used to provide additional methods in a
Io_channel derived class.
This commit is contained in:
Josef Söntgen 2012-09-28 15:55:08 +02:00
parent 4b140a5202
commit 08bd41b1ec

View File

@ -27,6 +27,20 @@
namespace Noux {
/**
* Input/output channel backend that is used for calling
* different methos which does not belong to the original
* interface, e.g. network methods.
*/
class Io_channel_backend
{
public:
virtual ~Io_channel_backend() { }
virtual int type() const { return -1; }
};
/**
* Input/output channel interface
*/
@ -49,6 +63,8 @@ namespace Noux {
virtual ~Io_channel() { }
virtual Io_channel_backend* backend() { return 0; }
virtual bool write(Sysio *sysio, size_t &count) { return false; }
virtual bool read(Sysio *sysio) { return false; }
virtual bool fstat(Sysio *sysio) { return false; }