Message ID | 20250109115412.356768-2-stefan.klug@ideasonboard.com |
---|---|
State | New |
Headers | show |
Series |
|
Related | show |
On Thu, Jan 09, 2025 at 12:53:52PM +0100, Stefan Klug wrote: > The only way to access the internal data of an Interpolator is through > the getInterpolated() method. Sometimes it is necessary to to access the > internal data directly to iterate over it. Add an accessor for that. > > While at it, remove a line break from the doxygen documentation for > interpolate() so that doxygen is able to correctly match the function. > > Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> > --- > src/ipa/libipa/interpolator.cpp | 10 ++++++++-- > src/ipa/libipa/interpolator.h | 5 +++++ > 2 files changed, 13 insertions(+), 2 deletions(-) > > diff --git a/src/ipa/libipa/interpolator.cpp b/src/ipa/libipa/interpolator.cpp > index 73e8d3b7de14..f901a86e4c74 100644 > --- a/src/ipa/libipa/interpolator.cpp > +++ b/src/ipa/libipa/interpolator.cpp > @@ -125,6 +125,13 @@ namespace ipa { > * Overwrites the internal map using move semantics. > */ > > +/** > + * \fn std::map<unsigned int, T> &Interpolator<T>::data() const > + * \brief Access the internal map > + * > + * \return The internal map > + */ > + > /** > * \fn const T& Interpolator<T>::getInterpolated() > * \brief Retrieve an interpolated value for the given key > @@ -136,8 +143,7 @@ namespace ipa { > */ > > /** > - * \fn void Interpolator<T>::interpolate(const T &a, const T &b, T &dest, double > - * lambda) > + * \fn void Interpolator<T>::interpolate(const T &a, const T &b, T &dest, double lambda) > * \brief Interpolate between two instances of T > * \param a The first value to interpolate > * \param b The second value to interpolate > diff --git a/src/ipa/libipa/interpolator.h b/src/ipa/libipa/interpolator.h > index fffce21465fe..7880db6976d1 100644 > --- a/src/ipa/libipa/interpolator.h > +++ b/src/ipa/libipa/interpolator.h > @@ -81,6 +81,11 @@ public: > lastInterpolatedKey_.reset(); > } > > + const std::map<unsigned int, T> &data() const > + { > + return data_; > + } > + > const T &getInterpolated(unsigned int key, unsigned int *quantizedKey = nullptr) > { > ASSERT(data_.size() > 0); > -- > 2.43.0 >
diff --git a/src/ipa/libipa/interpolator.cpp b/src/ipa/libipa/interpolator.cpp index 73e8d3b7de14..f901a86e4c74 100644 --- a/src/ipa/libipa/interpolator.cpp +++ b/src/ipa/libipa/interpolator.cpp @@ -125,6 +125,13 @@ namespace ipa { * Overwrites the internal map using move semantics. */ +/** + * \fn std::map<unsigned int, T> &Interpolator<T>::data() const + * \brief Access the internal map + * + * \return The internal map + */ + /** * \fn const T& Interpolator<T>::getInterpolated() * \brief Retrieve an interpolated value for the given key @@ -136,8 +143,7 @@ namespace ipa { */ /** - * \fn void Interpolator<T>::interpolate(const T &a, const T &b, T &dest, double - * lambda) + * \fn void Interpolator<T>::interpolate(const T &a, const T &b, T &dest, double lambda) * \brief Interpolate between two instances of T * \param a The first value to interpolate * \param b The second value to interpolate diff --git a/src/ipa/libipa/interpolator.h b/src/ipa/libipa/interpolator.h index fffce21465fe..7880db6976d1 100644 --- a/src/ipa/libipa/interpolator.h +++ b/src/ipa/libipa/interpolator.h @@ -81,6 +81,11 @@ public: lastInterpolatedKey_.reset(); } + const std::map<unsigned int, T> &data() const + { + return data_; + } + const T &getInterpolated(unsigned int key, unsigned int *quantizedKey = nullptr) { ASSERT(data_.size() > 0);
The only way to access the internal data of an Interpolator is through the getInterpolated() method. Sometimes it is necessary to to access the internal data directly to iterate over it. Add an accessor for that. While at it, remove a line break from the doxygen documentation for interpolate() so that doxygen is able to correctly match the function. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> --- src/ipa/libipa/interpolator.cpp | 10 ++++++++-- src/ipa/libipa/interpolator.h | 5 +++++ 2 files changed, 13 insertions(+), 2 deletions(-)