Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Conversation

@dawagner
Copy link
Contributor

@dawagner dawagner commented Nov 5, 2015

Numerical parameters as well as ParameterBlocks can have an "ArrayLength" attribute that instantiate as many identical parameters or parameter blocks.

This is now also possible for Component instances (not types).

The Semantic of this feature is very unclear, even now... use with caution.

  

@dawagner dawagner added this to the Version 3.1 milestone Nov 5, 2015
@dawagner dawagner changed the title Add "array" capability to Components [review] Add "array" capability to Components Nov 19, 2015
@dawagner
Copy link
Contributor Author

@tcahuzax @krocard please review.

@krocard
Copy link
Contributor

krocard commented Nov 19, 2015

👍

@tcahuzax
Copy link
Contributor

👎

@dawagner dawagner force-pushed the component-arrays branch 2 times, most recently from e63e15f to 416f784 Compare November 20, 2015 13:01
The assert was checking that the mapping key being added to an element's
mapping data was not already present. It seemed redundant with the subsequent
check that was returning an error if the name of the mapping key being added
was already present.

Returning an error to the user leads avoid crashing and produces clearer error
messages.

Signed-off-by: David Wagner <david.wagner@intel.com>
…lement

A instanciated configurable element may or may not need to be exported as XML
with a tag name that differs from its kind. Always rely on how the type must be
exported for this matter.

Signed-off-by: David Wagner <david.wagner@intel.com>
Numerical parameters as well as ParameterBlocks can have an "ArrayLength"
attribute that instantiate as many identical parameters or parameter blocks.

This is now also possible for Component instances (not types). When used, a
ParameterBlock is created with the name of the arrayed Component and as many
Components will be created with their names being "0", "1", "2", ...

    *** Use with caution! ***

You shouldn't define any context or instantiation mapping at or below the level
of the "arrayed" component. This also concerns the Component's type (since the
Component will inherit its type's mapping).

In other words, only use "ArrayLength" on components that do not have any
mapping and which content does not have any mapping either.

DO:

<ComponentType Name="MyType">
    <IntegerParameter Name="some_int" Size="8"/>
    <FixedPointParameter Name="some_fp" Size="8" Integral="1" Fractional="6"/>
</ComponentType>
<InstanceDefinition>
    <Component Type="MyType" ArrayLength="2"/>
</InstanceDefinition>

DON'T:

<ComponentType Name="MyType" Mapping="Ctx1:foo" Extends="SomeTypeWithMapping">
    <IntegerParameter Name="some_int" Size="8" Mapping="Instance:1"/>
    <FixedPointParameter Name="some_fp" Size="8" Integral="1" Fractional="6" Mapping="Instance:2"/>
</ComponentType>
<InstanceDefinition>
    <Component Type="MyType" ArrayLength="2" Mapping="Ctx2:bar"/>
</InstanceDefinition>

Signed-off-by: David Wagner <david.wagner@intel.com>
dawagner added a commit that referenced this pull request Nov 20, 2015
Add "array" capability to Components

Numerical parameters as well as ParameterBlocks can have an "ArrayLength"
attribute that instantiate as many identical parameters or parameter blocks.

This is now also possible for Component instances (not types).

The Semantic of this feature is very unclear, even now... use with caution and
see 416f784.
@dawagner dawagner merged commit 0ba8ce6 into intel:master Nov 20, 2015
@dawagner dawagner deleted the component-arrays branch November 20, 2015 13:14
@krocard krocard changed the title [review] Add "array" capability to Components Add "array" capability to Components Dec 29, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants