GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
mx-type-traits.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2020-2024 The Octave Project Developers
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 
31 #include "mxtypes.h"
32 #include "oct-inttypes-fwd.h"
33 
34 template <typename T>
35 class
37 {
38 public:
39  static const mxClassID mx_class;
40  typedef T mx_type;
41 };
42 
43 template <>
44 class
46 {
47 public:
48  static const mxClassID mx_class = mxLOGICAL_CLASS;
49  typedef mxDouble mx_type;
50 };
51 
52 template <>
53 class
55 {
56 public:
57  static const mxClassID mx_class = mxCHAR_CLASS;
58  typedef mxChar mx_type;
59 };
60 
61 template <>
62 class
64 {
65 public:
66  static const mxClassID mx_class = mxDOUBLE_CLASS;
67  typedef mxDouble mx_type;
68 };
69 
70 template <>
71 class
73 {
74 public:
75  static const mxClassID mx_class = mxSINGLE_CLASS;
76  typedef mxSingle mx_type;
77 };
78 
79 template <>
80 class
82 {
83 public:
84  static const mxClassID mx_class = mxINT8_CLASS;
85  typedef mxInt8 mx_type;
86 };
87 
88 template <>
89 class
91 {
92 public:
93  static const mxClassID mx_class = mxUINT8_CLASS;
94  typedef mxUint8 mx_type;
95 };
96 
97 template <>
98 class
100 {
101 public:
102  static const mxClassID mx_class = mxINT16_CLASS;
103  typedef mxInt16 mx_type;
104 };
105 
106 template <>
107 class
109 {
110 public:
111  static const mxClassID mx_class = mxUINT16_CLASS;
112  typedef mxUint16 mx_type;
113 };
114 
115 template <>
116 class
118 {
119 public:
120  static const mxClassID mx_class = mxINT32_CLASS;
121  typedef mxInt32 mx_type;
122 };
123 
124 template <>
125 class
127 {
128 public:
129  static const mxClassID mx_class = mxUINT32_CLASS;
130  typedef mxUint32 mx_type;
131 };
132 
133 template <>
134 class
136 {
137 public:
138  static const mxClassID mx_class = mxINT64_CLASS;
139  typedef mxInt64 mx_type;
140 };
141 
142 template <>
143 class
145 {
146 public:
147  static const mxClassID mx_class = mxUINT64_CLASS;
148  typedef mxUint64 mx_type;
149 };
150 
151 #endif
static const mxClassID mx_class
int16_t mxInt16
Definition: mxtypes.h:95
char mxChar
Definition: mxtypes.h:87
uint64_t mxUint64
Definition: mxtypes.h:102
int32_t mxInt32
Definition: mxtypes.h:96
float mxSingle
Definition: mxtypes.h:92
mxClassID
Definition: mxtypes.h:57
@ mxINT8_CLASS
Definition: mxtypes.h:66
@ mxINT64_CLASS
Definition: mxtypes.h:72
@ mxUINT8_CLASS
Definition: mxtypes.h:67
@ mxLOGICAL_CLASS
Definition: mxtypes.h:61
@ mxINT32_CLASS
Definition: mxtypes.h:70
@ mxSINGLE_CLASS
Definition: mxtypes.h:65
@ mxDOUBLE_CLASS
Definition: mxtypes.h:64
@ mxUINT64_CLASS
Definition: mxtypes.h:73
@ mxCHAR_CLASS
Definition: mxtypes.h:62
@ mxUINT16_CLASS
Definition: mxtypes.h:69
@ mxUINT32_CLASS
Definition: mxtypes.h:71
@ mxINT16_CLASS
Definition: mxtypes.h:68
int64_t mxInt64
Definition: mxtypes.h:97
double mxDouble
Definition: mxtypes.h:91
uint32_t mxUint32
Definition: mxtypes.h:101
uint8_t mxUint8
Definition: mxtypes.h:99
uint16_t mxUint16
Definition: mxtypes.h:100
int8_t mxInt8
Definition: mxtypes.h:94