[RTT-2.0] Adding service providers of ports to sub-service providers

Hi Orocos developers,

I'm getting started with RTT 2.0 and creating a component with a configurable
interface.

This means that I add sub service providers to the service provider of the
component during configureHook(). All of this works very well.

I also want to add ports during configureHook(). When I do this the service
provider of the port (write,read,connected, etc) are added to the top service
provider of the component. Would it be possible to make this configurable so
that I can put these services in a subservice of my choice?

Secondly I would like to know if it is possible to create a dataflow interface
without an existing TC so that i can already add ports to this dataflow
interface and afterwards add the ports of this dataflow interface to the
dataflow interface of a TC. Or even better add the dataflow interface as a sub
dataflow interface in the same way as I can already do for the service provider
interface.

Ruben

[RTT-2.0] Adding service providers of ports to sub-service provi

On Tuesday 29 June 2010 10:54:46 Ruben Smits wrote:
> Hi Orocos developers,
>
> I'm getting started with RTT 2.0 and creating a component with a
> configurable interface.
>
> This means that I add sub service providers to the service provider of the
> component during configureHook(). All of this works very well.
>
> I also want to add ports during configureHook(). When I do this the service
> provider of the port (write,read,connected, etc) are added to the top
> service provider of the component. Would it be possible to make this
> configurable so that I can put these services in a subservice of my
> choice?

It's certainly not impossible. Maybe you could even work around it with
something like:

ServiceProviderPtr port = provides("portname");
provides()->removeService("portname"); // remove from TC
provides("subservice")->addService( port ); // re-add in sub-service.

I never really liked the 'subservices'. If I recall correctly, it's only there
to help the hierarchical state machines in scripting, such that you can write
'sm.subsm.activate()' etc. But maybe other grouping use cases are out there
too...

>
> Secondly I would like to know if it is possible to create a dataflow
> interface without an existing TC so that i can already add ports to this
> dataflow interface and afterwards add the ports of this dataflow interface
> to the dataflow interface of a TC.

It is already possible to create a detached DataFlowInterface object and add
ports. What you'd need in addition is a mechanism to replace the DFI of a
TaskContext with this new one. I'm not sure I understand your case though.
What's the difference with storing ports in a std::vector ?

> Or even better add the dataflow
> interface as a sub dataflow interface in the same way as I can already do
> for the service provider interface.

This is not possible. It would also require huge changes on all levels (corba,
scripting, deployment, reporting,...) in order to cope with these 'children'.
I suggest you resolve that by using clever naming.

Peter