Mercurial > octave
annotate libinterp/corefcn/mx-type-traits.h @ 33617:ec2635a02328 bytecode-interpreter tip
maint: Merge default to bytecode-interpreter.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Tue, 21 May 2024 18:29:03 +0200 |
parents | 3606817b9994 |
children |
rev | line source |
---|---|
28640 | 1 //////////////////////////////////////////////////////////////////////// |
2 // | |
32632
2e484f9f1f18
maint: update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
31706
diff
changeset
|
3 // Copyright (C) 2020-2024 The Octave Project Developers |
28640 | 4 // |
5 // See the file COPYRIGHT.md in the top-level directory of this | |
6 // distribution or <https://octave.org/copyright/>. | |
7 // | |
8 // This file is part of Octave. | |
9 // | |
10 // Octave is free software: you can redistribute it and/or modify it | |
11 // under the terms of the GNU General Public License as published by | |
12 // the Free Software Foundation, either version 3 of the License, or | |
13 // (at your option) any later version. | |
14 // | |
15 // Octave is distributed in the hope that it will be useful, but | |
16 // WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 // GNU General Public License for more details. | |
19 // | |
20 // You should have received a copy of the GNU General Public License | |
21 // along with Octave; see the file COPYING. If not, see | |
22 // <https://www.gnu.org/licenses/>. | |
23 // | |
24 //////////////////////////////////////////////////////////////////////// | |
25 | |
26 #if ! defined (octave_mx_type_traits_h) | |
27 #define octave_mx_type_traits_h 1 | |
28 | |
29 #include "octave-config.h" | |
30 | |
33344
3606817b9994
take adavantage of compiler warnings for unhandled enum switch cases
John W. Eaton <jwe@octave.org>
parents:
32633
diff
changeset
|
31 #include <string> |
3606817b9994
take adavantage of compiler warnings for unhandled enum switch cases
John W. Eaton <jwe@octave.org>
parents:
32633
diff
changeset
|
32 |
28640 | 33 #include "mxtypes.h" |
30435
1f0a2689cab2
Use forward declarations for octave_int<T> where possible (bug #59820).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29359
diff
changeset
|
34 #include "oct-inttypes-fwd.h" |
28640 | 35 |
36 template <typename T> | |
32628
ae4e19c0a2b1
maint: Place class name and class keyword on one line.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
37 class mx_type_traits |
28640 | 38 { |
39 public: | |
40 static const mxClassID mx_class; | |
41 typedef T mx_type; | |
42 }; | |
43 | |
44 template <> | |
32628
ae4e19c0a2b1
maint: Place class name and class keyword on one line.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
45 class mx_type_traits<bool> |
28640 | 46 { |
47 public: | |
48 static const mxClassID mx_class = mxLOGICAL_CLASS; | |
49 typedef mxDouble mx_type; | |
50 }; | |
51 | |
52 template <> | |
32628
ae4e19c0a2b1
maint: Place class name and class keyword on one line.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
53 class mx_type_traits<char> |
28640 | 54 { |
55 public: | |
56 static const mxClassID mx_class = mxCHAR_CLASS; | |
57 typedef mxChar mx_type; | |
58 }; | |
59 | |
60 template <> | |
32628
ae4e19c0a2b1
maint: Place class name and class keyword on one line.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
61 class mx_type_traits<double> |
28640 | 62 { |
63 public: | |
64 static const mxClassID mx_class = mxDOUBLE_CLASS; | |
65 typedef mxDouble mx_type; | |
66 }; | |
67 | |
68 template <> | |
32628
ae4e19c0a2b1
maint: Place class name and class keyword on one line.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
69 class mx_type_traits<float> |
28640 | 70 { |
71 public: | |
72 static const mxClassID mx_class = mxSINGLE_CLASS; | |
73 typedef mxSingle mx_type; | |
74 }; | |
75 | |
76 template <> | |
32628
ae4e19c0a2b1
maint: Place class name and class keyword on one line.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
77 class mx_type_traits<octave_int8> |
28640 | 78 { |
79 public: | |
80 static const mxClassID mx_class = mxINT8_CLASS; | |
81 typedef mxInt8 mx_type; | |
82 }; | |
83 | |
84 template <> | |
32628
ae4e19c0a2b1
maint: Place class name and class keyword on one line.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
85 class mx_type_traits<octave_uint8> |
28640 | 86 { |
87 public: | |
88 static const mxClassID mx_class = mxUINT8_CLASS; | |
89 typedef mxUint8 mx_type; | |
90 }; | |
91 | |
92 template <> | |
32628
ae4e19c0a2b1
maint: Place class name and class keyword on one line.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
93 class mx_type_traits<octave_int16> |
28640 | 94 { |
95 public: | |
96 static const mxClassID mx_class = mxINT16_CLASS; | |
97 typedef mxInt16 mx_type; | |
98 }; | |
99 | |
100 template <> | |
32628
ae4e19c0a2b1
maint: Place class name and class keyword on one line.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
101 class mx_type_traits<octave_uint16> |
28640 | 102 { |
103 public: | |
104 static const mxClassID mx_class = mxUINT16_CLASS; | |
105 typedef mxUint16 mx_type; | |
106 }; | |
107 | |
108 template <> | |
32628
ae4e19c0a2b1
maint: Place class name and class keyword on one line.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
109 class mx_type_traits<octave_int32> |
28640 | 110 { |
111 public: | |
112 static const mxClassID mx_class = mxINT32_CLASS; | |
113 typedef mxInt32 mx_type; | |
114 }; | |
115 | |
116 template <> | |
32628
ae4e19c0a2b1
maint: Place class name and class keyword on one line.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
117 class mx_type_traits<octave_uint32> |
28640 | 118 { |
119 public: | |
120 static const mxClassID mx_class = mxUINT32_CLASS; | |
121 typedef mxUint32 mx_type; | |
122 }; | |
123 | |
124 template <> | |
32628
ae4e19c0a2b1
maint: Place class name and class keyword on one line.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
125 class mx_type_traits<octave_int64> |
28640 | 126 { |
127 public: | |
128 static const mxClassID mx_class = mxINT64_CLASS; | |
129 typedef mxInt64 mx_type; | |
130 }; | |
131 | |
132 template <> | |
32628
ae4e19c0a2b1
maint: Place class name and class keyword on one line.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
133 class mx_type_traits<octave_uint64> |
28640 | 134 { |
135 public: | |
136 static const mxClassID mx_class = mxUINT64_CLASS; | |
137 typedef mxUint64 mx_type; | |
138 }; | |
139 | |
140 #endif |