Base Module  VST 3.6.6
SDK for developing VST Plug-in
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions | Protected Attributes
TIterator< T > Class Template Referenceabstract

Template container iterator base class (abstract). More...

#include <tcontainer.h>

+ Inheritance diagram for TIterator< T >:

Public Member Functions

 TIterator (const TContainer< T > &cont)
 
virtual ~TIterator ()
 
virtual bool done () const =0
 Check if end of container is reached. More...
 
virtual T & next ()=0
 Returns the current data and advances the iterator. postfix as in t = c++;. More...
 
virtual T & previous ()=0
 Returns the current data and backup. postfix as in t = c–;. More...
 
virtual T & current () const =0
 Returns the current data. More...
 
virtual void first ()=0
 Move to first data. More...
 
virtual void last ()=0
 Move to last data. More...
 
T & next (const T &)
 Advance to next equal. More...
 
T & previous (const T &)
 Backup to previous equal. More...
 
const TContainer< T > & container () const
 Return container reference. More...
 
 operator int32 () const
 Check if not end. More...
 
T & operator++ ()
 Advance the iterator to the next item and return it. More...
 
T & operator++ (int)
 Return the current item and advance the iterator to the next. More...
 
T & operator+= (int32 n)
 Advance the iterator n places and returns the item. More...
 
T & operator-- ()
 Decrement the iterator by one and return the item. More...
 
T & operator-- (int)
 Return the current item and decrement the iterator by one. More...
 
T & operator-= (int32)
 Decrement the iterator n places and returns the item. More...
 
T & operator() () const
 Return current item. More...
 

Protected Attributes

const TContainer< T > & _container
 Iterated container. More...
 

Detailed Description

template<class T>
class Steinberg::TIterator< T >

Template container iterator base class (abstract).

Each container implementation has a matching iterator. This class defines the basic interface for any iterator implementation.
Please note that TIterator::next and TIterator::previous always return the current iterator item and switch to the new item afterwards. This allows iteration loops in this style:

TLinkedList<int> myList;
...
TLinkedListIterator<int> iter (myList);
while (iter.done () == false)
{
int myInt = iter.next ();
}
See also
Steinberg::TContainer

Constructor & Destructor Documentation

TIterator ( const TContainer< T > &  cont)
inlineexplicit
virtual ~TIterator ( )
inlinevirtual

Member Function Documentation

virtual bool done ( ) const
pure virtual
virtual T& next ( )
pure virtual
virtual T& previous ( )
pure virtual
virtual T& current ( ) const
pure virtual
virtual void first ( )
pure virtual
virtual void last ( )
pure virtual
T & next ( const T &  rItem)

Advance to next equal.

T & previous ( const T &  rItem)

Backup to previous equal.

const TContainer< T > & container ( ) const

Return container reference.

operator int32 ( ) const

Check if not end.

T & operator++ ( )

Advance the iterator to the next item and return it.

T & operator++ ( int  )

Return the current item and advance the iterator to the next.

T & operator+= ( int32  n)

Advance the iterator n places and returns the item.

T & operator-- ( )

Decrement the iterator by one and return the item.

T & operator-- ( int  )

Return the current item and decrement the iterator by one.

T & operator-= ( int32  num)

Decrement the iterator n places and returns the item.

T & operator() ( ) const

Return current item.

Field Documentation

const TContainer<T>& _container
protected

Iterated container.

Empty

Copyright ©2016 Steinberg Media Technologies GmbH. All Rights Reserved.