#ifndef _FBASE_COL_ITERATOR_T_H_
#define _FBASE_COL_ITERATOR_T_H_
-#include <algorithm> // std::swap (Before C++11)
+#include <algorithm> // std::swap (Before C++11)
#include <iterator>
#include <unique_ptr.h>
#include <FBaseLog.h>
/**
* @class IteratorT
* @brief This class provides an iterator that is used to convert %IList to STL containers. @n
- * %StlConverter provides static methods to get this iterator from %IList.
+ * %StlConverter provides static methods to get this iterator from IList.
*
* @since 2.1
*
- * @remarks The %IteratorT class satisfies only requirements of C++ standard library InputIterator concept due to limitations of %Tizen collection.
- * So, this class can be used with C++ standard library algorithms which requires only InputIterator concept for their arguments.
+ * @remarks The %IteratorT class satisfies only the requirements of the C++ standard library InputIterator concept due to limitations of the %Tizen collection. @n
+ * This class can be used with the C++ standard library algorithms which require only the InputIterator concept for their arguments.
*
* The %IteratorT class provides an iterator that is used to convert IList to STL containers.
* StlConverter provides static methods to get this iterator from IList.
*/
-template < typename T >
+template< typename T >
class IteratorT
: public std::iterator< std::input_iterator_tag, T >
{
public:
/**
- * Initializes an instance of %IteratorT class.
+ * Initializes an instance of %IteratorT.
*
* @since 2.1
*
* @param[in] list A reference to the IList instance to convert
- * @param[in] isPostEnd A boolean value to check the end of a list
+ * @param[in] isPostEnd The boolean value that checks the end of the list
*/
explicit IteratorT(const IList& list, bool isPostEnd = false)
: __pList(&list)
}
/**
- * This is an assignment operator of the %IteratorT class.
+ * This is the assignment operator of the %IteratorT class.
*
* @since 2.1
*
* @return A reference to the %IteratorT instance
* @param[in] rhs A reference to the %IteratorT instance on the right-hand side of the operator
*/
- IteratorT< T >& operator=(const IteratorT< T >& rhs)
+ IteratorT< T >& operator =(const IteratorT< T >& rhs)
{
IteratorT< T > tmp(rhs);
tmp.swap(*this);
}
/**
- * This is the indirection operator for the %IteratorT class.
+ * This is the indirection operator of the %IteratorT class.
*
* @since 2.1
*
* @return A T type reference
*/
- T& operator*(void) const
+ T& operator *(void) const
{
AppAssertf(!__isPostEnd && __index >= 0, "It is out of range.");
return const_cast< T& >(__currentObj);
}
/**
- * This is a structure dereference operator for the %IteratorT class.
+ * This is the structure dereference operator of the %IteratorT class.
*
* @since 2.1
*
* @return A T type pointer that is equivalent to the pointer address
*/
- T* operator->(void) const
+ T* operator ->(void) const
{
- return &(operator*());
+ return &(operator *());
}
/**
* @return A reference to the %IteratorT type instance
* @exception E_SUCCESS The method is successful.
* @exception E_OUT_OF_RANGE The iterator is outside the bounds of the list.
- * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation, or
- * the collection is modified after the enumerator is created.
+ * @exception E_INVALID_OPERATION Either of the following conditions has occurred:
+ * - The current state of the instance prohibits the execution of the specified operation.
+ * - The collection is modified after the enumerator is created.
* @remarks The specific error code can be accessed using GetLastResult() method.
*/
- IteratorT< T >& operator++(void)
+ IteratorT< T >& operator ++(void)
{
const int PRE_BEGIN_IDX = -1;
TryCatchResult(__index >= PRE_BEGIN_IDX, , E_OUT_OF_RANGE, "[%s] It is out of range.", GetErrorMessage(E_OUT_OF_RANGE));
if (__index != PRE_BEGIN_IDX)
{
result r = __pEnum->MoveNext();
- TryCatchResult(r == E_SUCCESS, __isPostEnd = true; __currentObj = null, r, "[%s] It already reached the end.", GetErrorMessage(r));
+ TryCatchResult(r == E_SUCCESS, __isPostEnd = true;
+ __currentObj = null, r, "[%s] It already reached the end.", GetErrorMessage(r));
}
__currentObj = static_cast< T >(__pEnum->GetCurrent());
- CATCH:
+CATCH:
++__index;
return *this;
}
* @return An %IteratorT instance
* @exception E_SUCCESS The method is successful.
* @exception E_OUT_OF_RANGE The iterator is outside the bounds of the list.
- * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation, or
- * the collection is modified after the enumerator is created.
+ * @exception E_INVALID_OPERATION Either of the following conditions has occurred:
+ * - The current state of the instance prohibits the execution of the specified operation.
+ * - The collection is modified after the enumerator is created.
* @remarks The specific error code can be accessed using GetLastResult() method.
*/
- IteratorT< T > operator++(int)
+ IteratorT< T > operator ++(int)
{
IteratorT< T > tempIter = *this;
- operator++();
+ operator ++();
return tempIter;
}
* @return A reference to the %IteratorT type instance
* @exception E_SUCCESS The method is successful.
* @exception E_OUT_OF_RANGE The iterator is outside the bounds of the list.
- * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation, or
- * the collection is modified after the enumerator is created.
+ * @exception E_INVALID_OPERATION Either of the following conditions has occurred:
+ * - The current state of the instance prohibits the execution of the specified operation.
+ * - The collection is modified after the enumerator is created.
* @remarks The specific error code can be accessed using GetLastResult() method.
*/
- IteratorT< T >& operator--(void)
+ IteratorT< T >& operator --(void)
{
TryCatchResult(__index <= __pList->GetCount(), , E_OUT_OF_RANGE, "[%s] It is out of range.", GetErrorMessage(E_OUT_OF_RANGE));
* @return An %IteratorT instance
* @exception E_SUCCESS The method is successful.
* @exception E_OUT_OF_RANGE The iterator is outside the bounds of the list.
- * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation, or
- * the collection is modified after the enumerator is created.
+ * @exception E_INVALID_OPERATION Either of the following conditions has occurred:
+ * - The current state of the instance prohibits the execution of the specified operation.
+ * - The collection is modified after the enumerator is created.
* @remarks The specific error code can be accessed using GetLastResult() method.
*/
- IteratorT< T > operator--(int)
+ IteratorT< T > operator --(int)
{
IteratorT< T > tempIter = *this;
- operator--();
+ operator --();
return tempIter;
}
* else @c false
* @param[in] rhs A reference to the %IteratorT instance on the right-hand side of the operator
*/
- bool operator==(const IteratorT< T >& rhs) const
+ bool operator ==(const IteratorT< T >& rhs) const
{
if (__pList != rhs.__pList)
{
* else @c false
* @param[in] rhs A reference to the %IteratorT instance on the right-hand side of the operator
*/
- bool operator!=(const IteratorT< T >& rhs) const
+ bool operator !=(const IteratorT< T >& rhs) const
{
- return !operator==(rhs);
+ return !operator ==(rhs);
}
/**