DomainBase< DT > Class Template Reference

DomainBase

is the common base class for all Domain<Dim, DT> objects, regardless of the value of Dim. More...

#include <DomainBase.h>

Inheritance diagram for DomainBase< DT >:

Inheritance graph
[legend]

List of all members.

Public Types

typedef DT::Domain_t Domain_t
typedef DT::AskDomain_t AskDomain_t
typedef DT::MultResult_t MultResult_t
typedef DT::Storage_t Storage_t
typedef DomainIterator< Domain_tconst_iterator
typedef DomainIterator< Domain_titerator
typedef DomainBlockIterator
< Domain_t
const_blockIterator
typedef DomainBlockIterator
< Domain_t
blockIterator

Public Member Functions

 DomainBase ()
 DomainBase (const Pooma::NoInit &)
Domain_tunwrap ()
const Domain_tunwrap () const
AskDomain_t firsts () const
AskDomain_t lasts () const
AskDomain_t strides () const
AskDomain_t lengths () const
AskDomain_t sizes () const
AskDomain_t mins () const
AskDomain_t maxes () const
AskDomain_t loops () const
Storage_tstorage ()
const Storage_tstorage () const
MultResult_t operator- () const
const_iterator begin () const
const_iterator end () const
const_blockIterator beginBlock () const
const_blockIterator endBlock () const
template<class Out >
void print (Out &o) const
 print a domain to a stream, in the format "[" first:last:stride, first:last:stride, .

Protected Attributes

Storage_t domain_m


Detailed Description

template<class DT>
class DomainBase< DT >

DomainBase

is the common base class for all Domain<Dim, DT> objects, regardless of the value of Dim.

Since Domain<Dim,DT> is defined for general Dim and also specialized to Dim==1, then it is useful to collect common code for both cases into this base class. It also provides the standard typedefs and enumerations which all Domain's should have, with values determined by looking at the DomainTraits class. DT should be DomainTraits<Dom>, where Dom is a domain class like Loc<N>, Range<N>, etc. DomainTraits should be specialized for the different domain types which are to be set up.

The following typedefs and enums are defined here, basically just as wrappers around the values from the DomainTraits class:

This base class defines the following common interface methods for all Domain objects regardless of their dimensionality:

This file also defines binary arithmetic operations +, -, *, /, and general comparison operations <=, >=, !=, > (these use the < and == operators defined in Domain<DT,Dim>, just like the +,-,*,/ operators used the +=, -=, etc. operators in Domain<DT,Dim>).

When a DomainBase is created, it will initialize its storage if the default constructor is used. However, if you wish to avoid the work of initialization, you can use the constructor which takes a Pooma::NoInit object. In that case, storage space for the domain will be maintained, but it will not be initialized. This is useful if you know you will be changing the values later, and do not want to spend the extra time filling in zeros or something into the storage.

Finally, this file defines the operations to print a Domain to an ostream; the format for printing a domain is "[" followed by first():last():stride() for each dimension, followed by "]". For example, a 2D Range with the same sequence 1 ... 9 step 2 would be "[1:9:2,1:9:2]"


Member Typedef Documentation

template<class DT>
typedef DT::Domain_t DomainBase< DT >::Domain_t

template<class DT>
typedef DT::AskDomain_t DomainBase< DT >::AskDomain_t

template<class DT>
typedef DT::MultResult_t DomainBase< DT >::MultResult_t

template<class DT>
typedef DT::Storage_t DomainBase< DT >::Storage_t

template<class DT>
typedef DomainIterator<Domain_t> DomainBase< DT >::const_iterator

template<class DT>
typedef DomainIterator<Domain_t> DomainBase< DT >::iterator

template<class DT>
typedef DomainBlockIterator<Domain_t> DomainBase< DT >::const_blockIterator

template<class DT>
typedef DomainBlockIterator<Domain_t> DomainBase< DT >::blockIterator


Constructor & Destructor Documentation

template<class DT>
DomainBase< DT >::DomainBase (  )  [inline]

template<class DT>
DomainBase< DT >::DomainBase ( const Pooma::NoInit  )  [inline]


Member Function Documentation

template<class DT>
Domain_t& DomainBase< DT >::unwrap (  )  [inline]

template<class DT>
const Domain_t& DomainBase< DT >::unwrap (  )  const [inline]

template<class DT>
AskDomain_t DomainBase< DT >::firsts (  )  const [inline]

template<class DT>
AskDomain_t DomainBase< DT >::lasts (  )  const [inline]

template<class DT>
AskDomain_t DomainBase< DT >::strides (  )  const [inline]

template<class DT>
AskDomain_t DomainBase< DT >::lengths (  )  const [inline]

template<class DT>
AskDomain_t DomainBase< DT >::sizes (  )  const [inline]

template<class DT>
AskDomain_t DomainBase< DT >::mins (  )  const [inline]

template<class DT>
AskDomain_t DomainBase< DT >::maxes (  )  const [inline]

template<class DT>
AskDomain_t DomainBase< DT >::loops (  )  const [inline]

template<class DT>
Storage_t& DomainBase< DT >::storage (  )  [inline]

template<class DT>
const Storage_t& DomainBase< DT >::storage (  )  const [inline]

template<class DT>
MultResult_t DomainBase< DT >::operator- (  )  const [inline]

template<class DT>
const_iterator DomainBase< DT >::begin (  )  const [inline]

template<class DT>
const_iterator DomainBase< DT >::end (  )  const [inline]

template<class DT>
const_blockIterator DomainBase< DT >::beginBlock (  )  const [inline]

template<class DT>
const_blockIterator DomainBase< DT >::endBlock (  )  const [inline]

template<class DT>
template<class Out >
void DomainBase< DT >::print ( Out &  o  )  const [inline]

print a domain to a stream, in the format "[" first:last:stride, first:last:stride, .

.. first:last:stride "]"

Reimplemented in Grid< Dim >, Grid< 1 >, Loc< Dim >, Loc< 1 >, and Loc< Dim2 >.


Member Data Documentation

template<class DT>
Storage_t DomainBase< DT >::domain_m [protected]


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

Generated on Wed Mar 16 06:19:50 2011 for FreePOOMA by  doxygen 1.5.9