Re: method with arguments

"Klaas Gadeyne" <[email protected]> Wed, 13 Sep 2006 13:19:54 +0200
Newsgroups gmane.science.robotics.orocos.user
Message-ID <a7b55b4a0609130419p495871fcw98eea0b2a940f63c__35950.5939799876$1158153205$gmane$org@mail.gmail.com>
[...]
> I'm trying to create a method with (multiple) arguments, and I keep getting compile errors.
>
> I changed the code from HelloWorld to keep it simple:
>
> Method declaration:
> >From       Method<std::string(void)> method;
> To         Method<std::string(double)> method;
>
> Method itself:
> >From    std::string mymethod() { ..code with return.. }
> To      std::string mymethod(double x) { ..code with x and return.. }
>
> The other lines remain the same.
> Or should the interface setup line be changed aswell?

The add method call also requires extra args now.

this->methods()->addMethod(&method, "Hello Method Description",
                                   "double","double description");

ps.  Please post technical questions on the orocos-dev list.

regards,

Klaas