[2.2.1] Apply reviewed header file (Base to Collection)
[platform/framework/native/appfw.git] / inc / FBaseColIteratorT.h
index 7e38af6..b380468 100644 (file)
@@ -24,7 +24,7 @@
 #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>
@@ -36,29 +36,29 @@ namespace Tizen { namespace Base { namespace Collection
 /**
  * @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)
@@ -115,14 +115,14 @@ public:
        }
 
        /**
-        * 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);
@@ -130,28 +130,28 @@ public:
        }
 
        /**
-        * 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 *());
        }
 
        /**
@@ -162,11 +162,12 @@ public:
         * @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));
@@ -174,12 +175,13 @@ public:
                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;
        }
@@ -192,14 +194,15 @@ public:
         * @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;
        }
 
@@ -211,11 +214,12 @@ public:
         * @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));
 
@@ -244,14 +248,15 @@ CATCH:
         * @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;
        }
 
@@ -264,7 +269,7 @@ CATCH:
         *                              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)
                {
@@ -299,9 +304,9 @@ CATCH:
         *                              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);
        }
 
        /**