Brian Wood writes:

>Recently, I suggested there should be serialization support wrt
>the Range library -
>http://lists.boost.org/Archives/boost/2008/01/132294.php.
>I'm writing to inform you of my plans in this regard.  This input:
>
>Msgs
>  (sub_range<list<short> >) @OUT
>}
>
>to the C++ Middleware Writer, http://home.seventy7.com/cgi-bin/samb.cgi,
>results in this output:
>
>#include <boost/range/sub_range.hpp>
>#include <list>
>#include <Buffer.hh>
>using boost::sub_range;
>
>
>struct Msgs
>{
>inline
>Msgs() {}
>inline
>~Msgs() {}
>
>inline
>int
>Send(Buffer* buf, const sub_range<list<short> >& about1)
>{
>  unsigned int headCount = 0;
>  headCount = about1.size();
>  if (!buf->Receive(&headCount, sizeof(int))) {
>    buf->ews_.SetErrorWords(1, __FILE__, __LINE__);
>    return 0;
>  }
>  list<short>::const_iterator rit1 = boost::begin(about1);
>  list<short>::const_iterator rit2 = boost::end(about1);
>  for (; rit1 != rit2; ++rit1) {
>    if (!buf->Receive(&(*rit1), sizeof(short))) {
>      buf->ews_.SetErrorWords(1, __FILE__, __LINE__);
>      return 0;
>    }
>  }
>
>  if (!buf->SendStoredData()) {
>    buf->ews_.SetErrorWords(2, __FILE__, __LINE__);
>    return 0;
> }
>  return 1;
>}
>
>};
>
>This functionality isn't available online yet. G-d willing, it
>will be available by the middle of next month.

Update: the functionality is now available online. 

 

Brian Wood

Ebenezer Enterprises

www.webebenezer.net