gazebosim / gazebosim/sdformat
GetElementCount for specific element name
- Dominant language
- C++
- Stars
- 216
- Forks
- 125
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 14
Description
**Original report ([archived issue](https://osrf-migration.github.io/sdformat-gh-pages/#!/osrf/sdformat/issues/206)) by Lorenzo Rapetti (Bitbucket: [lorrapetti](https://bitbucket.org/%7B163ad6dd-2725-4cbb-9d5f-7078d8891005%7D/)).**
----------------------------------------
Given that it is allowed to have multiple elements with the same name in a plugin, I think a function like `GetElementCount()` returning the number of element with a given name can be helpful.
For example when multiple elements with the same name are present in a plugin, using `GetElement()` returns a pointer to the first element found and you have no notice on the presence of other element with the same name (so sometimes it may be useful to check the presence of multiple elements with the given name).
Contributor guide
Research direction
Start at the Element API entry point GetElement and compare its behavior with the proposed GetElementCount() operation. The work is done when callers can count all elements with a given name instead of seeing only the first match returned by GetElement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100