You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(188) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(59) |
Feb
(13) |
Mar
(4) |
Apr
(1) |
May
(15) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: stephan b. <st...@s1...> - 2004-12-18 01:37:43
|
Yo again... random notes... i've implemented IODevice::read(std::string&,size_t) as non-virtual in IODevice. Anyway... it looks like this: Add the decl in piodevice.h: //! Same as read(char*,size_t) but writes to the given std::string size_t read( std::string & buffer, size_t count ) throw(IOError); Implement in piodevice.common.cpp: size_t IODevice::read( std::string & buffer, size_t count ) throw(IOError) { typedef std::vector<char> VC; VC v(count,'\0'); size_t ret = this->read( &v[0], count ); buffer = (0 == ret) ? "" : std::string( v.begin(), v.begin() + ret ); return ret; } And (unfortunately) copy/paste that for IORequest_Get, but renaming the function to receive(). A test app is attached, BUT... i can't test it, because i'm always getting an abort() somewhere in PIO: stephan@owl:~/src/pclasses-1.0.0beta1/demo> gdb --args .libs/httpclient http://s11n GNU gdb 6.2.1 <snip> Starting program: /home/stephan/src/pclasses-1.0.0beta1/demo/.libs/httpclient http://s11n [Thread debugging using libthread_db enabled] [New Thread 1078314848 (LWP 16516)] URL=[http://s11n/] Program received signal SIGABRT, Aborted. [Switching to Thread 1078314848 (LWP 16516)] 0xffffe410 in ?? () (gdb) bt #0 0xffffe410 in ?? () #1 0xbfffed88 in ?? () #2 0x00000006 in ?? () #3 0x00004084 in ?? () #4 0x40364d41 in raise () from /lib/tls/libc.so.6 #5 0x40366529 in abort () from /lib/tls/libc.so.6 #6 0x40063eaf in P::CrashHandler::terminate () from /home/stephan/lib/libpcore.so.1 #7 0x402f2c25 in __cxxabiv1::__terminate () from /usr/lib/libstdc++.so.5 #8 0x402f2c62 in std::terminate () from /usr/lib/libstdc++.so.5 #9 0x402f2da2 in __cxa_throw () from /usr/lib/libstdc++.so.5 #10 0x40028ac9 in P::IOManager::findCreateHandler () from /home/stephan/lib/libpio.so.1 #11 0x400287d5 in P::IOManager::get () from /home/stephan/lib/libpio.so.1 #12 0x08049137 in main () where http://s11n/ is a copy of s11n.net on my local box. i can't believe how long i had to fight with autotools to get demo/Makefile to pick up my test app, though (i hate the autotools). i ended up having to sed demo/Makefile and replace httpclient.cpp with my test. Here's my plan for P vis-a-vis s11n: i'd like to implement an i/o layer for s11n which uses P streams, so we can do this: typedef MySerializableType ST; ST s; // ... use s ... P::s11n::serialize( s, "url" ); or: P::s11n::serialize( s, IODevice & ) and: MyType * o = P::s11n::deserialize<MyType>( IODevice & | url ); That mirrors the current s11nlite API, and actually isn't much work. i just found the std::iostream compat P code, and now i'm a Very Happy Camper :). i see how the API would work for P::FileStream, but i don't see an IOStream connection to, e.g., an arbitrary IODevice. Integration of s11n support will be trivial, at least for FileStream objects. Essentially all that is needed is that i write a wrapper very similar to the existing "s11nlite" layer. (Or implement the dynamic stream support i wrote about earlier and re-implement s11n's stream handler in terms of that.) With that in place, any type of s11n-supported object can be de/serialized via PStreams and, potentially, arbitrary IODevices. That means network-transparent de/serialization, which would be Really Cool! Save your objects over ftp: P::s11n::serialize( myobject, "ftp://server/path/to/file" ); This empowers all sorts of web-based support, too, like reading/writing db-based data via an http proxy: P::s11n::serialize( myobject, "http://s11n.myserver.net/save?node_name=MyObjectName" ); where 'save' is a CGI script that reads myobject (which is serialized to an arbitrary s11n-supported format) and converts that to/from db data (perhaps using the existing s11n::io::mysql_serializer). Likewise: MyType * o = P::s11n::deserialize<MyType>("http://.../load?node_name=..."); The implications of this in P's "generic application framework" are tremendous!!! :) -- ----- st...@s1... http://s11n.net "...pleasure is a grace and is not obedient to the commands of the will." -- Alan W. Watts |
From: stephan b. <st...@s1...> - 2004-12-18 00:02:05
|
Yo again! i've got a little lib, called zfstream, which adds client-transparent support for loading compressed files. For some months i've been thinking about making a more generic variant of it which can be extended by registering handlers. Looking at your I/O layer, believe that code would be a great basis for it. To give some background/context... consider this code: std::istream * is = zfstream::get_istream( "some_file" ); if( ! is ) { file not found or could not be opened } The input stream might actually be a compressed file, and the stream might be of type gzstream or bzstream (for gzip or bzip2, respectively). get_istream() examines the file to determine which type of decompressor to use, and passes back the appropriate stream type. The same goes for output files: Set the framework-wide policy: zfstream::compression_policy( zfstream::GZipCompression ) Now all calls like these use the requested compression: std::ostream * os = zfstream::get_ostream( "some_file" ); The ostream is compressed if the lib supports it (if configure script finds zlib) and if compression_policy() specifies it. If not, you get back an uncompressed stream. The point is, client code doesn't know if it's using compressed streams or not, and doesn't have to know. By making that more generic and adding handlers for your I/O classes, we could do: SomeIORequestBase * os = get_ostream( "http://s11n.net/s11n/sample.s11n.gz" ); and that might return a gzip-decompressing stream type. i've tried a couple times to implement custom std::streambuffer classes and i've failed miserably. Anyone out there who thinks that it isn't too much work to write std-stream wrappers for the P::IO layer? Take care, -- ----- st...@s1... http://s11n.net "...pleasure is a grace and is not obedient to the commands of the will." -- Alan W. Watts |
From: stephan b. <st...@s1...> - 2004-12-17 23:38:11
|
Yo again: IORequest_Get::receive( char *, size_t ); Could i convince you guys to either: a) Add receive( std::string &, size_t ); or b) give me CVS write access so i can? (SF user == sgbeal) ?? It can be implemented in terms of the current receive() by passing a vector<char> to the existing function, then simply copying the result to a std::string. Something like: size_t receive( std::string & s, size_t count ) { typedef vector<char> VC; VC v( count, '\0' ); size_t ret = receive( &v[0], v.size() ); s = std::string( v.begin(), v.begin() + ret ); return ret; } (achtung: untested) (achtung #2: when i find exciting code i send lots of mails. ;) -- ----- st...@s1... http://s11n.net "...pleasure is a grace and is not obedient to the commands of the will." -- Alan W. Watts |
From: stephan b. <st...@s1...> - 2004-12-17 23:28:57
|
On Friday 17 December 2004 23:45, stephan beal wrote: > atalkaddr.cpp: In constructor `P::ATalkAddress::ATalkAddress()': > patalkaddr.cpp:39: error: invalid application of `sizeof' to an > incomplete type Solved: installed netatalk-devel and the compulsory kludge in patalkaddr.h: Replace: struct at_addr; with: struct atalk_addr; #define at_addr atalk_addr configure script apparently doesn't check for appletalk, or the makefiles don't properly accommodate when it's not there. Take care, -- ----- st...@s1... http://s11n.net "...pleasure is a grace and is not obedient to the commands of the will." -- Alan W. Watts |
From: stephan b. <st...@s1...> - 2004-12-17 22:57:13
|
Hi again! Again - i'm new to pclasses, just learned about it today. After glancing over the Doxygen docs a bit, i'm a Happy Camper :). i've got a couple comments, if i may... (Marc, please ignore the mail i just sent directly to you - this is list stuff, i think, so i'll repost it here...) pclasses is DEFINATELY something i'm interested in. i'm a big fan of UI-neutral frameworks of this type. i've been piddling around with some ideas for a couple years regarding a ui-neutral "UI" toolkit, called "noui", which abstracts Widgets into a UI-neutral layer, relying on a signals/slots layer to translate changes to/from UI-toolkit wrappers. It looks like a combination of s11n and pclasses would provide what i would need to turn the noui idea into not only an abstract "non-UI" toolkit, but also an abstract "non-desktop" framework, like a "nokde". i, too, have tinkered with ideas similar to your SimpleApp class, and i LOVE that someone (you) has put together a framework for this. My original intention for such a type was to support my 'eshell' framework (http://s11n.net/eshell/), and eventually to extend that to the "noui" framework. To be clear: the noui idea is all theoretical, with very little actual code, primarily because of my lack of a really flexible signals/slots implementation. i've got a sigslot lib (http://s11n.net/sigslot/), which i ripped off from Sourceforge, but it's got a couple limitations which keep me away from using it widespread. i don't yet know if pclasses has the same limitations (or others). pclasses provides the network layer, too, which is really cool. i'm hoping i can build an s11n-capable network layer on top of it. :) (http://s11n.net/, of course ;). Anyway... thanks again to Marc for the referral to your project. As soon as i can compile it i will start tinkering. :) -- ----- st...@s1... http://s11n.net "...pleasure is a grace and is not obedient to the commands of the will." -- Alan W. Watts |
From: stephan b. <st...@s1...> - 2004-12-17 22:46:27
|
Yo, pclasses guys! i was referred to your project today by Marc, and am very interested in=20 trying out pclasses. Unfortunately... stephan@owl:~/src/pclasses-1.0.0beta1> gcc --version gcc (GCC) 3.3.4 (pre 3.3.5 20040809) (Suse Linux 9.2) =2E.. atalkaddr.cpp: In constructor `P::ATalkAddress::ATalkAddress()': patalkaddr.cpp:39: error: invalid application of `sizeof' to an=20 incomplete type patalkaddr.cpp: In constructor `P::ATalkAddress::ATalkAddress(const=20 at_addr&)': patalkaddr.cpp:51: error: invalid application of `sizeof' to an=20 incomplete type patalkaddr.cpp:53: error: invalid application of `sizeof' to an=20 incomplete type patalkaddr.cpp: In constructor `P::ATalkAddress::ATalkAddress(const =C2=A0 =C2=A0std::string&)': patalkaddr.cpp:57: error: invalid application of `sizeof' to an=20 incomplete type patalkaddr.cpp: In member function `P::ATalkAddress& =C2=A0 =C2=A0P::ATalkAddress::operator=3D(const at_addr&)': patalkaddr.cpp:79: error: invalid application of `sizeof' to an=20 incomplete type i can't find the definition of at_addr, only a forward decl in=20 pataladdr.h. Any quick workaround would be really cool. :) There are also a couple of warnings, but those aren't stopping my build: piodevice.posix.cpp: In member function `virtual off64_t=20 P::IODevice::seek(long =C2=A0 =C2=A0long unsigned int, P::IODevice::seekMode_t)': piodevice.posix.cpp:189: warning: comparison between signed and unsigned =C2=A0 =C2=A0integer expressions pfilemon.fam.cpp: In member function `bool =C2=A0 =C2=A0P::FileMonitor::wait(P::FileMonitor::Event&, unsigned int)': pfilemon.fam.cpp:177: warning: label `_select' defined but not used pthreadpool.cpp: In member function `void =C2=A0 =C2=A0P::ThreadPool::finished(P::WorkerThread*)': pthreadpool.cpp:162: warning: unused variable `P::ThreadJob*job' Take care, =2D-=20 =2D---- st...@s1... http://s11n.net "...pleasure is a grace and is not obedient to the commands of the will." -- Alan W. Watts |