Pooma::IteratorPairDomain< Iter > Class Template Reference

Like IndirectionList<T>, IteratorPairDomain<T_Iter> provides access to an arbitrary sequence of T values. More...

#include <IteratorPairDomain.h>

List of all members.

Public Types

enum  { dimensions = 1 }
enum  { loopAware = false }
enum  { singleValued = false }
enum  { unitStride = false }
typedef IteratorPairDomain< Iter > This_t
typedef Iter iterator
typedef std::iterator_traits
< Iter > 
IterTraits_t
typedef IterTraits_t::value_type Element_t
typedef IterTraits_t::reference ElementRef_t
typedef long Size_t

Public Member Functions

 IteratorPairDomain ()
 IteratorPairDomain (Iter begin, Iter end)
 IteratorPairDomain (const This_t &a)
template<class OtherIter >
 IteratorPairDomain (const IteratorPairDomain< OtherIter > &a)
This_toperator= (const This_t &model)
This_toperator[] (int i)
const This_toperator[] (int i) const
Element_t operator() (Size_t i) const
ElementRef_t operator() (Size_t i)
Size_t length () const
Size_t size () const
bool empty () const
bool initialized () const
Element_t first () const
Element_t last () const
Element_t min () const
Element_t max () const
Iter begin () const
Iter end () const
template<class Out >
void print (Out &o) const
 Print an IteratorPairDomain to a stream, in the format "[" val1, val2, .


Detailed Description

template<class Iter>
class Pooma::IteratorPairDomain< Iter >

Like IndirectionList<T>, IteratorPairDomain<T_Iter> provides access to an arbitrary sequence of T values.

Rather than storing these in a DataBlockPtr, IteratorPairDomain simply stores a [begin,end) pair of iterators from some container. This is obviously cheaper, more flexible, and less coupled to other types (IndirectionList is implemented with a DataBlockPtr, which is not a particularly nice dependency). When using asynchronous threads for evaluation, one may need to take care with the type of iterators used. For instance, since IndirectionList uses a DataBlockPtr, its data is reference counted and will not go away if the original copy goes out of scope. This would not be true for, say, IteratorPairDomain<int*>. On the other hand, one can accomplish basically the same result wiht IteratorPairDomain<DataBlockPtr>, since DataBlockPtr is a valid iterator type.

Unlike IndirectionList, IteratorPairDomain does not currently support various arithmetic operations or various domain-domain operations. These may be added at a future date, though I think domain modifying operations are very dangerous when combined with shallow copy semantics. (e.g., IndirectionList does support such operations. However, things like

I1 = I2; I2 += 1;

don't do the same thing for IndirectionLists as they do for Interval and Range since the second statement modifies I2. This is A Bad Thing (TM,IMHO,JAC)).

Note that many uses of IteratorPairDomains (and IndirectionLists) assume that the points are ordered. However, there is nothing about the abstraction that dictates this - it is simply a usage pattern.

IteratorPairDomain<Iter> interface:

Types:

Constants:

Constructors:

Member functions:


Member Typedef Documentation

template<class Iter>
typedef IteratorPairDomain<Iter> Pooma::IteratorPairDomain< Iter >::This_t

template<class Iter>
typedef Iter Pooma::IteratorPairDomain< Iter >::iterator

template<class Iter>
typedef std::iterator_traits<Iter> Pooma::IteratorPairDomain< Iter >::IterTraits_t

template<class Iter>
typedef IterTraits_t::value_type Pooma::IteratorPairDomain< Iter >::Element_t

template<class Iter>
typedef IterTraits_t::reference Pooma::IteratorPairDomain< Iter >::ElementRef_t

template<class Iter>
typedef long Pooma::IteratorPairDomain< Iter >::Size_t


Member Enumeration Documentation

template<class Iter>
anonymous enum

Enumerator:
dimensions 

template<class Iter>
anonymous enum

Enumerator:
loopAware 

template<class Iter>
anonymous enum

Enumerator:
singleValued 

template<class Iter>
anonymous enum

Enumerator:
unitStride 


Constructor & Destructor Documentation

template<class Iter>
Pooma::IteratorPairDomain< Iter >::IteratorPairDomain (  )  [inline]

template<class Iter>
Pooma::IteratorPairDomain< Iter >::IteratorPairDomain ( Iter  begin,
Iter  end 
) [inline]

template<class Iter>
Pooma::IteratorPairDomain< Iter >::IteratorPairDomain ( const This_t a  )  [inline]

template<class Iter>
template<class OtherIter >
Pooma::IteratorPairDomain< Iter >::IteratorPairDomain ( const IteratorPairDomain< OtherIter > &  a  )  [inline]


Member Function Documentation

template<class Iter>
This_t& Pooma::IteratorPairDomain< Iter >::operator= ( const This_t model  )  [inline]

template<class Iter>
This_t& Pooma::IteratorPairDomain< Iter >::operator[] ( int  i  )  [inline]

References PAssert.

template<class Iter>
const This_t& Pooma::IteratorPairDomain< Iter >::operator[] ( int  i  )  const [inline]

References PAssert.

template<class Iter>
Element_t Pooma::IteratorPairDomain< Iter >::operator() ( Size_t  i  )  const [inline]

References PAssert.

template<class Iter>
ElementRef_t Pooma::IteratorPairDomain< Iter >::operator() ( Size_t  i  )  [inline]

References PAssert.

template<class Iter>
Size_t Pooma::IteratorPairDomain< Iter >::length (  )  const [inline]

template<class Iter>
Size_t Pooma::IteratorPairDomain< Iter >::size (  )  const [inline]

template<class Iter>
bool Pooma::IteratorPairDomain< Iter >::empty (  )  const [inline]

template<class Iter>
bool Pooma::IteratorPairDomain< Iter >::initialized (  )  const [inline]

template<class Iter>
Element_t Pooma::IteratorPairDomain< Iter >::first (  )  const [inline]

template<class Iter>
Element_t Pooma::IteratorPairDomain< Iter >::last (  )  const [inline]

template<class Iter>
Element_t Pooma::IteratorPairDomain< Iter >::min (  )  const [inline]

template<class Iter>
Element_t Pooma::IteratorPairDomain< Iter >::max (  )  const [inline]

template<class Iter>
Iter Pooma::IteratorPairDomain< Iter >::begin (  )  const [inline]

template<class Iter>
Iter Pooma::IteratorPairDomain< Iter >::end (  )  const [inline]

template<class Iter >
template<class Out >
void Pooma::IteratorPairDomain< Iter >::print ( Out &  o  )  const [inline]

Print an IteratorPairDomain to a stream, in the format "[" val1, val2, .

.. , valN "]"


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

Generated on Wed Mar 16 06:22:47 2011 for FreePOOMA by  doxygen 1.5.9