Octave-Forge - Extra packages for GNU Octave | |
Home · Packages · Developers · Documentation · FAQ · Bugs · Mailing Lists · Links · Code |
00001 /* 00002 00003 Copyright (C) 2004, 2005, 2007 John W. Eaton 00004 00005 This file is part of Octave. 00006 00007 Octave is free software; you can redistribute it and/or modify it 00008 under the terms of the GNU General Public License as published by the 00009 Free Software Foundation; either version 3 of the License, or (at your 00010 option) any later version. 00011 00012 Octave is distributed in the hope that it will be useful, but WITHOUT 00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00014 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00015 for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with Octave; see the file COPYING. If not, see 00019 <http://www.gnu.org/licenses/>. 00020 00021 */ 00022 00023 #if !defined (octave_value_int_traits_h) 00024 #define octave_value_int_traits_h 1 00025 00026 #include "ov-int8.h" 00027 #include "ov-int16.h" 00028 #include "ov-int32.h" 00029 #include "ov-int64.h" 00030 00031 #include "ov-uint8.h" 00032 #include "ov-uint16.h" 00033 #include "ov-uint32.h" 00034 #include "ov-uint64.h" 00035 00036 template <class T> 00037 class 00038 octave_value_int_traits 00039 { 00040 public: 00041 typedef T scalar_type; 00042 }; 00043 00044 #define OCTAVE_VALUE_INT_TRAITS(MT, ST) \ 00045 template<> \ 00046 class \ 00047 octave_value_int_traits<MT> \ 00048 { \ 00049 public: \ 00050 typedef ST scalar_type; \ 00051 } 00052 00053 OCTAVE_VALUE_INT_TRAITS(int8NDArray, octave_int8_scalar); 00054 OCTAVE_VALUE_INT_TRAITS(int16NDArray, octave_int16_scalar); 00055 OCTAVE_VALUE_INT_TRAITS(int32NDArray, octave_int32_scalar); 00056 OCTAVE_VALUE_INT_TRAITS(int64NDArray, octave_int64_scalar); 00057 00058 OCTAVE_VALUE_INT_TRAITS(uint8NDArray, octave_uint8_scalar); 00059 OCTAVE_VALUE_INT_TRAITS(uint16NDArray, octave_uint16_scalar); 00060 OCTAVE_VALUE_INT_TRAITS(uint32NDArray, octave_uint32_scalar); 00061 OCTAVE_VALUE_INT_TRAITS(uint64NDArray, octave_uint64_scalar); 00062 00063 #endif 00064 00065 /* 00066 ;;; Local Variables: *** 00067 ;;; mode: C++ *** 00068 ;;; End: *** 00069 */