From 8bff1a217c6f92f6dd1750e6a993e25af3067176 Mon Sep 17 00:00:00 2001 From: Paul Gesel Date: Fri, 29 Jul 2022 07:50:50 -0600 Subject: [PATCH] add information on fixed size string --- README.md | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 1822a28..42ad844 100644 --- a/README.md +++ b/README.md @@ -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` | -| double_array | `std::vector` | -| int_array | `std::vector` | -| bool_array | `std::vector` | +| Parameter Type | C++ Type | +|-----------------|-----------------------------| +| string | `std::string` | +| double | `double` | +| int | `int` | +| bool | `bool` | +| string_array | `std::vector` | +| double_array | `std::vector` | +| int_array | `std::vector` | +| bool_array | `std::vector` | +| string_fixed_XX | `FixedSizeString` | + +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. @@ -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 {