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

/export/development/ViennaGrid/release/ViennaGrid-1.0.0/viennagrid/traits/point.hpp

Go to the documentation of this file.
00001 #ifndef VIENNAGRID_TRAITS_POINT_HPP
00002 #define VIENNAGRID_TRAITS_POINT_HPP
00003 
00004 /* =======================================================================
00005    Copyright (c) 2011, Institute for Microelectronics,
00006                        Institute for Analysis and Scientific Computing,
00007                        TU Wien.
00008 
00009                             -----------------
00010                      ViennaGrid - The Vienna Grid Library
00011                             -----------------
00012 
00013    Authors:      Karl Rupp                           rupp@iue.tuwien.ac.at
00014                  Josef Weinbub                    weinbub@iue.tuwien.ac.at
00015                
00016    (A list of additional contributors can be found in the PDF manual)
00017 
00018    License:      MIT (X11), see file LICENSE in the base directory
00019 ======================================================================= */
00020 
00021 #include "viennagrid/forwards.h"
00022 
00027 namespace viennagrid 
00028 {
00029   
00030   namespace traits
00031   {
00033     template <typename PointType>
00034     struct dimension;
00035     
00037     template <typename CoordType, typename CoordinateSystem>
00038     struct dimension< point_t<CoordType, CoordinateSystem> >
00039     {
00040       enum { value = CoordinateSystem::dim };
00041     };
00042 
00043     
00045     template <typename PointType>
00046     struct coordinate_system
00047     {
00048       //by default, we don't know anything about the point type, so let's complain at compile time
00049       typedef typename PointType::ERROR_UNKNOWN_COORDINATE_SYSTEM_FOR_POINT_TYPE    type;
00050     };
00051     
00053     template <typename CoordType, typename CoordinateSystem>
00054     struct coordinate_system< point_t<CoordType, CoordinateSystem> >
00055     {
00056       typedef CoordinateSystem    type;
00057     };
00058 
00059     
00061     template <typename PointType>
00062     struct static_size;
00063 
00065     template <typename CoordType, typename CoordinateSystem>
00066     struct static_size< point_t<CoordType, CoordinateSystem> >
00067     {
00068       enum { value = CoordinateSystem::dim };
00069     };
00070 
00072     template <typename PointType>
00073     std::size_t dynamic_size(PointType const & p)
00074     {
00075       return p.size();
00076     }
00077     
00078     
00080     template <typename PointType>
00081     struct value_type;
00082 
00084     template <typename CoordType, typename CoordinateSystem>
00085     struct value_type< point_t<CoordType, CoordinateSystem> >
00086     {
00087       typedef CoordType    type;
00088     };
00089     
00090   }
00091 } 
00092 
00093 #endif

Generated on Wed Sep 14 2011 19:21:30 for ViennaGrid by  doxygen 1.7.1