Marshalling for a service

Hi all,
I'm a student working on a thesis on iTaSC. I have a question:
I created a service plugin (cpp) to monitor the output of a component. This service has many properties. I would like to add the marshalling service to my service but I can't figure out how to do this.
I included "#include <rtt/marsh/Marshalling.hp

" and used
"boost::shared_ptr<Marshalling> Marshalling = this->getProvider<RTT::Marshalling>("marshalling");" but I get:
"error: ‘class "class_name"’ has no member named ‘getProvider’".

I know getProvider is a method of the class "RTT::TaskContext" and I guess I shouldn't inherit this class in a service. Is there a way to use marshaling in a service? Should I create a component instead?

Best regards,
Alain

Marshalling for a service

Hi Alain,

Use the PropertyLoader class directly. It is quite easy to use and works
also for properties of services.

http://www.orocos.org/stable/documentation/rtt/v2.x/api/html/classRTT_1_...

Peter

On Mon, Apr 29, 2013 at 7:44 PM, Alain Scialoja <
alain [dot] scialoja [..] ...> wrote:

> Hi all,
> I'm a student working on a thesis on iTaSC. I have a question:
> I created a service plugin (cpp) to monitor the output of a component.
> This service has many properties. I would like to add the marshalling
> service to my service but I can't figure out how to do this.
> I included "#include <rtt/marsh/Marshalling.hp

" and used
> "boost::shared_ptr<Marshalling> Marshalling =
> this->getProvider<RTT::Marshalling>("marshalling");" but I get:
> "error: ‘class "class_name"’ has no member named ‘getProvider’".
>
> I know getProvider is a method of the class "RTT::TaskContext" and I
> guess I shouldn't inherit this class in a service. Is there a way to use
> marshaling in a service? Should I create a component instead?
>
> Best regards,
> Alain
>
>
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>
>

Marshalling for a service

Thank you Peter, The PropertyLoader worked like a charm. I used:

#include <rtt/marsh/PropertyLoader.hpp>
...
PropertyLoader pl(this);
pl.load("cpf/"conFile.cpf")
Alain