FreePOOMA
2.4.1
|
Like IndirectionList<T>, IteratorPairDomain<T_Iter> provides access to an arbitrary sequence of T values. More...
#include <IteratorPairDomain.h>
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_t & | operator= (const This_t &model) |
This_t & | operator[] (int i) |
const This_t & | operator[] (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, ... |
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:
typedef IteratorPairDomain<Iter> Pooma::IteratorPairDomain< Iter >::This_t |
typedef Iter Pooma::IteratorPairDomain< Iter >::iterator |
typedef std::iterator_traits<Iter> Pooma::IteratorPairDomain< Iter >::IterTraits_t |
typedef IterTraits_t::value_type Pooma::IteratorPairDomain< Iter >::Element_t |
typedef IterTraits_t::reference Pooma::IteratorPairDomain< Iter >::ElementRef_t |
typedef long Pooma::IteratorPairDomain< Iter >::Size_t |
Pooma::IteratorPairDomain< Iter >::IteratorPairDomain | ( | ) | [inline] |
Pooma::IteratorPairDomain< Iter >::IteratorPairDomain | ( | Iter | begin, |
Iter | end | ||
) | [inline] |
Pooma::IteratorPairDomain< Iter >::IteratorPairDomain | ( | const This_t & | a | ) | [inline] |
Pooma::IteratorPairDomain< Iter >::IteratorPairDomain | ( | const IteratorPairDomain< OtherIter > & | a | ) | [inline] |
This_t& Pooma::IteratorPairDomain< Iter >::operator= | ( | const This_t & | model | ) | [inline] |
This_t& Pooma::IteratorPairDomain< Iter >::operator[] | ( | int | i | ) | [inline] |
References PAssert.
const This_t& Pooma::IteratorPairDomain< Iter >::operator[] | ( | int | i | ) | const [inline] |
References PAssert.
Element_t Pooma::IteratorPairDomain< Iter >::operator() | ( | Size_t | i | ) | const [inline] |
References PAssert.
ElementRef_t Pooma::IteratorPairDomain< Iter >::operator() | ( | Size_t | i | ) | [inline] |
References PAssert.
Size_t Pooma::IteratorPairDomain< Iter >::length | ( | ) | const [inline] |
Size_t Pooma::IteratorPairDomain< Iter >::size | ( | ) | const [inline] |
bool Pooma::IteratorPairDomain< Iter >::empty | ( | ) | const [inline] |
bool Pooma::IteratorPairDomain< Iter >::initialized | ( | ) | const [inline] |
Element_t Pooma::IteratorPairDomain< Iter >::first | ( | ) | const [inline] |
Element_t Pooma::IteratorPairDomain< Iter >::last | ( | ) | const [inline] |
Element_t Pooma::IteratorPairDomain< Iter >::min | ( | ) | const [inline] |
Element_t Pooma::IteratorPairDomain< Iter >::max | ( | ) | const [inline] |
Iter Pooma::IteratorPairDomain< Iter >::begin | ( | ) | const [inline] |
Iter Pooma::IteratorPairDomain< Iter >::end | ( | ) | const [inline] |
void Pooma::IteratorPairDomain< Iter >::print | ( | Out & | o | ) | const |
Print an IteratorPairDomain to a stream, in the format "[" val1, val2, ...
, valN "]"