#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>
* 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 >
{
* @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);
*
* @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);
*
* @return A T type pointer that is equivalent to the pointer address
*/
- T* operator->(void) const
+ T* operator ->(void) const
{
- return &(operator*());
+ return &(operator *());
}
/**
* 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;
}
* 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;
}
* 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));
* 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);
}
/**