Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting array field with independent array #487

Closed
treiher opened this issue Nov 4, 2020 · 0 comments · Fixed by #509
Closed

Setting array field with independent array #487

treiher opened this issue Nov 4, 2020 · 0 comments · Fixed by #509
Assignees
Labels
generator Related to generator package (SPARK code generation)

Comments

@treiher
Copy link
Collaborator

treiher commented Nov 4, 2020

The code generator should allow setting an array field with the content of an independently created array (i.e. different context and buffer). This is needed to support cases where an array is created independently of the actual message. Here is a simple example:

state Send_Discover is
         Options : DHCP::Options;
         Parameter_Request_List : DHCP::Option_Codes;
      begin
         Parameter_Request_List'Append (DHCP::SUBNET_MASK_OPTION);
         Parameter_Request_List'Append (DHCP::ROUTER_OPTION);
         Parameter_Request_List'Append (DHCP::DOMAIN_NAME_OPTION);
         Parameter_Request_List'Append (DHCP::DOMAIN_NAME_SERVER_OPTION);
         Options'Append (
            DHCP::Option'(
               Code => DHCP::PARAMETER_REQUEST_LIST_OPTION,
               Len => Parameter_Request_List'Size,
               Parameter_Request_List => Parameter_Request_List
            )
         );

Currently, it is only possible to incrementally add array elements during the creation of a message. This approach does not fit well to appending an independently created array. It should be possible to copy the buffer of a valid array into the message buffer without iterating over all array elements again.

@treiher treiher added the generator Related to generator package (SPARK code generation) label Nov 4, 2020
@treiher treiher added this to To do in RecordFlux 0.5 via automation Nov 4, 2020
@treiher treiher self-assigned this Nov 17, 2020
@treiher treiher moved this from To do to In progress in RecordFlux 0.5 Nov 17, 2020
treiher added a commit that referenced this issue Nov 30, 2020
@treiher treiher moved this from In progress to Done in RecordFlux 0.5 Nov 30, 2020
treiher added a commit that referenced this issue Dec 1, 2020
treiher added a commit that referenced this issue Dec 1, 2020
treiher added a commit that referenced this issue Dec 1, 2020
treiher added a commit that referenced this issue Dec 1, 2020
treiher added a commit that referenced this issue Dec 1, 2020
RecordFlux 0.5 automation moved this from Done to Merged Dec 1, 2020
treiher added a commit that referenced this issue Dec 1, 2020
treiher added a commit that referenced this issue Dec 1, 2020
treiher added a commit that referenced this issue Dec 1, 2020
@treiher treiher mentioned this issue Aug 4, 2021
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
generator Related to generator package (SPARK code generation)
Projects
No open projects
RecordFlux 0.5
  
Merged
Development

Successfully merging a pull request may close this issue.

1 participant