• Main Page
  • Namespaces
  • Data Structures
  • Files
  • File List

/export/development/ViennaMath/viennamath/compiletime/ct_function_symbol.hpp

Go to the documentation of this file.
00001 #ifndef VIENNAMATH_COMPILETIME_CT_FUNCTION_SYMBOL_HPP
00002 #define VIENNAMATH_COMPILETIME_CT_FUNCTION_SYMBOL_HPP
00003 
00004 /* =======================================================================
00005    Copyright (c) 2012, Institute for Microelectronics,
00006                        Institute for Analysis and Scientific Computing,
00007                        TU Wien.
00008                              -----------------
00009                ViennaMath - Symbolic and Numerical Math in C++
00010                              -----------------
00011 
00012    Author:     Karl Rupp                          rupp@iue.tuwien.ac.at
00013 
00014    License:    MIT (X11), see file LICENSE in the ViennaMath base directory
00015 ======================================================================= */
00016 
00017 
00018 
00019 
00020 
00021 #include <ostream>
00022 #include <sstream>
00023 #include <vector>
00024 #include "viennamath/forwards.h"
00025 //#include "viennamath/expression_compile_time.hpp"
00026 //#include "viennamath/expression_run_time.hpp"
00027 
00032 namespace viennamath
00033 {
00034   
00036   
00038   template <id_type ct_id = 0>
00039   struct unknown_tag
00040   {
00041     static std::string str()
00042     {
00043       std::stringstream ss;
00044       ss << "unknown[" << ct_id << "]";
00045       return ss.str();
00046     }
00047     
00048     static id_type tag_id() { return 0; }
00049   };
00050     
00052   template <id_type ct_id = 0>
00053   struct test_tag
00054   {
00055     static std::string str()
00056     {
00057       std::stringstream ss;
00058       ss << "test[" << ct_id << "]";
00059       return ss.str();
00060     }
00061     
00062     static id_type tag_id() { return 1; }
00063   };
00064   
00065   
00066   
00067   
00068   
00069   
00070 
00075   template <typename Tag>
00076   class ct_function_symbol
00077   {
00078       static std::string str()
00079       {
00080         return Tag::str();
00081       }
00082   };
00083 
00084   
00085   
00087   template <typename Tag>
00088   std::ostream& operator<<(std::ostream & stream, ct_function_symbol<Tag> const & v)
00089   {
00090     stream << ct_function_symbol<Tag>::str();
00091     return stream;
00092   }
00093   
00094   
00095   
00096 }
00097 
00098 #endif

Generated on Wed Feb 29 2012 21:50:43 for ViennaMath by  doxygen 1.7.1