[Plumbing] problem with SendHandleC::arg

Hi Peter,

The following code implementing my special collect with late collect
argument generation results in....

my_collect(internal::SendHandleC &shc, bool block)
{
std::vector<base::DataSourceBase::shared_ptr> coll_args;
internal::DataSource<bool>::shared_ptr ds_bool = new ValueDataSource<bool>(block);
SendStatus ss;
const types::TypeInfo *ti;
interface::OperationRepositoryPart *orp;
base::DataSourceBase::shared_ptr tmpdsb;

coll_args.push_back(shc.getSendHandleDataSource());

Logger::log(Logger::Info) << "getting orp:" << endlog();

/* get OperationRepositoryPart pointer contained in SendHandleC */
orp = shc.getOrp();

/* create appropriate datasources */
for(unsigned int i=1; i <= orp->collectArity(); i++) {
ti = orp->getCollectType(i);
Logger::log(Logger::Info) << "adding type '" << ti->getTypeName() << "'" << endlog();
tmpdsb = ti->buildValue();
Logger::log(Logger::Info) << "builtValue '" << tmpdsb->getTypeName() << "'" << endlog();
coll_args.push_back(tmpdsb);
}

shc.arg(coll_args);
ss = shc.collect();
}

a 'wrong_types_of_args_exception':

"std::exception: 'In argument 2: wrong type of argument: Expected type string &, received type unknown_t.'"

The debug output confirms that the DSB constructed is of type
"String".

Any idea what might be going wrong here? Must I pass in a
ReferenceDataSource instead of a ValueDataSource returned by
TypeInfo::buildValue ??

Thanks!
Markus

[Plumbing] problem with SendHandleC::arg

On Friday 02 July 2010 13:57:27 Markus Klotzbuecher wrote:
> Hi Peter,
>
> The following code implementing my special collect with late collect
> argument generation results in....

Your code looks partly correct. Whenever you see an unknown_t in places like
this, it refers to a SendHandle<T> in a datasource. So it looks like it
received the sendhandle as first *and* second argument. Could you remove its
datasource from the coll_args ?

Peter

[Plumbing] problem with SendHandleC::arg

On Friday 02 July 2010 14:14:19 Peter Soetens wrote:
> On Friday 02 July 2010 13:57:27 Markus Klotzbuecher wrote:
> > Hi Peter,
> >
> > The following code implementing my special collect with late collect
> > argument generation results in....
>
> Your code looks partly correct. Whenever you see an unknown_t in places
> like this, it refers to a SendHandle<T> in a datasource. So it looks like
> it received the sendhandle as first *and* second argument. Could you
> remove its datasource from the coll_args ?

So remove the line:

coll_args.push_back(shc.getSendHandleDataSource());

Peter

[Plumbing] problem with SendHandleC::arg

On Fri, Jul 02, 2010 at 02:18:14PM +0200, Peter Soetens wrote:
> On Friday 02 July 2010 14:14:19 Peter Soetens wrote:
> > On Friday 02 July 2010 13:57:27 Markus Klotzbuecher wrote:
> > > Hi Peter,
> > >
> > > The following code implementing my special collect with late collect
> > > argument generation results in....
> >
> > Your code looks partly correct. Whenever you see an unknown_t in places
> > like this, it refers to a SendHandle<T> in a datasource. So it looks like
> > it received the sendhandle as first *and* second argument. Could you
> > remove its datasource from the coll_args ?
>
> So remove the line:
>
> coll_args.push_back(shc.getSendHandleDataSource());

I remove that line and surprisingly got the same message as before. I
also printed coll_args.size() before the the call to shc.arg() which
was 1, which indicates that the original

coll_args.push_back(shc.getSendHandleDataSource())

was correct, no?

Markus

[Plumbing] problem with SendHandleC::arg

On Friday 02 July 2010 14:34:48 Markus Klotzbuecher wrote:
> On Fri, Jul 02, 2010 at 02:18:14PM +0200, Peter Soetens wrote:
> > On Friday 02 July 2010 14:14:19 Peter Soetens wrote:
> > > On Friday 02 July 2010 13:57:27 Markus Klotzbuecher wrote:
> > > > Hi Peter,
> > > >
> > > > The following code implementing my special collect with late collect
> > > > argument generation results in....
> > >
> > > Your code looks partly correct. Whenever you see an unknown_t in places
> > > like this, it refers to a SendHandle<T> in a datasource. So it looks
> > > like it received the sendhandle as first *and* second argument. Could
> > > you remove its datasource from the coll_args ?
> >
> > So remove the line:
> >
> > coll_args.push_back(shc.getSendHandleDataSource());
>
> I remove that line and surprisingly got the same message as before. I
> also printed coll_args.size() before the the call to shc.arg() which
> was 1, which indicates that the original
>
> coll_args.push_back(shc.getSendHandleDataSource())
>
> was correct, no?

Certainly not. The SendHandleC inserts the sendhandle data source itself prior
to calling produceCollect (see SendHandleC.cpp).

What was the signature of the method you're using here ? Ie how many
'return/out' arguments were there ?

Peter

[Plumbing] problem with SendHandleC::arg

On Fri, Jul 02, 2010 at 02:46:12PM +0200, Peter Soetens wrote:
> On Friday 02 July 2010 14:34:48 Markus Klotzbuecher wrote:
> > On Fri, Jul 02, 2010 at 02:18:14PM +0200, Peter Soetens wrote:
> > > On Friday 02 July 2010 14:14:19 Peter Soetens wrote:
> > > > On Friday 02 July 2010 13:57:27 Markus Klotzbuecher wrote:
> > > > > Hi Peter,
> > > > >
> > > > > The following code implementing my special collect with late collect
> > > > > argument generation results in....
> > > >
> > > > Your code looks partly correct. Whenever you see an unknown_t in places
> > > > like this, it refers to a SendHandle<T> in a datasource. So it looks
> > > > like it received the sendhandle as first *and* second argument. Could
> > > > you remove its datasource from the coll_args ?
> > >
> > > So remove the line:
> > >
> > > coll_args.push_back(shc.getSendHandleDataSource());
> >
> > I remove that line and surprisingly got the same message as before. I
> > also printed coll_args.size() before the the call to shc.arg() which
> > was 1, which indicates that the original
> >
> > coll_args.push_back(shc.getSendHandleDataSource())
> >
> > was correct, no?
>
> Certainly not. The SendHandleC inserts the sendhandle data source itself prior
> to calling produceCollect (see SendHandleC.cpp).

You're right.

> What was the signature of the method you're using here ? Ie how many
> 'return/out' arguments were there ?

one return, zero out: "string op_0()"

Markus

[Plumbing] problem with SendHandleC::arg

On Fri, Jul 02, 2010 at 01:57:27PM +0200, Markus Klotzbuecher wrote:
> Hi Peter,
>
> The following code implementing my special collect with late collect
> argument generation results in....
>
> my_collect(internal::SendHandleC &shc, bool block)
> {
> std::vector<base::DataSourceBase::shared_ptr> coll_args;
> internal::DataSource<bool>::shared_ptr ds_bool = new ValueDataSource<bool>(block);
> SendStatus ss;
> const types::TypeInfo *ti;
> interface::OperationRepositoryPart *orp;
> base::DataSourceBase::shared_ptr tmpdsb;
>
> coll_args.push_back(shc.getSendHandleDataSource());
>
> Logger::log(Logger::Info) << "getting orp:" << endlog();
>
> /* get OperationRepositoryPart pointer contained in SendHandleC */
> orp = shc.getOrp();
>
> /* create appropriate datasources */
> for(unsigned int i=1; i <= orp->collectArity(); i++) {
> ti = orp->getCollectType(i);
> Logger::log(Logger::Info) << "adding type '" << ti->getTypeName() << "'" << endlog();
> tmpdsb = ti->buildValue();
> Logger::log(Logger::Info) << "builtValue '" << tmpdsb->getTypeName() << "'" << endlog();
> coll_args.push_back(tmpdsb);
> }
>
> shc.arg(coll_args);
> ss = shc.collect();
> }
>
> a 'wrong_types_of_args_exception':
>
> "std::exception: 'In argument 2: wrong type of argument: Expected type string &, received type unknown_t.'"

I forgot: the exception is thrown in the line

shc.arg(coll_args);

> The debug output confirms that the DSB constructed is of type
> "String".
>
> Any idea what might be going wrong here? Must I pass in a
> ReferenceDataSource instead of a ValueDataSource returned by
> TypeInfo::buildValue ??

Markus