Skip to content

feat: introduces fixed string type#42

Open
vulder wants to merge 35 commits into
mainfrom
feat/inplace_string
Open

feat: introduces fixed string type#42
vulder wants to merge 35 commits into
mainfrom
feat/inplace_string

Conversation

@vulder

@vulder vulder commented Apr 22, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

vulder and others added 30 commits April 21, 2026 22:29
Bumps [requests](https://github.com/psf/requests) from 2.32.5 to 2.33.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](psf/requests@v2.32.5...v2.33.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-version: 2.33.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.5.0 to 2.6.3.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](urllib3/urllib3@2.5.0...2.6.3)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-version: 2.6.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Florian Sattler <florian.sattler@airbus.com>
Query params parsing and routing to registered handlers.

Resolves SEN-1592
We need to ensure that the runner time is initialized before we publish
objects, as during the process we could emit events that, otherwise, get
a wrong timestamp.

resolves SEN-1640
… the kernel api

**BREAKING CHANGE**: The kernel logger configuration will now only
affect any other component's logger if the logger is created using the
getOrCreateLogger method specified in the description below.

The purpose is to keep spdlog statically linked while ensuring packages
can directly access the spdlog registry of the sen::kernel. Note: spdlog
is now a public dependency of the sen kernel.

resolves SEN-1632
During install we require the resources to be present, hence we need to
put them in the export set.
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.6.3 to 2.7.0.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](urllib3/urllib3@2.6.3...2.7.0)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-version: 2.7.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
#51)

Bumps [idna](https://github.com/kjd/idna) from 3.11 to 3.15.
- [Release notes](https://github.com/kjd/idna/releases)
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.md)
- [Commits](kjd/idna@v3.11...v3.15)

---
updated-dependencies:
- dependency-name: idna
  dependency-version: '3.15'
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@vulder vulder marked this pull request as ready for review May 24, 2026 10:27
@vulder vulder requested a review from EnriqueParodi as a code owner May 24, 2026 10:27

// NOLINTBEGIN(readability-identifier-naming)

template <typename CharT, size_t maxCapacity, typename Traits = std::char_traits<CharT>>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to add some brief documentation about the class, why/when to use it, and how it relates to std::string.

explicit constexpr FixedStringBase(std::string_view s) { assignRange(util::makeRange(s.begin(), s.end())); };

//------------------------------------------------------------------------------------------------------------------//
// Basic member functions

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: the separators for the "sections" in the class are not consistent. I would suggest to use what we already do in other clases (and partially in this one): use the visibility tags with a comment. For example:

class A
{
public:  // Type definitions
  // ...

public:  // Basic member functions
  // ...

public:  // Element access
  // ...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use similar separators in other places to (just with another underline) and I did not see any inconsistencies in the class.

I basically used the same grouping as with std::string from cppref, if you think it's better readable with additional public statement and a small comment right of it, I can rework that.

checkIdxInRange(idx);
SEN_DEBUG_ASSERT(idx + std::distance(charRange.begin(), charRange.end()) < maxCapacity + 1);

for (CharT c: charRange)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would memcpy be more performant?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, depends. A bit faster yes, the problem currently is just that (at least by the general interface), we cannot assume contiguous memory. The point currently is, some interfaces get InputIterators which do not guarantee really that the memory behind it is contiguous. I pers. don't really care, as most string usages are normally always contiguous but if some one would do something like this:

std::list<char> myLetters;
FixedString<6> str;
str.append(myLetters.begin(), myLetters.end()); // *boom

Another alternative could also be, to move the idx check out, so that the optimizer can better optimize the loop. But in the end it's a hard loop to optimize as the bounds are not always known.

assignRange(util::makeRange(first, last));
return *this;
}
FixedStringBase& assign(std::initializer_list<CharT> initList)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not related to this function in particular: we aren't documenting the functions, and my guess is that this is because we are following the semantics of std::string. Should we perhaps use \copydoc std::string::<function>?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, all public functions are a 1:1 correspondents with name and parameters to std::string/std::string_view.

I mean, we can copy all the docs from cppreference to here but I'm not sure if it would not just be enough to look at cpp ref std::string/_view if one wants the behavior/docu. I'm not aware of an automated way of pulling in the docu, as std::string in the std lib normally does also not ship docs, so doxygen linking that to it will not work.

@EnriqueParodi EnriqueParodi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice! just left some minor comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants