JX Application Framework
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
JArrayIterator< T > Class Template Reference

#include <JArrayIterator.h>

Inheritance diagram for JArrayIterator< T >:
[legend]

Public Member Functions

 JArrayIterator (const JArray< T > &theArray, const JListT::Position start=JListT::kStartAtBeginning, const JIndex index=0)
 
 JArrayIterator (JArray< T > *theArray, const JListT::Position start=JListT::kStartAtBeginning, const JIndex index=0)
 
 JArrayIterator (const JArrayIterator< T > &source)
 
 ~JArrayIterator () override
 
bool Prev (T *data, const JListT::Action move=JListT::kMove) override
 
bool Next (T *data, const JListT::Action move=JListT::kMove) override
 
void SkipPrev (const JSize count=1) override
 
void SkipNext (const JSize count=1) override
 
bool SetPrev (const T &data, const JListT::Action move=JListT::kMove) override
 
bool SetNext (const T &data, const JListT::Action move=JListT::kMove) override
 
bool RemovePrev (const JSize count=1) override
 
bool RemoveNext (const JSize count=1) override
 
bool Insert (const T &data) override
 
- Public Member Functions inherited from JListIterator< T >
 JListIterator (const JList< T > &theList, const JListT::Position start=JListT::kStartAtBeginning, const JIndex index=0)
 
 JListIterator (JList< T > *theList, const JListT::Position start=JListT::kStartAtBeginning, const JIndex index=0)
 
virtual ~JListIterator ()
 
const JList< T > * GetList () const
 
bool GetList (JList< T > **obj) const
 
bool Prev (std::function< bool(const T &)> match, T *item)
 
bool Next (std::function< bool(const T &)> match, T *item)
 
virtual void MoveTo (const JListT::Position newPosition, const JIndex index)
 
bool AtBeginning () const
 
bool AtEnd () const
 
JIndex GetPrevItemIndex () const
 
JIndex GetNextItemIndex () const
 
bool GetPrevItemIndex (JIndex *i) const
 
bool GetNextItemIndex (JIndex *i) const
 
operator* () const
 
JListIterator< T > & operator++ ()
 
bool operator== (const JListIterator< T > &it) const
 

Protected Member Functions

void ListChanged (const JBroadcaster::Message &message) override
 
- Protected Member Functions inherited from JListIterator< T >
 JListIterator (const JListIterator< T > &source)
 
JCursorPosition GetCursor () const
 
void SetCursor (const JCursorPosition pos)
 

Constructor & Destructor Documentation

◆ JArrayIterator() [1/3]

template<class T >
JArrayIterator< T >::JArrayIterator ( const JArray< T > &  theArray,
const JListT::Position  start = JListT::kStartAtBeginning,
const JIndex  index = 0 
)

Efficient interation for JArray objects.

Refer to JListIterator.tmpl for information about interators in general.

◆ JArrayIterator() [2/3]

template<class T >
JArrayIterator< T >::JArrayIterator ( JArray< T > *  theArray,
const JListT::Position  start = JListT::kStartAtBeginning,
const JIndex  index = 0 
)

◆ JArrayIterator() [3/3]

template<class T >
JArrayIterator< T >::JArrayIterator ( const JArrayIterator< T > &  source)

◆ ~JArrayIterator()

template<class T >
JArrayIterator< T >::~JArrayIterator ( )
override

Member Function Documentation

◆ Insert()

template<class T >
bool JArrayIterator< T >::Insert ( const T &  data)
overridevirtual

Returns true if we have a non-const JArray<T>*.

Implements JListIterator< T >.

◆ ListChanged()

template<class T >
void JArrayIterator< T >::ListChanged ( const JBroadcaster::Message message)
overrideprotectedvirtual

Respond to changes in itsConstList and recursively tell the next iterator in the list to do the same. Assuming that only a handful of iterators are ever in a list, recursion should be safe.

Reimplemented from JListIterator< T >.

Reimplemented in JBroadcasterMessageIterator< T >, and JTaskIterator< T >.

◆ Next()

template<class T >
bool JArrayIterator< T >::Next ( T *  data,
const JListT::Action  move = JListT::kMove 
)
overridevirtual

Returns true if there is a next item, fetching the next item in the list and incrementing the iterator position. Otherwise returns false without fetching or incrementing.

Implements JListIterator< T >.

◆ Prev()

template<class T >
bool JArrayIterator< T >::Prev ( T *  data,
const JListT::Action  move = JListT::kMove 
)
overridevirtual

Returns true if there is a previous item, fetching the previous item in the list and decrementing the iterator position. Otherwise returns false without fetching or decrementing.

Implements JListIterator< T >.

◆ RemoveNext()

template<class T >
bool JArrayIterator< T >::RemoveNext ( const JSize  count = 1)
overridevirtual

Returns true if we have a non-const JArray<T>* and there is at least one next item.

Implements JListIterator< T >.

◆ RemovePrev()

template<class T >
bool JArrayIterator< T >::RemovePrev ( const JSize  count = 1)
overridevirtual

Returns true if we have a non-const JArray<T>* and there is at least one previous item.

Implements JListIterator< T >.

◆ SetNext()

template<class T >
bool JArrayIterator< T >::SetNext ( const T &  data,
const JListT::Action  move = JListT::kMove 
)
overridevirtual

Returns true if we have a non-const JArray<T>* and there is a next item.

Implements JListIterator< T >.

◆ SetPrev()

template<class T >
bool JArrayIterator< T >::SetPrev ( const T &  data,
const JListT::Action  move = JListT::kMove 
)
overridevirtual

Returns true if we have a non-const JArray<T>* and there is a previous item.

Implements JListIterator< T >.

◆ SkipNext()

template<class T >
void JArrayIterator< T >::SkipNext ( const JSize  count = 1)
overridevirtual

Implements JListIterator< T >.

◆ SkipPrev()

template<class T >
void JArrayIterator< T >::SkipPrev ( const JSize  count = 1)
overridevirtual

Implements JListIterator< T >.


The documentation for this class was generated from the following files: