Dear all,
I'm trying to configure the ports of a component which I defined with a vector of ports:
RTT::OutputPort<double> outport_rfAnalog[8];
My question is about the definition of these ports in order to be connected from other components, I try to use the next configuration but it is not correct.
<struct name="Ports" type="PropertyBag"> ... <simple name="output_rfAnalog[1]" type="string"><value>output_rfAnalog_1</value></simple> <simple name="output_rfAnalog[2]" type="string"><value>output_rfAnalog_2</value></simple> <simple name="output_rfAnalog[3]" type="string"><value>output_rfAnalog_3</value></simple> ...
someone knows if it is possible to be used a vector of ports on configuration¿?
Thanks in advance
forget my post
Forget my post, is too early...i need a big cup of coffe.
regards,
forget my post
On Tue, Nov 15, 2011 at 7:24 AM, <antonio [dot] castellon [..] ...> wrote:
> Forget my post, is too early...i need a big cup of coffe.
>
:-)
One thing you should keep in mind is that you are not allowed to put
an InputPort/OutputPort in a std::vector<>. That's because ports can't
be copied (std::vector requires copy-able objects).
You need to statically allocate the array or use 'new' to dynamically
allocate an array of ports. Then use addPort and name them
accordingly.
Peter
forget my post
...but you can store InputPort/OutputPort pointers in a std::vector.
Even better, use BOOST pointer vector:
http://www.boost.org/doc/libs/1_47_0/libs/ptr_container/doc/ptr_containe...
Davide
On Tue, Nov 15, 2011 at 10:05 AM, Peter Soetens <peter [..] ...>wrote:
> On Tue, Nov 15, 2011 at 7:24 AM, <antonio [dot] castellon [..] ...> wrote:
> > Forget my post, is too early...i need a big cup of coffe.
> >
>
> :-)
>
> One thing you should keep in mind is that you are not allowed to put
> an InputPort/OutputPort in a std::vector<>. That's because ports can't
> be copied (std::vector requires copy-able objects).
> You need to statically allocate the array or use 'new' to dynamically
> allocate an array of ports. Then use addPort and name them
> accordingly.
>
> Peter
> --
> Orocos-Dev mailing list
> Orocos-Dev [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev
>