templated components

Howdy,

Say I have a bit of logic within a component that could feasibly work on
different data types. As far as I know, the only way to implement this
is to have multiple compiled components (one for each potential data
type) that get deployed appropriately. This seems inefficient, from a
developer's perspective.

Is it possible to create a templated component, such that the data type
it operates on is determined at deployment instead of compile time?

templated components

Hi Dustin,

On Fri, Sep 07, 2012 at 11:03:39AM -0500, Dustin Gooding wrote:

> Say I have a bit of logic within a component that could feasibly work on
> different data types. As far as I know, the only way to implement this is to
> have multiple compiled components (one for each potential data type) that get
> deployed appropriately. This seems inefficient, from a developer's
> perspective.
>
> Is it possible to create a templated component, such that the data type it
> operates on is determined at deployment instead of compile time?

You could write a templated component to customize the datatype, but
that will then be a compile time choice, not deployment time. Strictly
deployment time is not so easy. The easiest way would be to write a
Lua component, but that is inefficient for heavy computations. It also
depends on what range of data this component needs to deal with.

Markus

templated components

Yeah, maybe "templated" was the wrong word for me to use (as they're
obviously compile-time choices). Aside from boost::variant or something
similar, I don't see an easy way to make a single component handle
different data types. Oh well. Not a huge deal. Thanks though.

*Dustin Gooding*
NASA/JSC Robotics

On 09/10/2012 03:19 AM, Markus Klotzbuecher wrote:
> Hi Dustin,
>
> On Fri, Sep 07, 2012 at 11:03:39AM -0500, Dustin Gooding wrote:
>
>> Say I have a bit of logic within a component that could feasibly work on
>> different data types. As far as I know, the only way to implement this is to
>> have multiple compiled components (one for each potential data type) that get
>> deployed appropriately. This seems inefficient, from a developer's
>> perspective.
>>
>> Is it possible to create a templated component, such that the data type it
>> operates on is determined at deployment instead of compile time?
> You could write a templated component to customize the datatype, but
> that will then be a compile time choice, not deployment time. Strictly
> deployment time is not so easy. The easiest way would be to write a
> Lua component, but that is inefficient for heavy computations. It also
> depends on what range of data this component needs to deal with.
>
> Markus
>
>
>