ok, now at least the structure is better

but there's still a problem with the new mechanism as the size of
the data isn't put into the pipe. I need to fix tis before someone could really use it...
This commit is contained in:
Andreas Volz 2010-08-12 23:14:45 +02:00
parent f0dcaa239f
commit 9af6f707eb
4 changed files with 52 additions and 39 deletions

View file

@ -43,6 +43,8 @@ public:
*/
void write(const void *buffer, unsigned int nbytes);
ssize_t read(void *buffer, unsigned int nbytes);
/*!
* Simply write one single byte into the pipe. This is a shortcut
* if there's really no data to transport, but to activate the handler.
@ -51,12 +53,12 @@ public:
private:
void(*_handler)(const void *data, void *buffer, unsigned int nbyte);
int fd_write;
int fd_read;
const void *data;
int _fd_write;
int _fd_read;
const void *_data;
// allow construction only in BusDispatcher
Pipe ();
Pipe (void(*handler)(const void *data, void *buffer, unsigned int nbyte), const void *data);
~Pipe () {};
friend class BusDispatcher;