Re: [boost] Question regarding logging, persistence, threadcommunication, network messaging and async frameworks

Scott Woods writes:
Hi, Is there a place in Boost for a library that tackles all of the above? I believe the realistic answer is no but I would be happy to be proven wrong. Work in the different areas mentioned in the subject line recently collapsed into a single underlying technique. Given the example UDT below; struct person { std::string name; std::vector<unsigned> score; std::set<string> team; }; persistence is achieved using; person new_member; codec_object<person> configuration( "profile" ) configuration << new_member; // Save in a disk file name "profile" configuration >> new_member; // Load from the same disk file transmitting the same object between threads looks like; send( new_member, other_thread ); while receiving that transmission occurs in code that looks like; my_thread::received( person &new_member ) { .. } Transmission of messages across networks looks like; send( new_member, socket_proxy ); Yes, its the same as for inter-thread communications. The "socket_proxy" just happens to be a variation on "my_thread" that forwards materials it receives onto a socket connection. Logging looks like; WINSOCK( socket, AF_INET << SOCK_STREAM << 0 ); COMMENTARY( "connection to " << address_entered << " failed (" << failure << ")" ); Logging messages can be routed anywhere based on the type and unique identity of the originating party. The fragments of code provided above hide a lot. While that's technically desirable I can appreciate that it might not flesh out my question at all (i.e. ...room in Boost). But actually this is precisely the most compelling thing about the library - it reduces code that traditionally can be quite difficult into fragments such as those shown.
Shalom From what you've shown it looks like the duplication of data members in serialization methods is not needed. Some have been struggling to eliminate the need for that duplication -- http://preview.tinyurl.com/6kpx8t . Maybe more details about codec_object<> would be helpful. Brian Wood Ebenezer Enterprises www.webEbenezer.net

Hi Brian, Apologies to other list members. I am experiencing very odd mail service that means I am not receiving messages on the Boost list sent by myself. Here's a brief response to Brian while I try to figure things out. ----- Original Message ----- From: "brass goowy" <brass@goowy.com> To: <boost@lists.boost.org> Sent: Monday, May 26, 2008 10:43 AM Subject: Re: [boost]Question regarding logging, persistence, threadcommunication, network messaging and async frameworks
Scott Woods writes:
Hi, Is there a place in Boost for a library that tackles all of the above? I believe the realistic answer is no but I would be happy to be proven wrong. Work in the different areas mentioned in the subject line recently collapsed into a single underlying technique. Given the example UDT below; struct person { std::string name; std::vector<unsigned> score; std::set<string> team; };
<snip>
actually this is precisely the most compelling thing about the library - it reduces code that traditionally can be quite difficult into fragments such as those shown.
Shalom
From what you've shown it looks like the duplication of data members in serialization methods is not needed. Some have been struggling to eliminate the need for that duplication -- http://preview.tinyurl.com/6kpx8t . Maybe more details about codec_object<> would be helpful.
I'm not so sure about that ;-) but in good faith; struct object_stack { typedef file_device device_type; typedef transfer_block<device_type> transfer_type; typedef binary_run_codec<transfer_type> codec_type; }; // Declaration of the left side (the device+transfer+object) // of the transfer. template<typename V,typename S=object_stack> struct codec_object { typedef V value_type; typedef S::codec_type codec_type; type_hash type; std::string base_name; std::string name_to_open; codec_type codec; void decorate( const std::string &s ) { name_to_open = base_name = s; name_to_open += '.'; name_to_open += codec.codec_tag(); } codec_object() : type( type_of<value_type>::hash() ) {} codec_object( const std::string &k ) : type( type_of<value_type>::hash() ) { decorate( k ); } void change_to( const std::string &k ) { decorate( k ); } }; I looked through the thread at "for each member of a sturcture/class ?" and not sure how to respond; the issue being dealt with in that thread (while interesting) is subordinate to my goals. I do not have any magic technique for avoiding duplication of member information. Any C++ type that wishes to play within my library must define the following two global operators; inline network_variant & operator<<( network_variant &nv, const person &p ) { network_memory::iterator i = network_output<3>()( nv ); *i++ << p.name; *i++ << p.score; *i++ << p.team; return nv; } inline person & operator>>( network_variant &nv, person &p ) { network_memory::iterator i = network_input<3>()( nv ); *i++ >> p.name; *i++ >> p.score; *i++ >> p.team; return p; } My library for persistence, thread communication and network messaging deals with the movement and representation of "network_variants", i.e. by providing transform functions as above, the type acquires persistence, transfer-between-threads and transfer-across-networks capabilities, in one hit. There is more to say in this area (type declaration) but I'm not sure that either of us was actually headed there. Scott.

Apologies to other list members. I am experiencing very odd mail service that means I am not receiving messages on the Boost list sent by myself.
I see you're using Outlook Express. This symptom is not your news server, but rather the flawed Outlook Express client. The bug in question is how OE deals with the sequence ID from the news server. If you post a message to a newsgroup, the server will ACK the request, but queue the message for posting. If you check for new headers before the server has serviced the post, OE will blindly ignore that message. If you wait a few minutes (for the server to complete the post) then OE will happily show your post inline as expected. It seems to be a bug in the internal database engine. Try Opera 9, or one of the many other free newsgroup clients. You will never experience that problem again. Eric

----- Original Message ----- From: "Eric Hill" <eric@ijack.net> To: <boost@lists.boost.org> Sent: Wednesday, May 28, 2008 5:58 AM Subject: Re: [boost] Question regarding logging, persistence,threadcommunication, network messaging and async frameworks
Apologies to other list members. I am experiencing very odd mail service that means I am not receiving messages on the Boost list sent by myself.
I see you're using Outlook Express. This symptom is not your news server, but rather the flawed Outlook Express client. The bug in question is how OE deals with the sequence ID from the news server. If you post a message to a newsgroup, the server will ACK the request, but queue the message for posting. If you check for new headers before the server has serviced the post, OE will blindly ignore that message. If you wait a few minutes (for the server to complete the post) then OE will happily show your post inline as expected. It seems to be a bug in the internal database engine.
Thanks Eric. Strange that its only done this after several years membership. But cant expect a bug to behave.

----- Original Message ----- From: "Eric Hill" <eric@ijack.net> To: <boost@lists.boost.org> Sent: Wednesday, May 28, 2008 5:58 AM Subject: Re: [boost] Question regarding logging, persistence,threadcommunication, network messaging and async frameworks
Apologies to other list members. I am experiencing very odd mail service that means I am not receiving messages on the Boost list sent by myself.
I see you're using Outlook Express. This symptom is not your news server, but rather the flawed Outlook Express client. The bug in question is how OE deals with the sequence ID from the news server. If you post a message to a newsgroup, the server will ACK the request, but queue the message for posting. If you check for new headers before the server has serviced the post, OE will blindly ignore that message. If you wait a few minutes (for the server to complete the post) then OE will happily show your post inline as expected. It seems to be a bug in the internal database engine.
Hmmm. Other details - I'm not accessing a news service. The OE client is using POP access to my GMail account. Recently turned off the deletion of mail in GMail and have been checking through the web interface. Contents of GMail and OE are the same. But this is no longer Boost related. Will continue the hunt.
participants (3)
-
brass goowy
-
Eric Hill
-
Scott Woods