Overview
Features
Download
Documentation
Community
Add-Ons & Services

IOChannel

General discussion regarding the development of POCO for contributors.

IOChannel

Postby alex » 08 Jan 2008, 04:26

This is a revival of an old topic . What I'd like to do is following:

* introduce Foundation~058~~058~IOChannel interface as parent for all channels (currently, this is IO~058~~058~AbstractChannel)
* move NetChannel from IO to Net to get rid of Net dependency for IO library

The rationale for this is to have a unified interface for all the I/O functionality (network, various ports, such as serial, USB, ...) alongside with a "chainable" protocol class hierarchy. I'm already using IO in production and it works well.

I am looking for some feedback. For details, see IO library in SVN.

Alex
alex
 
Posts: 1115
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: IOChannel

Postby guenter » 11 Jan 2008, 14:18

A few comments on the interface.

For having IOChannel in Foundation, I'd like to propose the following changes:

* IOChannel will become the abstract interface (all methods are pure virtual).
* We should get rid of that init() member function. Constructor + open should be sufficient for initialization.
* getName() should become name() to comply with naming conventions (since there's no setName())
* AbstractIOChannel should be derived from IOChannel and implement the various read/write functions in terms of each other
* I think we should get rid of the Channel class template. It does not really add much. Or do I miss something?

guenter
 
Posts: 1119
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Re: IOChannel

Postby alex » 12 Jan 2008, 23:14

> A few comments on the interface.

> For having IOChannel in Foundation, I'd like to propose the following changes:

* IOChannel will become the abstract interface (all methods are pure virtual).
* We should get rid of that init() member function. Constructor + open should be sufficient for initialization.
* getName() should become name() to comply with naming conventions (since there's no setName())
* AbstractIOChannel should be derived from IOChannel and implement the various read/write functions in terms of each other
* I think we should get rid of the Channel class template. It does not really add much. Or do I miss something?

>

No, you did not miss anything. Channel is a leftover from early design phases. I agree with removing init() and I'm also thinking that one read() would be sufficient. In fact, I'm inclined to duplicate AsyncIOChannel/AsyncStreamChanel hierarchy in Foundation and then provide channel implementations and streams in IO. Does that sound like a reasonable strategy?

Alex
alex
 
Posts: 1115
Joined: 11 Jul 2006, 16:27
Location: United_States


Return to Contributors

Who is online

Users browsing this forum: No registered users and 1 guest