From 28d5740bf514df698c2cb1f31d9f65ec73fbc392 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Fri, 22 Mar 2013 20:56:28 +0100 Subject: [PATCH] [DEV] add pushFront API for vector --- etk/Vector.h | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/etk/Vector.h b/etk/Vector.h index 3051169..00e89c2 100644 --- a/etk/Vector.h +++ b/etk/Vector.h @@ -391,9 +391,26 @@ namespace etk #endif return m_data[pos]; } + /** + * @brief Add at the First position of the Vector + * @param[in] item Element to add at the end of vector + */ + void PushFront(const MY_TYPE& item) + { + Insert(0, &item, 1); + } /** * @brief Add at the Last position of the Vector - * @param[in] item Element to add at the end of vector + * @param[in] item Pointer on a list of Element to add at the start of vector + * @param[in] nbElement Number of element to add. + */ + void PushFront(const MY_TYPE * item, int32_t nbElement) + { + Insert(0, item, nbElement); + } + /** + * @brief Add at the Last position of the Vector + * @param[in] item Element to add at the end of vector */ void PushBack(const MY_TYPE& item) { @@ -407,7 +424,8 @@ namespace etk } /** * @brief Add at the Last position of the Vector - * @param[in] item Element to add at the end of vector + * @param[in] item Pointer on a list of Element to add at the end of vector + * @param[in] nbElement Number of element to add. */ void PushBack(const MY_TYPE * item, int32_t nbElement) {