orocos-toolchain / ocl

Orocos Component Library
Other
16 stars 33 forks source link

lua: fixed repeated calls of SendHandle.collectIfDone(...) #32

Closed meyerj closed 8 years ago

meyerj commented 9 years ago

Sending operation in Lua returns a representation of the underlying SendHandleC instance. SendHandleC can only be "filled" with result data sources once. Subsequent calls of SendHandleC::arg(...) print the warning message "Extra argument discarded for SendHandleC." and there is no API call to reset it without resending the operation.

Because of this the previous implementation of __SendHandle_collect() implementing SendHandle.collectIfDone() was broken for the case where no additional arguments are given. The result datasources cannot be constructed dynamically if collectIfDone() does not return immediately with SendSuccess.

It should be noted that only the data sources given as arguments in the first collect()/collectIfDone() call after sending will be filled with results. Subsequent calls must have the same arguments.