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

#include <JRunArrayIterator.h>

Inheritance diagram for JRunArrayIterator< T >:
[legend]

Public Member Functions

 JRunArrayIterator (const JRunArray< T > &theRunArray, const JListT::Position start=JListT::kStartAtBeginning, const JIndex index=0)
 
 JRunArrayIterator (JRunArray< T > *theRunArray, const JListT::Position start=JListT::kStartAtBeginning, const JIndex index=0)
 
 JRunArrayIterator (const JRunArrayIterator< T > &source)
 
 ~JRunArrayIterator () override
 
bool Prev (T *item, const JListT::Action move=JListT::kMove) override
 
bool Next (T *item, const JListT::Action move=JListT::kMove) override
 
void SkipPrev (const JSize count=1) override
 
void SkipNext (const JSize count=1) override
 
void MoveTo (const JListT::Position newPosition, const JIndex index) 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 SetPrev (const T &data, const JSize count, const JListT::Action move=JListT::kMove)
 
bool SetNext (const T &data, const JSize count, const JListT::Action move=JListT::kMove)
 
bool RemovePrev (const JSize count=1) override
 
bool RemoveNext (const JSize count=1) override
 
bool Insert (const T &data) override
 
bool Insert (const T &data, const JSize count)
 
bool InsertSlice (const JRunArray< T > &source, const JIndexRange &range)
 
bool AtFirstRun () const
 
bool AtLastRun () const
 
bool PrevRun ()
 
bool NextRun ()
 
JIndex GetRunStart () const
 
JIndex GetRunEnd () const
 
JSize GetRunLength () const
 
JSize GetRemainingInRun () const
 
GetRunData () const
 
- 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)
 
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

◆ JRunArrayIterator() [1/3]

template<class T >
JRunArrayIterator< T >::JRunArrayIterator ( const JRunArray< T > &  theRunArray,
const JListT::Position  start = JListT::kStartAtBeginning,
const JIndex  index = 0 
)

Efficient interation for JRunArray objects.

        +-----+-----+-----+*****+*****+-----+-----+
index   |  1  |  2  |  3  |  4  |  5  |  6  |  7  |
        +-----+-----+-----+*****+*****+-----+-----+
run     1     1     1     2     2     3     3     4
inRun   0     1     2     0     1     0     1     0

◆ JRunArrayIterator() [2/3]

template<class T >
JRunArrayIterator< T >::JRunArrayIterator ( JRunArray< T > *  theRunArray,
const JListT::Position  start = JListT::kStartAtBeginning,
const JIndex  index = 0 
)

◆ JRunArrayIterator() [3/3]

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

◆ ~JRunArrayIterator()

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

Member Function Documentation

◆ AtFirstRun()

template<class T >
bool JRunArrayIterator< T >::AtFirstRun ( ) const

◆ AtLastRun()

template<class T >
bool JRunArrayIterator< T >::AtLastRun ( ) const

◆ GetRemainingInRun()

template<class T >
JSize JRunArrayIterator< T >::GetRemainingInRun ( ) const

◆ GetRunData()

template<class T >
T JRunArrayIterator< T >::GetRunData ( ) const

◆ GetRunEnd()

template<class T >
JIndex JRunArrayIterator< T >::GetRunEnd ( ) const

◆ GetRunLength()

template<class T >
JSize JRunArrayIterator< T >::GetRunLength ( ) const

◆ GetRunStart()

template<class T >
JIndex JRunArrayIterator< T >::GetRunStart ( ) const

◆ Insert() [1/2]

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

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

Implements JListIterator< T >.

◆ Insert() [2/2]

template<class T >
bool JRunArrayIterator< T >::Insert ( const T &  data,
const JSize  count 
)

◆ InsertSlice()

template<class T >
bool JRunArrayIterator< T >::InsertSlice ( const JRunArray< T > &  source,
const JIndexRange range 
)

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

◆ ListChanged()

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

Respond to changes in itsRunArray. We can't optimize anything because inserting and removing items can merge runs or split a run. We have to ask our JRunArray what happened.

Reimplemented from JListIterator< T >.

◆ MoveTo()

template<class T >
void JRunArrayIterator< T >::MoveTo ( const JListT::Position  newPosition,
const JIndex  index 
)
overridevirtual

Reset the iterator position to one of: kJIteratorStartAtBeginning, kJIteratorStartAtEnd, IteratorStartBefore(index), or IteratorStartAfter(index)

Reimplemented from JListIterator< T >.

◆ Next()

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

Return TRUE if there is a next item, fetching the next item in the list and decrementing the iterator position. Otherwise return FALSE without fetching or decrementing.

Implements JListIterator< T >.

◆ NextRun()

template<class T >
bool JRunArrayIterator< T >::NextRun ( )

If there is a next run, moves the iterator position to the start of that run and returns TRUE.

◆ Prev()

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

Return TRUE if there is a previous item, fetching the previous item in the list and decrementing the iterator position. Otherwise return FALSE without fetching or decrementing.

Implements JListIterator< T >.

◆ PrevRun()

template<class T >
bool JRunArrayIterator< T >::PrevRun ( )

If there is a previous run, moves the iterator position to the start of that run and returns TRUE.

◆ RemoveNext()

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

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

Implements JListIterator< T >.

◆ RemovePrev()

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

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

Implements JListIterator< T >.

◆ SetNext() [1/2]

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

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

Implements JListIterator< T >.

◆ SetNext() [2/2]

template<class T >
bool JRunArrayIterator< T >::SetNext ( const T &  data,
const JSize  count,
const JListT::Action  move = JListT::kMove 
)

Returns true if we have a non-const JRunArray<T>* and there are next items.

◆ SetPrev() [1/2]

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

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

Implements JListIterator< T >.

◆ SetPrev() [2/2]

template<class T >
bool JRunArrayIterator< T >::SetPrev ( const T &  data,
const JSize  count,
const JListT::Action  move = JListT::kMove 
)

Returns true if we have a non-const JRunArray<T>* and there are previous items.

◆ SkipNext()

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

Implements JListIterator< T >.

◆ SkipPrev()

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

Implements JListIterator< T >.


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