ExpTree.h

Go to the documentation of this file.
00001 /*
00002  * Expression Template Matrix Library
00003  *
00004  * Copyright (C) 2004 - 2006 Ricky Lung <mtlung@users.sourceforge.net>
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 
00022 
00030 #ifdef _MSC_VER
00031 #   pragma once
00032 #   pragma warning( push )
00033 #   pragma warning( disable : 4100 4786 )
00034 #endif  // _MSC_VER
00035 
00036 #ifndef _EXMAT_EXPTREE_H
00037 #define _EXMAT_EXPTREE_H
00038 
00039 #include "Tags.h"
00040 #include "Metaprogramming.h"
00041 #include "loki/Typelist.h"
00042 
00043 namespace exmat {
00044 
00046 
00049     template<class Exp_>
00050     struct LeafeNode {
00051         typedef Exp_ Exp;
00052         typedef NullTag left_child;
00053         typedef NullTag right_child;
00054         typedef Exp node_exp;
00055         typedef ::Loki::NullType tmp_list;
00056         typedef NullTag exp_tag;
00057         enum {
00058             TmpIndex = -1
00059         };
00060 
00061         template<class Any>
00062         static void print(Any) {}
00063         template<class Any1, class Any2> EXMAT_INLINE2
00064         static bool IsAliased(Any1& l, const Any2& exp, const bool IsNodePathLinear) {
00065             return (!IsNodePathLinear && (&l == (void*)&exp) );
00066         }
00067         template<class TInst, class TargetCon, class TarConIndex> EXMAT_INLINE2
00068         static const Exp& getNodeObj(const Exp& exp, TInst& tmpInst,
00069             TargetCon& tCon, Int2Type<1+2*0>, TarConIndex)
00070         {
00071             return exp;
00072         }
00073     };
00074 
00076 
00079     struct ViewNode {
00080         template<class Any1, class Any2> EXMAT_INLINE2
00081         static bool IsAliased(Any1& l, const Any2& exp, const bool IsNodePathLinear) {
00082             return false;
00083         }
00084     };
00085 }   // namespace exmat
00086 
00087 #if _MSC_VER
00088 #   pragma warning( pop )
00089 #endif  // EXMAT_VC
00090 
00091 #endif  // _EXMAT_EXPTREE_H

Generated on Sat May 6 23:11:57 2006 for Exmat by  doxygen 1.4.6-NO