On Tuesday, February 18, 2014 3:42:06 AM UTC, Öö Tiib wrote:
> On Monday, 17 February 2014 23:11:55 UTC+2,
woodb...@gmail.com wrote:
>
> > Here's the modified function:
> >
> > template <class R>
> > void Receive (::cmw::ReceiveBuffer<R>& buf
> > ,empty_container<cmw::File>& az1)
> > {
> > int32_t count[1];
> > for(count[0]=buf.template Give<uint32_t>();count[0]>0;--count[0]){
> > cmw::File{buf};
> > }
> > }
>
> Not too readable what it does.
OK, I believe I've improved things wrt this stuff now.
Noting that function called Receive above, I used to
have this usage:
empty_container<File> outputFiles;
remoteMessages.Receive(cmwBuf, outputFiles);
Now, as a developer of empty_container, I've
moved/reworked the code that was in that Receive
function to an empty_container constructor:
template <class R>
explicit empty_container (cmw::ReceiveBuffer<R>& buf)
{
int32_t count=buf.template Give<uint32_t>();
for(; count>0; --count){
T{buf};
}
}
And with that the usage is:
empty_container<File> outputFiles(cmwBuf);
> Array of ints with size 1 used instead of
> single int. Why?
If there are nested containers, I need to have
size > 1. There's an example on my homepage.
>If it fails with one file in loop how it is handled?
> Rest are reverted? Failed files are retried? How the whole thing resumes
> after failure here?
>
Nothing would be reverted. I think it's like
a build/make process that fails. Make doesn't
revert .obj files that have been built successfully.
Up until a week or so ago I was generating a header
and a source file (.cc) for each request. After
thinking about this thread, I decided to put
everything in a header. Now there's one file
of output for each request.
Brian
Ebenezer Enterprises - Wishing Ukraine peace and prosperity.
http://webEbenezer.net