Codemesh Runtime v3 C++ API Reference  3.9.205
Public Types | Public Member Functions | List of all members
xmog_array_iterator< ArrayType > Class Template Reference

An iterator type for Java array instances. More...

#include <xmog_java_array.h>

Public Types

typedef ArrayType::difference_type difference_type
 The difference type used to represent two subtracted iterators.
 
typedef ArrayType::value_type value_type
 The value type used when the iterator is dereferenced. More...
 

Public Member Functions

 xmog_array_iterator ()
 The default constructor (required by iterator contract).
 
 xmog_array_iterator (const xmog_array_iterator< ArrayType > &rhs)
 The copy constructor (required by iterator contract). More...
 
 xmog_array_iterator (ArrayType &arr)
 The constructor that creates an iterator that is positioned on the first element of the array. More...
 
 xmog_array_iterator (ArrayType &arr, jint ind)
 The constructor that creates an iterator that is positioned on an arbitrary element of the array. More...
 
 ~xmog_array_iterator ()
 The destructor.
 
xmog_array_iterator< ArrayType > & operator= (const xmog_array_iterator< ArrayType > &rhs)
 The assignment operator (required by iterator contract). More...
 
bool operator< (const xmog_array_iterator< ArrayType > &rhs) const
 
bool operator<= (const xmog_array_iterator< ArrayType > &rhs) const
 
bool operator> (const xmog_array_iterator< ArrayType > &rhs) const
 
bool operator>= (const xmog_array_iterator< ArrayType > &rhs) const
 
bool operator== (const xmog_array_iterator< ArrayType > &rhs) const
 
bool operator!= (const xmog_array_iterator< ArrayType > &rhs) const
 
xmog_array_iterator< ArrayType > operator+ (difference_type diff)
 
xmog_array_iterator< ArrayType > & operator+= (difference_type diff)
 The additive assignment operator.
 
xmog_array_iterator< ArrayType > operator- (difference_type diff)
 
xmog_array_iterator< ArrayType > & operator-= (difference_type diff)
 The subtractive assignment operator.
 
value_type operator[] (jint ind)
 The subscript operator returns the element that is 'ind' away from the current index position.
 
value_type operator* ()
 The dereference operator returns the element at the current index.
 
xmog_array_iterator< ArrayType > & operator++ ()
 The pre increment operator.
 
xmog_array_iterator< ArrayType > operator++ (int)
 The post increment operator.
 
xmog_array_iterator< ArrayType > & operator-- ()
 The pre decrement operator.
 
xmog_array_iterator< ArrayType > operator-- (int)
 The post decrement operator.
 

Detailed Description

template<class ArrayType>
class xmog_array_iterator< ArrayType >

An iterator type for Java array instances.

This iterator supports the entire random_iterator contract and can be used in that fashion. Illegal indices will throw a Java proxy exception.

Member Typedef Documentation

◆ value_type

template<class ArrayType >
typedef ArrayType::value_type xmog_array_iterator< ArrayType >::value_type

The value type used when the iterator is dereferenced.

This type is derived from the array instance's value type.

Constructor & Destructor Documentation

◆ xmog_array_iterator() [1/3]

template<class ArrayType >
xmog_array_iterator< ArrayType >::xmog_array_iterator ( const xmog_array_iterator< ArrayType > &  rhs)
inline

The copy constructor (required by iterator contract).

Parameters
rhsthe other instance.

◆ xmog_array_iterator() [2/3]

template<class ArrayType >
xmog_array_iterator< ArrayType >::xmog_array_iterator ( ArrayType &  arr)
inline

The constructor that creates an iterator that is positioned on the first element of the array.

Parameters
arrthe array instance.

◆ xmog_array_iterator() [3/3]

template<class ArrayType >
xmog_array_iterator< ArrayType >::xmog_array_iterator ( ArrayType &  arr,
jint  ind 
)
inline

The constructor that creates an iterator that is positioned on an arbitrary element of the array.

Parameters
arrthe array instance.
indthe index into the array. -1 is interepreted as meaning after the last element of the array.

Member Function Documentation

◆ operator=()

template<class ArrayType >
xmog_array_iterator< ArrayType>& xmog_array_iterator< ArrayType >::operator= ( const xmog_array_iterator< ArrayType > &  rhs)
inline

The assignment operator (required by iterator contract).

Parameters
rhsthe other instance.

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

Copyright (c) 1999-2020 by Codemesh, Inc., ALL RIGHTS RESERVED.