summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Klug <stefan.klug@ideasonboard.com>2025-01-23 12:40:51 +0100
committerStefan Klug <stefan.klug@ideasonboard.com>2025-02-21 17:35:02 +0100
commit3c653f3f6532fa30b7ed0426e6bbce7c516e69bb (patch)
tree0603d1f32591af1f28526fab17a9aedbcd343444 /src
parenta7d7bc03e5e0c586b203dd86a6b1b41689f08d5e (diff)
libipa: interpolator: Add accessor to internal data
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> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/ipa/libipa/interpolator.cpp10
-rw-r--r--src/ipa/libipa/interpolator.h5
2 files changed, 13 insertions, 2 deletions
diff --git a/src/ipa/libipa/interpolator.cpp b/src/ipa/libipa/interpolator.cpp
index 73e8d3b7..f901a86e 100644
--- a/src/ipa/libipa/interpolator.cpp
+++ b/src/ipa/libipa/interpolator.cpp
@@ -126,6 +126,13 @@ namespace ipa {
*/
/**
+ * \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
* \param[in] key The unsigned integer key of the object to retrieve
@@ -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 fffce214..7880db69 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);