Skip to content

Commit 087f056

Browse files
committed
Revise/simplify comments
1 parent 5ce734b commit 087f056

File tree

6 files changed

+21
-40
lines changed

6 files changed

+21
-40
lines changed

object.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Macros follow the same pattern:
2222

2323
``DEFINE_FSTR_*``
2424
Creates a static data structure with an associated Object reference.
25-
The _LOCAL variant makes the reference static.
25+
The _LOCAL variant makes the reference ``static constexpr``.
2626

2727
``DECLARE_FSTR_*``
2828
Use this in a header to declare Object reference so it can be used across

src/include/FlashString/Array.hpp

+6-7
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@
5050
DEFINE_FSTR_REF_NAMED(name, FSTR::Array<ElementType>);
5151

5252
/**
53-
* @brief Define an Array Object with local reference
54-
* @param name Name of Array& reference to define
55-
* @param ElementType
56-
* @param ... List of ElementType items
53+
* @brief Like DEFINE_FSTR_ARRAY except reference is declared static constexpr
5754
*/
5855
#define DEFINE_FSTR_ARRAY_LOCAL(name, ElementType, ...) \
5956
static DEFINE_FSTR_ARRAY_DATA(FSTR_DATA_NAME(name), ElementType, __VA_ARGS__); \
@@ -98,12 +95,14 @@
9895
* @param name Name for the Array object
9996
* @param ElementType Array element type
10097
* @param file Absolute path to the file containing the content
101-
* @See See also `IMPORT_FSTR_DATA`
102-
* @{
98+
* @see See also `IMPORT_FSTR_DATA`
10399
*/
104100
#define IMPORT_FSTR_ARRAY(name, ElementType, file) IMPORT_FSTR_OBJECT(name, FSTR::Array<ElementType>, file)
101+
102+
/**
103+
* @brief Like IMPORT_FSTR_ARRAY except reference is declared static constexpr
104+
*/
105105
#define IMPORT_FSTR_ARRAY_LOCAL(name, ElementType, file) IMPORT_FSTR_OBJECT_LOCAL(name, FSTR::Array<ElementType>, file)
106-
/** @} */
107106

108107
namespace FSTR
109108
{

src/include/FlashString/Map.hpp

+2-12
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,7 @@
5454
DEFINE_FSTR_REF_NAMED(name, DECL((FSTR::Map<KeyType, ContentType>)));
5555

5656
/**
57-
* @brief Define a Map Object with local reference
58-
* @name Name of the Map& reference to define
59-
* @param KeyType Integral type to use for key
60-
* @param ContentType Object type to declare for content
61-
* @param ... List of MapPair definitions { key, &content }
62-
* @note Size will be calculated
57+
* @brief Like DEFINE_FSTR_MAP except reference is declared static constexpr
6358
*/
6459
#define DEFINE_FSTR_MAP_LOCAL(name, KeyType, ContentType, ...) \
6560
static DEFINE_FSTR_MAP_DATA(FSTR_DATA_NAME(name), KeyType, ContentType, __VA_ARGS__); \
@@ -78,12 +73,7 @@
7873
DEFINE_FSTR_REF_NAMED(name, DECL((FSTR::Map<KeyType, ContentType>)));
7974

8075
/**
81-
* @brief Define a Map Object with local reference, specifying the number of elements
82-
* @name Name of the Map& reference to define
83-
* @param KeyType Integral type to use for key
84-
* @param ContentType Object type to declare for content
85-
* @param size Number of elements
86-
* @param ... List of MapPair definitions { key, &content }
76+
* @brief Like DEFINE_FSTR_MAP_SIZED except reference is declared static
8777
*/
8878
#define DEFINE_FSTR_MAP_SIZED_LOCAL(name, KeyType, ContentType, size, ...) \
8979
static DEFINE_FSTR_MAP_DATA_SIZED(FSTR_DATA_NAME(name), KeyType, ContentType, size, __VA_ARGS__); \

src/include/FlashString/Object.hpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -93,20 +93,21 @@
9393
* @param name Name for the object
9494
* @param ObjectType Object type for reference
9595
* @param file Absolute path to the file containing the content
96-
* @See See also `IMPORT_FSTR_DATA`
96+
* @see See also `IMPORT_FSTR_DATA`
9797
* @note Can only be used at file scope
98-
* @{
9998
*/
10099
#define IMPORT_FSTR_OBJECT(name, ObjectType, file) \
101100
IMPORT_FSTR_DATA(FSTR_DATA_NAME(name), file) \
102101
extern "C" const FSTR::ObjectBase FSTR_DATA_NAME(name); \
103102
DEFINE_FSTR_REF(name, ObjectType, FSTR_DATA_NAME(name));
104103

104+
/**
105+
* @brief Like IMPORT_FSTR_OBJECT except reference is declared static constexpr
106+
*/
105107
#define IMPORT_FSTR_OBJECT_LOCAL(name, ObjectType, file) \
106108
IMPORT_FSTR_DATA(FSTR_DATA_NAME(name), file) \
107109
extern "C" const FSTR::ObjectBase FSTR_DATA_NAME(name); \
108110
static constexpr DEFINE_FSTR_REF(name, ObjectType, FSTR_DATA_NAME(name));
109-
/** @} */
110111

111112
namespace FSTR
112113
{

src/include/FlashString/String.hpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@ typedef const __FlashStringHelper* flash_string_t;
7979
DEFINE_FSTR_REF_NAMED(name, FSTR::String);
8080

8181
/**
82-
* @brief Define a FSTR::String object with local reference
83-
* @param name Name of FSTR::String& reference to define
84-
* @param str Content of the FSTR::String
82+
* @brief Like DEFINE_FSTR except reference is declared static constexpr
8583
*/
8684
#define DEFINE_FSTR_LOCAL(name, str) \
8785
static DEFINE_FSTR_DATA(FSTR_DATA_NAME(name), str); \
@@ -130,12 +128,14 @@ typedef const __FlashStringHelper* flash_string_t;
130128
* @brief Define a FSTR::String containing data from an external file
131129
* @param name Name for the FSTR::String object
132130
* @param file Absolute path to the file containing the content
133-
* @See See also `IMPORT_FSTR_DATA`
134-
* @{
131+
* @see See also `IMPORT_FSTR_DATA`
135132
*/
136133
#define IMPORT_FSTR(name, file) IMPORT_FSTR_OBJECT(name, FSTR::String, file)
134+
135+
/**
136+
* @brief Like IMPORT_FSTR except reference is declared static constexpr
137+
*/
137138
#define IMPORT_FSTR_LOCAL(name, file) IMPORT_FSTR_OBJECT_LOCAL(name, FSTR::String, file)
138-
/** @} */
139139

140140
/**
141141
* @brief declare a table of FlashStrings

src/include/FlashString/Vector.hpp

+2-11
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,7 @@
5050
DEFINE_FSTR_REF_NAMED(name, FSTR::Vector<ObjectType>);
5151

5252
/**
53-
* @brief Define a Vector Object with local reference
54-
* @param name Name of Vector& reference to define
55-
* @param ObjectType
56-
* @param ... List of ObjectType* pointers
57-
* @note Size will be calculated
53+
* @brief Like DEFINE_FSTR_VECTOR except reference is declared static constexpr
5854
*/
5955
#define DEFINE_FSTR_VECTOR_LOCAL(name, ObjectType, ...) \
6056
static DEFINE_FSTR_VECTOR_DATA(FSTR_DATA_NAME(name), ObjectType, __VA_ARGS__); \
@@ -73,12 +69,7 @@
7369
DEFINE_FSTR_REF_NAMED(name, FSTR::Vector<ObjectType>);
7470

7571
/**
76-
* @brief Define a Vector Object with local reference, specifying the number of elements
77-
* @param name Name of Vector& reference to define
78-
* @param ObjectType
79-
* @param size Number of elements
80-
* @param ... List of ObjectType* pointers
81-
* @note Use in situations where the array size cannot be automatically calculated
72+
* @brief Like DEFINE_FSTR_VECTOR_SIZED except reference is declared static constexpr
8273
*/
8374
#define DEFINE_FSTR_VECTOR_SIZED_LOCAL(name, ObjectType, size, ...) \
8475
static DEFINE_FSTR_VECTOR_DATA_SIZED(FSTR_DATA_NAME(name), ObjectType, size, __VA_ARGS__); \

0 commit comments

Comments
 (0)