ivl 679
ivl/details/core/data/conversions_array_nd.hpp
00001 /* This file is part of the ivl C++ library <http://image.ntua.gr/ivl>.
00002    A C++ template library extending syntax towards mathematical notation.
00003 
00004    Copyright (C) 2012 Yannis Avrithis <iavr@image.ntua.gr>
00005    Copyright (C) 2012 Kimon Kontosis <kimonas@image.ntua.gr>
00006 
00007    ivl is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU Lesser General Public License 
00009    version 3 as published by the Free Software Foundation.
00010 
00011    Alternatively, you can redistribute it and/or modify it under the terms 
00012    of the GNU General Public License version 2 as published by the Free 
00013    Software Foundation.
00014 
00015    ivl is distributed in the hope that it will be useful,
00016    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
00018    See the GNU General Public License for more details.
00019 
00020    You should have received a copy of the GNU General Public License 
00021    and a copy of the GNU Lesser General Public License along 
00022    with ivl. If not, see <http://www.gnu.org/licenses/>. */
00023 
00024 #ifndef IVL_CORE_DETAILS_DATA_CONVERSIONS_ARRAY_ND_HPP
00025 #define IVL_CORE_DETAILS_DATA_CONVERSIONS_ARRAY_ND_HPP
00026 
00027 // This file is a sequel to conversions_array.hpp
00028 // It is exactly the same thing, but for data types that were not
00029 // included at all, when including array.hpp
00030 // Those data types are only defined when including array_nd.hpp.
00031 // When used in simple array<> classes they simply fallback to the
00032 // same implementation as normal.
00033 
00034 namespace ivl {
00035 
00036 namespace data {
00037 
00038 
00039 // The following structs describe the promotions that happen to the data types
00040 // when new arrays are automatically created as function return values.
00041 
00042 template<class D>
00043 struct conversion<normal_2d<D> >
00044 {
00045         struct array_creation
00046         {
00047                 typedef normal similar_type; // all new types used to be normal!!!
00048                 typedef normal new_type;
00049         };
00050         struct array_nd_creation
00051         {
00052                 typedef normal_2d<> similar_type;
00053                 typedef normal new_type;
00054         };
00055         struct derived_creation
00056         {
00057                 typedef normal_2d<> similar_type;
00058                 typedef normal_2d<> new_type;
00059         };
00060 };
00061 
00062 
00063 template<int N, class D>
00064 struct conversion<normal_image<N, D> >
00065 {
00066         struct array_creation
00067         {
00068                 typedef normal similar_type;
00069                 typedef normal new_type;
00070         };
00071         struct array_nd_creation
00072         {
00073                 typedef normal_image<N> similar_type;
00074                 typedef normal new_type;
00075         };
00076         struct derived_creation
00077         {
00078                 typedef normal_image<N> similar_type;
00079                 typedef normal_image<N> new_type; // but N will change!!!!!!!!!! or no.
00080         };
00081 };
00082 
00083 } //namespace data
00084 
00085 } //namespace ivl
00086 
00087 
00088 
00089 #endif // IVL_CORE_DETAILS_DATA_CONVERSIONS_ARRAY_ND_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations