SCENE C++ API  2.1.0
Public Member Functions | List of all members
LSIterator< ValueT > Class Template Reference

A general iterator interface for arbitrary collections. More...

#include <lsiterator.h>

+ Inheritance diagram for LSIterator< ValueT >:

Public Member Functions

 LSIterator ()
 Constructs a null iterator. More...
 
 LSIterator (const LSIterator< ValueT > &iter)
 Constructs a copy of the iterator iter. More...
 
LSIteratoroperator= (const LSIterator< ValueT > &iter)
 Assigns a copy of the iterator iter to this iterator. More...
 
bool moveNext ()
 Advances the iterator to the next element of the container. More...
 
ValueT getCurrent () const
 Gets the element at which the iterator currently points. More...
 
void getCurrent (ValueT &out) const
 Gets the element at which the iterator currently points. More...
 
LSIterator< ValueT > where (bool(*func)(const ValueT &)) const
 Filters the elements returned by the iterator based on a given filter function. More...
 
void * operator new (size_t tSize)
 Default allocation function. More...
 
void operator delete (void *p)
 Default deallocation function. More...
 

Detailed Description

template<typename ValueT>
class SCENE_API::LSIterator< ValueT >

A general iterator interface for arbitrary collections.

Version
SCENE API Version 2.0.0.

Constructor & Destructor Documentation

◆ LSIterator() [1/2]

Constructs a null iterator.

Version
SCENE API Version 2.0.0.

◆ LSIterator() [2/2]

LSIterator ( const LSIterator< ValueT > &  iter)

Constructs a copy of the iterator iter.

Parameters
iterThe iterator from which to create a copy.
Version
SCENE API Version 2.0.0.

Member Function Documentation

◆ operator=()

LSIterator& operator= ( const LSIterator< ValueT > &  iter)

Assigns a copy of the iterator iter to this iterator.

Parameters
iterThe iterator which is assigned to this iterator.
Version
SCENE API Version 2.0.0.

◆ moveNext()

bool moveNext ( )

Advances the iterator to the next element of the container.

Returns
true if the iterator could be set to the next element, false if the iterator passed the end of the container.
Version
SCENE API Version 2.0.0.

◆ getCurrent() [1/2]

ValueT getCurrent ( ) const

Gets the element at which the iterator currently points.

Returns
The element at which the iterator currently points.
Version
SCENE API Version 2.0.0.

◆ getCurrent() [2/2]

void getCurrent ( ValueT &  out) const

Gets the element at which the iterator currently points.

Parameters
[out]outThe element at which the iterator currently points.
Version
SCENE API Version 2.0.0.

◆ where()

LSIterator<ValueT> where ( bool(*)(const ValueT &)  func) const

Filters the elements returned by the iterator based on a given filter function.

The input function func has to be a function type which takes a const reference to the value type and returns an boolean based on the filter result.

Returns
The filtered iterator.
Version
SCENE API Version 2.0.0.

◆ operator new()

void* operator new ( size_t  tSize)

Default allocation function.

Overloaded in order to always allocate LSString objects in the context of this module.

Version
SCENE API Version 2.0.0.

◆ operator delete()

void operator delete ( void *  p)

Default deallocation function.

Overloaded in order to always deallocate LSString objects in the context of this module.

Version
SCENE API Version 2.0.0.