freepooma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] AltComponentView


From: Richard Guenther
Subject: [PATCH] AltComponentView
Date: Tue, 23 Mar 2004 10:10:57 +0100 (CET)

Hi!

Forgot that last time.

Ok?

Richard.


2004Mar23  Richard Guenther <address@hidden>

        * src/Array/Array.h: remove AltComponentView.

===== Array/Array.h 1.6 vs edited =====
--- 1.6/r2/src/Array/Array.h    Tue Nov 25 16:39:01 2003
+++ edited/Array/Array.h        Tue Mar 23 10:09:11 2004
@@ -649,8 +649,6 @@
 // an existing engine cannot be any kind of slice domain.
 // Also, bounds checking would make no sense because it would
 // reduce to contains(a.domain(), a.domain());
-//
-// Any changes to this class should also be made to AltView0.

 template<int Dim, class T, class EngineTag>
 struct View0<Array<Dim, T, EngineTag> >
@@ -695,41 +693,6 @@
     }
 };

-// AltView0 avoids an instantiation problem that arises when two
-// classes use each other.  This class's definition should be exactly
-// the same as View0 except omitting member functions.
-//
-// Do NOT explicitly instantiate this class.
-
-template<class ArrayTag>
-struct AltView0;
-
-template<int Dim, class T, class EngineTag>
-struct AltView0<Array<Dim, T, EngineTag> >
-{
-  // Convenience typedef for the thing we're taking a view of.
-
-  typedef Array<Dim, T, EngineTag> Subject_t;
-
-  // Deduce domains for the output type.
-  // At some point, we need to fix NewDomain1; until then, use
-  // the temporary version from Array.h.
-
-  typedef typename Subject_t::Engine_t Engine_t;
-  typedef typename Subject_t::Domain_t Domain_t;
-
-  // Deduce the template parameters for the output type.
-
-  typedef typename NewEngine<Engine_t, Domain_t>::Type_t NewEngine_t;
-  enum { newDim = NewEngine_t::dimensions };
-  typedef typename NewEngine_t::Tag_t NewEngineTag_t;
-
-  // The output types.
-
-  typedef Array<newDim, T, NewEngineTag_t> Type_t;
-  typedef Type_t ReadType_t;
-};
-
 template<int Dim, class T, class EngineTag>
 struct View1<Array<Dim, T, EngineTag>, int>
 {
@@ -1322,7 +1285,6 @@

 /**
  * ComponentView specialization for Array.
- * Changes to ComponentView should also be made to AltComponentView.
  */

 template<int Dim, class T, class EngineTag>
@@ -1358,36 +1320,6 @@
     }
 };

-/**
- * AltComponentView avoids an instantiation problem that arises when
- * two classes use each other.  These classes' definitions should be
- * exactly the same as ComponentView except omitting member functions.
- *
- * Do NOT explicitly instantiate these alternative classes.
- */
-
-template<class Components, class Arr>
-struct AltComponentView;
-
-template<class Components, int Dim, class T, class EngineTag>
-struct AltComponentView<Components, Array<Dim, T, EngineTag> >
-{
-  // Convenience typedef for the thing we're taking a component view of.
-
-  typedef Array<Dim, T, EngineTag> Subject_t;
-
-  // Deduce the template parameters for the output type.
-
-  typedef typename Subject_t::Element_t Element_t;
-  typedef typename Subject_t::Engine_t Engine_t;
-  typedef typename ComponentAccess<Element_t, Components>::Element_t NewT_t;
-  typedef CompFwd<Engine_t, Components> NewEngineTag_t;
-
-  // The output type.
-
-  typedef Array<Dim, NewT_t, NewEngineTag_t> Type_t;
-};
-
 //-----------------------------------------------------------------------------
 // Array
 //-----------------------------------------------------------------------------
@@ -1863,7 +1795,7 @@
   /// A zero-argument version of operator(), which takes a view of
   /// array's domain, is also supplied.
   //@{
-  typename AltView0<This_t>::ReadType_t
+  typename View0<This_t>::ReadType_t
   read() const
     {
       typedef View0<This_t> Ret_t;
@@ -1933,7 +1865,7 @@
       return Ret_t::makeRead(*this, s1, s2, s3, s4, s5, s6, s7);
     }

-  typename AltView0<This_t>::Type_t
+  typename View0<This_t>::Type_t
   operator()() const
     {
       typedef View0<This_t> Ret_t;
@@ -2014,46 +1946,46 @@
   /// ultimately work, Element_t must have a working const operator()(Loc<M>)
   /// that returns a reference or proxy to the component.
   //@{
-  inline typename AltComponentView<Loc<1>, This_t>::Type_t
+  inline typename ComponentView<Loc<1>, This_t>::Type_t
   comp(const int &i1) const
     {
       return ComponentView<Loc<1>, This_t>::make(*this, Loc<1>(i1));
     }

-  inline typename AltComponentView<Loc<2>, This_t>::Type_t
+  inline typename ComponentView<Loc<2>, This_t>::Type_t
   comp(int i1, int i2) const
     {
       return ComponentView<Loc<2>, This_t>::make(*this, Loc<2>(i1, i2));
     }

-  inline typename AltComponentView<Loc<3>, This_t>::Type_t
+  inline typename ComponentView<Loc<3>, This_t>::Type_t
   comp(int i1, int i2, int i3) const
     {
       return ComponentView<Loc<3>, This_t>::make(*this, Loc<3>(i1, i2, i3));
     }

-  inline typename AltComponentView<Loc<4>, This_t>::Type_t
+  inline typename ComponentView<Loc<4>, This_t>::Type_t
   comp(int i1, int i2, int i3, int i4) const
     {
       return ComponentView<Loc<4>, This_t>::make(*this,
         Loc<4>(i1, i2, i3, i4));
     }

-  inline typename AltComponentView<Loc<5>, This_t>::Type_t
+  inline typename ComponentView<Loc<5>, This_t>::Type_t
   comp(int i1, int i2, int i3, int i4, int i5) const
     {
       return ComponentView<Loc<5>, This_t>::make(*this,
         Loc<5>(i1, i2, i3, i4, i5));
     }

-  inline typename AltComponentView<Loc<6>, This_t>::Type_t
+  inline typename ComponentView<Loc<6>, This_t>::Type_t
   comp(int i1, int i2, int i3, int i4, int i5, int i6) const
     {
       return ComponentView<Loc<6>, This_t>::make(*this,
         Loc<6>(i1, i2, i3, i4, i5, i6));
     }

-  inline typename AltComponentView<Loc<7>, This_t>::Type_t
+  inline typename ComponentView<Loc<7>, This_t>::Type_t
   comp(int i1, int i2, int i3, int i4, int i5, int i6, int i7) const
     {
       return ComponentView<Loc<7>, This_t>::make(*this,
@@ -2611,6 +2543,6 @@
 // ACL:rcsinfo
 // ----------------------------------------------------------------------
 // $RCSfile: Array.h,v $   $Author: pooma $
-// $Revision: 1.149 $   $Date: 2003/11/21 17:35:16 $
+// $Revision: 1.150 $   $Date: 2004/03/02 18:18:45 $
 // ----------------------------------------------------------------------
 // ACL:rcsinfo

reply via email to

[Prev in Thread] Current Thread [Next in Thread]