Go to the documentation of this file.00001 #ifndef VIENNAGRID_TRAITS_POINT_HPP
00002 #define VIENNAGRID_TRAITS_POINT_HPP
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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
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