From: stephan b. <st...@s1...> - 2004-12-18 13:05:10
|
Yo again! Question: would it be feasible/realistic to add signals to IODevice. Something like: signalRead( const IODevice &, const char * buff, size_t count ); signalWrite( const IODevice &, const char * buff, size_t count ); The first arg is so that one client slot could listen to multiple IODs, but we wouldn't want them changing the IOD from the slot, thus the const. This would allow: a) send read/write progress feedback in, zB, a UI. b) me to plug in the s11n Serializers to IOD, by simply capturing read() input via a slot, then sending it to the Serializers via an istringstream copy of the input. (They're designed to read std::istreams and write to std::ostreams.) Or are there good reasons not to do this? Quasi-related: For streambuffer support, i'm thinking something like this: IODevice * my_io_device = new SomeIODevType(...); IODevStreambuf sb( my_io_device ); // ^^^^ basically proxies over/underflow() to read/write() std::ostream os( &sb ); // use any IODevice via any std::stream i don't know if it'll work, though. When i've tried to implement custom stream buffers i've failed horribly - the architecture, while sound, confuses me. Too many low-level details to track at once for my mind to keep up with. Hell, this support may already exist in P. If so, i haven't found it yet. -- ----- st...@s1... http://s11n.net "...pleasure is a grace and is not obedient to the commands of the will." -- Alan W. Watts |