The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

a/math: Add a clear() method to RelationHistory/m_relation_history

authored by

Arkadiusz Drohomirecki and committed by
Arkadiusz Drohomirecki
d4444122 4c6b3b46

+28 -4
+7
src/xrt/auxiliary/math/m_relation_history.cpp
··· 195 195 } 196 196 197 197 void 198 + m_relation_history_clear(struct m_relation_history *rh) 199 + { 200 + std::unique_lock<os::Mutex> lock(rh->mutex); 201 + rh->impl = {}; 202 + } 203 + 204 + void 198 205 m_relation_history_destroy(struct m_relation_history **rh_ptr) 199 206 { 200 207 struct m_relation_history *rh = *rh_ptr;
+21 -4
src/xrt/auxiliary/math/m_relation_history.h
··· 37 37 }; 38 38 39 39 /*! 40 - * @brief Creates an opaque relation_history object. 40 + * Creates an opaque relation_history object. 41 41 * 42 42 * @public @memberof m_relation_history 43 43 */ ··· 59 59 uint64_t timestamp); 60 60 61 61 /*! 62 - * @brief Interpolates or extrapolates to the desired timestamp. 62 + * Interpolates or extrapolates to the desired timestamp. 63 63 * 64 64 * Read-only operation - doesn't remove anything from the buffer or anything like that - you can call this as often as 65 65 * you want. ··· 72 72 struct xrt_space_relation *out_relation); 73 73 74 74 /*! 75 - * @brief Get the latest report in the buffer, if any. 75 + * Get the latest report in the buffer, if any. 76 76 * 77 77 * @param rh self 78 78 * @param[out] out_time_ns Populated with the latest report time, if any ··· 88 88 struct xrt_space_relation *out_relation); 89 89 90 90 /*! 91 - * @brief Returns the number of items in the history. 91 + * Returns the number of items in the history. 92 92 * 93 93 * @public @memberof m_relation_history 94 94 */ 95 95 uint32_t 96 96 m_relation_history_get_size(const struct m_relation_history *rh); 97 + 98 + /*! 99 + * Clears the history from all of the items. 100 + * 101 + * @public @memberof m_relation_history 102 + */ 103 + void 104 + m_relation_history_clear(struct m_relation_history *rh); 97 105 98 106 /*! 99 107 * Destroys an opaque relation_history object. ··· 178 186 size() const noexcept 179 187 { 180 188 return m_relation_history_get_size(mPtr); 189 + } 190 + 191 + /*! 192 + * @copydoc m_relation_history_clear 193 + */ 194 + void 195 + clear() noexcept 196 + { 197 + return m_relation_history_clear(mPtr); 181 198 } 182 199 }; 183 200