[Rock-dev] Typleib container
Janosch Machowinski
Janosch.Machowinski at dfki.de
Wed Nov 12 13:53:29 CET 2014
Already found it.
Sorry for the noise.
Janosch
Am 12.11.2014 um 11:45 schrieb Janosch Machowinski:
> Hey,
> I get fails when trying to fill a typelib container.
> My code is :
> const Typelib::Container &cont = dynamic_cast<const Typelib::Container
> &>(value.getType());
> const Typelib::Type &indirect = cont.getIndirection();
> cont.init(value.getData());
>
> std::vector<ConfigValue *>::const_iterator it = array.values.begin();
>
> for(; it != array.values.end(); it++)
> {
> std::cout << "Got " << indirect.getName() << " size " <<
> indirect.getSize() << std::endl << std::flush;
>
> //TODO check, this may be a memory leak
> Typelib::Value *v = new Typelib::Value(new
> uint8_t[indirect.getSize()], indirect);
> applyConfOnTyplibValue(*v, *(*it));
>
> std::cout << "Before push " << std::endl << std::flush;
> cont.push(value.getData(), *v);
> }
> std::cout << "Array done " << std::endl << std::flush;
>
> The fail happens if I push a container of a container.
> It is actually a bad alloc in the Typelib::ValueOps::copy() function.
>
> Any ideas ?
>
> Janosch
>
--
Dipl. Inf. Janosch Machowinski
SAR- & Sicherheitsrobotik
Universität Bremen
FB 3 - Mathematik und Informatik
AG Robotik
Robert-Hooke-Straße 1
28359 Bremen, Germany
Zentrale: +49 421 178 45-6611
Besuchsadresse der Nebengeschäftstelle:
Robert-Hooke-Straße 5
28359 Bremen, Germany
Tel.: +49 421 178 45-6614
Empfang: +49 421 178 45-6600
Fax: +49 421 178 45-4150
E-Mail: jmachowinski at informatik.uni-bremen.de
Weitere Informationen: http://www.informatik.uni-bremen.de/robotik
More information about the Rock-dev
mailing list