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

Remove TlmString, LogString, etc. from generated interface #407

Closed
4 tasks done
bocchino opened this issue Apr 12, 2024 · 0 comments · Fixed by #409
Closed
4 tasks done

Remove TlmString, LogString, etc. from generated interface #407

bocchino opened this issue Apr 12, 2024 · 0 comments · Fixed by #409
Assignees
Labels
code generation Issues related to code generation
Milestone

Comments

@bocchino
Copy link
Collaborator

bocchino commented Apr 12, 2024

String classes like TlmString and LogString appear in the auto-generated C++ component interface. For example, to pass a string argument to an event you have to pass a reference to LogString.

Based on a discussion with @timcanham and @LeStarch, these string classes provide a global truncation parameter. For example, requiring the user to store an event string argument in LogString ensures that the serialized string length is bounded by the minimum of (1) the size declared in the event specifier and (2) the max size of LogString.

As described in #406, we can have the auto-generated code truncate an arbitrary string directly to the min of the two sizes when serializing the string. We do not need the specialized string type to do this truncation. In this approach, the interface for sending commands and events is simpler, because you can pass in any string object to a const Fw::StringBase&. You don't need to first copy your string into the specific string type.

We can use LogString, etc. internally in the generated code, e.g., when declaring auto-generated variables. However, we should eliminate these types from the user interface as much as possible. The change described here should be transparent to user code that uses LogString, etc.

  • Revise events
  • Revise telemetry
  • Revise parameters
  • Revise commands
@bocchino bocchino added the code generation Issues related to code generation label Apr 12, 2024
@bocchino bocchino added this to the v2.1.0 milestone Apr 12, 2024
@bocchino bocchino self-assigned this Apr 12, 2024
@bocchino bocchino changed the title Remove CmdArgString, EventArgString, etc. Remove CmdArgString, EventArgString, etc. from generated code Apr 12, 2024
@bocchino bocchino changed the title Remove CmdArgString, EventArgString, etc. from generated code Remove CmdArgString, EventArgString, etc. from generated interface code Apr 17, 2024
@bocchino bocchino changed the title Remove CmdArgString, EventArgString, etc. from generated interface code Remove CmdArgString, EventArgString, etc. from generated interface Apr 17, 2024
@bocchino bocchino changed the title Remove CmdArgString, EventArgString, etc. from generated interface Remove CmdStringArg, LogString, etc. from generated interface Apr 17, 2024
@bocchino bocchino changed the title Remove CmdStringArg, LogString, etc. from generated interface Remove TlmString, LogString, etc. from generated interface Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code generation Issues related to code generation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant