Skip to content
New issue

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

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

Already on GitHub? # to your account

Add fixed string size to readme #39

Merged
merged 5 commits into from
Jul 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,21 @@ A parameter is a YAML dictionary with the only required key being `type`.

The types of parameters in ros2 map to C++ types.

| Parameter Type | C++ Type |
|----------------|----------------------------|
| string | `std::string` |
| double | `double` |
| int | `int` |
| bool | `bool` |
| string_array | `std::vector<std::string>` |
| double_array | `std::vector<double>` |
| int_array | `std::vector<int>` |
| bool_array | `std::vector<bool>` |
| Parameter Type | C++ Type |
|-----------------|-----------------------------|
| string | `std::string` |
| double | `double` |
| int | `int` |
| bool | `bool` |
| string_array | `std::vector<std::string>` |
| double_array | `std::vector<double>` |
| int_array | `std::vector<int>` |
| bool_array | `std::vector<bool>` |
| string_fixed_XX | `FixedSizeString<XX>` |

Fixed size types are denoted with a suffix `_fixed_XX`, where `XX` is the desired size.
The corresponding C++ type is a data wrapper class for conveniently accessing the data.
Note that any fixed size type will automatically use a `size_lt` validator. Validators are explained in the next section.

### Built-In Validators
Validators are C++ functions that take arguments represented by a key-value pair in yaml.
Expand Down Expand Up @@ -272,7 +277,7 @@ See [example project](example/) for a complete example of how to use the generat
The generated code is primarily consists of two major components:
1) `struct Params` that contains values of all parameters and
2) `class ParamListener` that handles parameter declaration, updating, and validation.
The general structure is shown below.
The general structure is shown below.

```cpp
namespace cpp_namespace {
Expand Down