-
Notifications
You must be signed in to change notification settings - Fork 134
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
Add documentation for generators and API #640
Conversation
Signed-off-by: Geoffrey Biggs <[email protected]>
Should the code templates for the generated files also be documented so that the generated type support APIs get documented? |
""" | ||
Generator class for generating the C implementation of the type support. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI is failing because pep257 thinks this can all be on one line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's see if this is enough c41fbcd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass. Thanks for doing this @gbiggs !
|
||
Parameters | ||
---------- | ||
argv : List[str] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gbiggs meta: if we're adding type annotations in docstrings, we may as well type annotate the code itself here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried here 1b972df
rosidl_typesupport_introspection_c__ROS_TYPE_CHAR = 4, | ||
/// Wide character, large enough to support Unicode code points. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gbiggs nit: I think we should specify this is a 16 bit character, which doesn't necessarily match wchar_t
size on every platform nor is enough for code points in every Unicode encoding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const char * name_; | ||
/// The type of the field as a value of the field types enum, | ||
/// e.g. rosidl_typesupport_introspection_c__ROS_TYPE_FLOAT | ||
uint8_t type_id_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gbiggs meta, preexisting: I wonder why don't we simply name that enum
type and use it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried 739b377
size_t string_upper_bound_; | ||
/// If the type_id_ value is rosidl_typesupport_introspection_c__ROS_TYPE_MESSAGE, | ||
/// this points to an array describing the fields of the sub-interface. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gbiggs nit: here we talk about a sub-interface, above we talk about an embedded message.
Consider sticking to one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not find the place where we referenced it as "embedded message". Could you please point me to it?
const rosidl_message_type_support_t * members_; | ||
/// True if this field is an array, false if it is a unary type. An array has the same value for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gbiggs hmm what do you mean by unary type? The IDL spec talks about base types, and rosidl_parser
talks about basic types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the reference to 'unary' type bd1c007
@@ -21,30 +21,53 @@ | |||
namespace rosidl_typesupport_introspection_cpp | |||
{ | |||
|
|||
/// Primitive (plain-old data) types supported by the ROS type system. | |||
|
|||
/// IEEE-754 binary32 format floating point number. | |||
const uint8_t ROS_TYPE_FLOAT = rosidl_typesupport_introspection_c__ROS_TYPE_FLOAT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gbiggs meta, preexisting: this is weird. Why not defining an equivalent enum
type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this one, skipped.
const char * name_; | ||
/// The type of the field as a value of the field types enum, | ||
/// e.g. rosidl_typesupport_introspection_c__ROS_TYPE_FLOAT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gbiggs I'd think this field deals with rosidl_typesupport_introspection_cpp::ROS_TYPE_*
values? Same below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed here c22fabc
// This is implemented in the shared library provided by this package. | ||
/// Returns a pointer to the type support structure provided by this library for introspecting | ||
/// interfaces. | ||
/// This is implemented in the shared library provided by this package. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to clarify it here 1b1d634
""" | ||
Generator class for generating the C++ implementation of the type support. | ||
|
||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improve description here 5eb8f06
const void * default_value_; | ||
/// If is_array_ is true, a pointer to a function that gives the size of one member of the array. | ||
/// Only used for nested interface types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gbiggs also, here and below, it may be worth mentioning that the first argument should be a pointer to the actual memory representation of the member.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment 2d013dc
I have the review changes ready but not sure if I can push them to this current PR from @gbiggs fork. |
This PR adds documentation to the type support APIs and generators for C and C++.
The documentation needs review by someone with a good understanding of
rosidl
, to ensure it is correct and identify any missing documentation.