SAMRAI::xfer::CoarsenTransactionFactory< DIM > Class Template Reference

Abstract base class defining the interface for all concrete transaction factory objects that generate data transaction objects used with a CoarsenSchedule<DIM> object. A concrete subclass will allocate new transaction objects. This class is an example of the ``Abstract Factory'' method described in the Design Patterns book by Gamma, et al. More...

#include <source/transfer/datamovers/standard/CoarsenTransactionFactory.h>

Inheritance diagram for SAMRAI::xfer::CoarsenTransactionFactory< DIM >:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 CoarsenTransactionFactory ()
 Default constructor.
virtual ~CoarsenTransactionFactory ()
 Virtual destructor.
virtual void setCoarsenItems (const typename CoarsenClasses< DIM >::Data **coarsen_items, int num_coarsen_items)=0
 Pure virtual function to set the array of CoarsenClass::Data items associated with the coarsen schedule. Typical concrete transactions used by the schedule use this information to communicate data. This operation is called by the coarsen schedule during the execution of the CoarsenSchedule<DIM>::fillData() routine before data communication operations begin.
virtual void unsetCoarsenItems ()=0
 Pure virtual function to clear the array of CoarsenClass::Data items associated with the coarsen schedule. This operation is called by the coarsen schedule after data communication operations are complete.
virtual tbox::Pointer< tbox::Transactionallocate (tbox::Pointer< hier::PatchLevel< DIM > > dst_level, tbox::Pointer< hier::PatchLevel< DIM > > src_level, tbox::Pointer< hier::BoxOverlap< DIM > > overlap, int dst_patch_id, int src_patch_id, int citem_id, tbox::Pointer< tbox::Arena > pool=(tbox::Arena *)(0)) const =0
 Pure virtual function to allocate a concrete coarsen transaction object. This routine is called by the coarsen schedule during construction of the schedule.

Detailed Description

template<int DIM>
class SAMRAI::xfer::CoarsenTransactionFactory< DIM >

Abstract base class defining the interface for all concrete transaction factory objects that generate data transaction objects used with a CoarsenSchedule<DIM> object. A concrete subclass will allocate new transaction objects. This class is an example of the ``Abstract Factory'' method described in the Design Patterns book by Gamma, et al.

To add a new type of Transaction object MyCoarsenTransaction:

  1. Implement a concrete CoarsenTransactionFactory<DIM> object as a subclass that is derived from this CoarsenTransactionFactory<DIM> base class. Implement the abstract virtual functions as appropriate for the concrete subclass; in particular, the allocate() function must return a new instance of the desired transaction object.
  2. The type of the transaction allocated by the concrete factory is a Transaction<DIM>. Thus, the new transaction object must be derived from the Transaction<DIM> base class and implement the abstract virtual functions declared by the base class.

See also:
tbox::Transaction


Constructor & Destructor Documentation

template<int DIM>
SAMRAI::xfer::CoarsenTransactionFactory< DIM >::CoarsenTransactionFactory (  ) 

Default constructor.

template<int DIM>
SAMRAI::xfer::CoarsenTransactionFactory< DIM >::~CoarsenTransactionFactory (  )  [virtual]

Virtual destructor.


Member Function Documentation

template<int DIM>
virtual void SAMRAI::xfer::CoarsenTransactionFactory< DIM >::setCoarsenItems ( const typename CoarsenClasses< DIM >::Data **  coarsen_items,
int  num_coarsen_items 
) [pure virtual]

Pure virtual function to set the array of CoarsenClass::Data items associated with the coarsen schedule. Typical concrete transactions used by the schedule use this information to communicate data. This operation is called by the coarsen schedule during the execution of the CoarsenSchedule<DIM>::fillData() routine before data communication operations begin.

Implemented in SAMRAI::xfer::StandardCoarsenTransactionFactory< DIM >.

template<int DIM>
virtual void SAMRAI::xfer::CoarsenTransactionFactory< DIM >::unsetCoarsenItems (  )  [pure virtual]

Pure virtual function to clear the array of CoarsenClass::Data items associated with the coarsen schedule. This operation is called by the coarsen schedule after data communication operations are complete.

Implemented in SAMRAI::xfer::StandardCoarsenTransactionFactory< DIM >.

template<int DIM>
virtual tbox::Pointer<tbox::Transaction> SAMRAI::xfer::CoarsenTransactionFactory< DIM >::allocate ( tbox::Pointer< hier::PatchLevel< DIM > >  dst_level,
tbox::Pointer< hier::PatchLevel< DIM > >  src_level,
tbox::Pointer< hier::BoxOverlap< DIM > >  overlap,
int  dst_patch_id,
int  src_patch_id,
int  citem_id,
tbox::Pointer< tbox::Arena pool = (tbox::Arena *)(0) 
) const [pure virtual]

Pure virtual function to allocate a concrete coarsen transaction object. This routine is called by the coarsen schedule during construction of the schedule.

Parameters:
dst_level tbox::Pointer to destination patch level.
src_level tbox::Pointer to source patch level.
overlap tbox::Pointer to overlap region between patches.
dst_patch_id Integer index of destination patch in destination patch level.
src_patch_id Integer index of source patch in source patch level.
citem_id Integer index of CoarsenClass::Data item associated with transaction.
pool Optional pointer to memory pool from which the refine transaction may be allocated. Default is null.

Implemented in SAMRAI::xfer::StandardCoarsenTransactionFactory< DIM >.


The documentation for this class was generated from the following files:
Generated on Thu Jun 18 11:29:10 2009 for SAMRAI by  doxygen 1.5.1