src/Utility/RNGAssignDefs.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 /***************************************************************************
00003  *
00004  * The IPPL Framework
00005  * 
00006  *
00007  * Visit http://people.web.psi.ch/adelmann/ for more details
00008  *
00009  ***************************************************************************/
00010 
00011 #ifndef RNG_ASSIGN_DEFS_H
00012 #define RNG_ASSIGN_DEFS_H
00013 
00014 // include files
00015 #include "PETE/IpplExpressions.h"
00016 #include "Field/AssignTags.h"
00017 
00018 
00019 // interactions for basic tags
00020 
00022 //
00023 // Evaluation functor.
00024 //
00026 
00027 template<class GT>
00028 inline typename SequenceGen<GT>::Return_t
00029 for_each(const SequenceGen<GT>& p, EvalFunctor_0)
00030 {
00031   return p();
00032 }
00033 
00035 //
00036 // Count the elements in an expression.
00037 //
00039 
00040 template<class GT, class C>
00041 inline int
00042 for_each(const SequenceGen<GT>&, PETE_CountElems, C)
00043 {
00044   // just return a code value
00045   return -1;
00046 }
00047 
00049 //
00050 // Increment the pointers in an expression.
00051 //
00053 
00054 template<class GT, class C>
00055 inline int
00056 for_each(const SequenceGen<GT>&, PETE_Increment, C)
00057 {
00058   // just return (increment happens automatically after evaluation!)
00059   return 0;
00060 }
00061 
00062 
00063 // Field-specific tag interactions
00064 
00065 
00067 //
00068 // Go to beginning of LField
00069 //
00071 
00072 template<class GT, class C>
00073 inline int
00074 for_each(const SequenceGen<GT>&, BeginLField, C)
00075 {
00076   // just return
00077   return 0;
00078 }
00079 
00081 //
00082 // Go on to the next LField
00083 //
00085 
00086 template<class GT, class C>
00087 inline int
00088 for_each(const SequenceGen<GT>&, NextLField, C)
00089 {
00090   // just return
00091   return 0;
00092 }
00093 
00094 //
00095 // If there is an RNG in the expr, it can't have the same ID.
00096 //
00097 template<class GT, class C>
00098 inline bool
00099 for_each(const SequenceGen<GT>&, SameFieldID, C)
00100 {
00101   return false;
00102 }
00103 
00104 //
00105 // for plugbase, just return true for RNG
00106 //
00107 template <unsigned D> struct PlugBase;
00108 
00109 template<class GT, class C, unsigned D>
00110 inline bool
00111 for_each(const SequenceGen<GT>&, const PlugBase<D>&, C)
00112 {
00113   return true;
00114 }
00115 
00116 //
00117 // RNG objects are not compressed!
00118 //
00119 template<class GT, class C>
00120 inline bool
00121 for_each(const SequenceGen<GT>&, IsCompressed, C)
00122 {
00123   return false;
00124 }
00125 
00127 //
00128 // Evaluation functors with arguments
00129 //
00131 
00132 template<class GT>
00133 inline typename SequenceGen<GT>::Return_t
00134 for_each(const SequenceGen<GT>& p, const EvalFunctor_1&)
00135 {
00136   return p();
00137 }
00138 
00139 template<class GT>
00140 inline typename SequenceGen<GT>::Return_t
00141 for_each(const SequenceGen<GT>& p, const EvalFunctor_2&)
00142 {
00143   return p();
00144 }
00145 
00146 template<class GT>
00147 inline typename SequenceGen<GT>::Return_t
00148 for_each(const SequenceGen<GT>& p, const EvalFunctor_3&)
00149 {
00150   return p();
00151 }
00152 
00153 //
00154 // Does it have unit stride?
00155 // Not really a sensible question, but it is safe to say it does.
00156 //
00157 
00158 template<class GT, class C>
00159 inline bool
00160 for_each(const SequenceGen<GT>& p, HasUnitStride, C)
00161 {
00162   return true;
00163 }
00164 
00165 
00166 //
00167 // RNG ignores step functor
00168 //
00169 template<class GT, class C>
00170 inline int
00171 for_each(const SequenceGen<GT>&, StepFunctor, C)
00172 {
00173   return 0;
00174 }
00175 
00176 //
00177 // RNG ignores rewind functor
00178 //
00179 template<class GT, class C>
00180 inline int
00181 for_each(const SequenceGen<GT>&, RewindFunctor, C)
00182 {
00183   return 0;
00184 }
00185 
00186 // RNG ignores filling guard cells question
00187 template<class GT, class C, unsigned int D, class T1>
00188 inline int
00189 for_each(const SequenceGen<GT>&,
00190          const FillGCIfNecessaryTag<D,T1> &, C)
00191 {
00192   return 0;
00193 }
00194 
00195 
00196 #endif // RNG_ASSIGN_DEFS_H
00197 
00198 /***************************************************************************
00199  * $RCSfile: RNGAssignDefs.h,v $   $Author: adelmann $
00200  * $Revision: 1.1.1.1 $   $Date: 2003/01/23 07:40:33 $
00201  * IPPL_VERSION_ID: $Id: RNGAssignDefs.h,v 1.1.1.1 2003/01/23 07:40:33 adelmann Exp $ 
00202  ***************************************************************************/
00203 

Generated on Mon Jan 16 13:23:59 2006 for IPPL by  doxygen 1.4.6