* // call SomeNativeAPI(pList2.get());
* }
* @endcode
+ * @remarks Before %Tizen 3.0, iterators managed by %StlConverter only met the requirements of the STL InputIterator concept
+ * due to the limitation of the uderlying %Tizen collection. But from %Tizen 3.0, these iterators support further STL iterator concept like below.
+ * Both IteratorT and RandomIteratorT support STL OutputIterator concept which can be dereferenced as an lvalue. It's the mutable iterator.
+ * - PairIteratorT supports STL constant ForwardIterator.
+ * - IteratorT supports STL mutable BidirectionalIterator.
+ * - RandomIteratorT supports STL mutable RandomAccessIterator.
*/
class StlConverter
/**
* Gets the STL compatible iterator referring to the first element in the IList instance.
*
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This method is deprecated to support mutation algorithm requiring non-const pointer.
* @since 2.1
*
* @return An IteratorT instance
template< typename T >
static IteratorT< T > GetBeginIterator(const IList* pList)
{
+ return GetBeginIterator< T >(const_cast< IList* >(pList));
+ }
+
+ /**
+ * Gets the STL compatible iterator referring to the first element in the IList instance.
+ *
+ * @since 3.0
+ *
+ * @return An IteratorT instance
+ * @param[in] pList A pointer to the IList instance to convert
+ * @remarks This method does not take the ownership of the @c pList because the argument is a non-const pointer.
+ */
+ template< typename T >
+ static IteratorT< T > GetBeginIterator(IList* pList)
+ {
return IteratorT< T >(*pList);
}
/**
* Gets the STL compatible iterator referring to the post-end element in the IList instance.
*
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This method is deprecated to support mutation algorithm requiring non-const pointer.
* @since 2.1
*
* @return An IteratorT instance
template< typename T >
static IteratorT< T > GetEndIterator(const IList* pList)
{
+ return GetEndIterator< T >(const_cast< IList* >(pList));
+ }
+
+ /**
+ * Gets the STL compatible iterator referring to the post-end element in the IList instance.
+ *
+ * @since 3.0
+ *
+ * @return An IteratorT instance
+ * @param[in] pList A pointer to the IList instance to convert
+ * @remarks This method does not take the ownership of the @c pList because the argument is a non-const pointer.
+ */
+ template< typename T >
+ static IteratorT< T > GetEndIterator(IList* pList)
+ {
return IteratorT< T >(*pList, true);
}
/**
* Gets the STL compatible random iterator referring to the first element in the IList instance.
*
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This method is deprecated to support mutation algorithm requiring non-const pointer.
* @since 2.1
*
* @return A RandomIteratorT instance
template< typename T >
static RandomIteratorT< T > GetBeginRandomIterator(const IList* pList)
{
+ return GetBeginRandomIterator< T >(const_cast< IList* >(pList));
+ }
+
+ /**
+ * Gets the STL compatible random iterator referring to the first element in the IList instance.
+ *
+ * @since 3.0
+ *
+ * @return A RandomIteratorT instance
+ * @param[in] pList A pointer to the IList instance to convert
+ * @remarks This method does not take the ownership of the @c pList because the argument is a non-const pointer.
+ */
+ template< typename T >
+ static RandomIteratorT< T > GetBeginRandomIterator(IList* pList)
+ {
return RandomIteratorT< T >(*pList, 0);
}
/**
* Gets the STL compatible random iterator referring to the post-end element in the IList instance.
*
+ * @brief <i> [Deprecated] </i>
+ * @deprecated This method is deprecated to support mutation algorithm requiring non-const pointer.
* @since 2.1
*
* @return A RandomIteratorT instance
template< typename T >
static RandomIteratorT< T > GetEndRandomIterator(const IList* pList)
{
+ return GetEndRandomIterator< T >(const_cast< IList* >(pList));
+ }
+
+ /**
+ * Gets the STL compatible random iterator referring to the post-end element in the IList instance.
+ *
+ * @since 3.0
+ *
+ * @return A RandomIteratorT instance
+ * @param[in] pList A pointer to the IList instance to convert
+ * @remarks This method does not take the ownership of the @c pList because the argument is a non-const pointer.
+ */
+ template< typename T >
+ static RandomIteratorT< T > GetEndRandomIterator(IList* pList)
+ {
return RandomIteratorT< T >(*pList, pList->GetCount());
}
}
/**
- * Gets an ArrayList instance from the begin and end iterators of STL container.
+ * Gets an ArrayList instance from the begin and end iterators of the STL container.
*
* @since 2.1
*
* @return A std::unique_ptr to the ArrayList instance, @n
- * else @c std::unique_ptr< ArrayList >() if error occurs
- * @param[in] begin begin() of STL container
- * @param[in] end end() of STL container
- * @param[in] deleter The function pointer to type of the element deleter
+ * else @c std::unique_ptr< ArrayList >() if an error occurs
+ * @param[in] begin begin() of the STL container
+ * @param[in] end end() of the STL container
+ * @param[in] deleter A function pointer to the type of the element deleter
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG A specified input parameter is invalid.
- * @remarks To create an owning collection, set the element deleter value as @c SingleObjectDeleter.
- * This gives the collection the ownership of elements and the collection can destroy elements. @n
- * On the other hand, to create a non-owning collection, you don't need to set the element deleter value,
- * as @c NoOpDeleter is the default element deleter.
- * That implies transfer of the ownership of elements to the collection is not required.
- * @remarks The specific error code can be accessed using GetLastResult() method.
+ * @remarks
+ * - To create an owning collection, set the element deleter value as @c SingleObjectDeleter. @n
+ * This gives the collection the ownership of the elements and the collection can destroy the elements. @n
+ * On the other hand, to create a non-owning collection, do not set the element deleter value,
+ * as @c NoOpDeleter is the default element deleter. @n
+ * This implies that the transfer of the ownership of the elements to the collection is not required.
+ * - The specific error code can be accessed using GetLastResult() method.
* @see NoOpDeleter()
* @see SingleObjectDeleter()
* @see ArrayDeleter()
}
/**
- * Gets a LinkedList instance from the begin and end iterators of STL container.
+ * Gets a LinkedList instance from the begin and end iterators of the STL container.
*
* @since 2.1
*
* @return A std::unique_ptr to the LinkedList instance @n
- * else @c std::unique_ptr< LinkedList >() if error occurs
- * @param[in] begin begin() of STL container
- * @param[in] end end() of STL container
- * @param[in] deleter The function pointer to type of the element deleter
+ * else @c std::unique_ptr< LinkedList >() if an error occurs
+ * @param[in] begin begin() of the STL container
+ * @param[in] end end() of the STL container
+ * @param[in] deleter A function pointer to the type of the element deleter
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG A specified input parameter is invalid.
- * @remarks To create an owning collection, set the element deleter value as @c SingleObjectDeleter.
- * This gives the collection the ownership of elements and the collection will destroy elements. @n
- * On the other hand, to create a non-owning collection, you don't need to set the element deleter value,
- * as @c NoOpDeleter is the default element deleter.
- * That implies transfer of the ownership of elements to the collection is not required.
- * @remarks The specific error code can be accessed using GetLastResult() method.
+ * @remarks
+ * - To create an owning collection, set the element deleter value as @c SingleObjectDeleter. @n
+ * This gives the collection the ownership of the elements and the collection can destroy the elements. @n
+ * On the other hand, to create a non-owning collection, do not set the element deleter value,
+ * as @c NoOpDeleter is the default element deleter. @n
+ * This implies that the transfer of the ownership of the elements to the collection is not required.
+ * - The specific error code can be accessed using GetLastResult() method.
* @see NoOpDeleter()
* @see SingleObjectDeleter()
* @see ArrayDeleter()
}
/**
- * Gets a HashMap instance from the begin and end iterators of STL container.
+ * Gets a HashMap instance from the begin and end iterators of the STL container.
*
* @since 2.1
*
* @return A std::unique_ptr to the HashMap instance @n
- * else @c std::unique_ptr< HashMap >() if error occurs
- * @param[in] begin begin() of STL container
- * @param[in] end end() of STL container
- * @param[in] deleter The function pointer to type of the element deleter
+ * else @c std::unique_ptr< HashMap >() if an error occurs
+ * @param[in] begin begin() of the STL container
+ * @param[in] end end() of the STL container
+ * @param[in] deleter A function pointer to the type of the element deleter
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG A specified input parameter is invalid.
- * @remarks To create an owning collection, set the element deleter value as @c SingleObjectDeleter.
- * This gives the collection the ownership of elements and the collection will destroy elements. @n
- * On the other hand, to create a non-owning collection, you don't need to set the element deleter value,
- * as @c NoOpDeleter is the default element deleter.
- * That implies transfer of the ownership of elements to the collection is not required.
- * @remarks The specific error code can be accessed using GetLastResult() method.
+ * @remarks
+ * - To create an owning collection, set the element deleter value as @c SingleObjectDeleter. @n
+ * This gives the collection the ownership of the elements and the collection can destroy the elements. @n
+ * On the other hand, to create a non-owning collection, do not set the element deleter value,
+ * as @c NoOpDeleter is the default element deleter. @n
+ * This implies that the transfer of the ownership of the elements to the collection is not required.
+ * - The specific error code can be accessed using GetLastResult() method.
* @see NoOpDeleter()
* @see SingleObjectDeleter()
* @see ArrayDeleter()
}
/**
- * Gets a MultiHashMap instance from the begin and end iterators of STL container.
+ * Gets a MultiHashMap instance from the begin and end iterators of the STL container.
*
* @since 2.1
*
* @return A std::unique_ptr to the MultiHashMap instance @n
- * else @c std::unique_ptr< MultiHashMap >() if error occurs
- * @param[in] begin begin() of STL container
- * @param[in] end end() of STL container
- * @param[in] deleter The function pointer to type of the element deleter
+ * else @c std::unique_ptr< MultiHashMap >() if an error occurs
+ * @param[in] begin begin() of the STL container
+ * @param[in] end end() of the STL container
+ * @param[in] deleter A function pointer to the type of the element deleter
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG A specified input parameter is invalid.
- * @remarks To create an owning collection, set the element deleter value as @c SingleObjectDeleter.
- * This gives the collection the ownership of elements and the collection will destroy elements. @n
- * On the other hand, to create a non-owning collection, you don't need to set the element deleter value,
- * as @c NoOpDeleter is the default element deleter.
- * That implies transfer of the ownership of elements to the collection is not required.
- * @remarks The specific error code can be accessed using GetLastResult() method.
+ * @remarks
+ * - To create an owning collection, set the element deleter value as @c SingleObjectDeleter. @n
+ * This gives the collection the ownership of the elements and the collection can destroy the elements. @n
+ * On the other hand, to create a non-owning collection, do not set the element deleter value,
+ * as @c NoOpDeleter is the default element deleter. @n
+ * This implies that the transfer of the ownership of the elements to the collection is not required.
+ * - The specific error code can be accessed using GetLastResult() method.
* @see NoOpDeleter()
* @see SingleObjectDeleter()
* @see ArrayDeleter()