GNU Octave 7.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-2022 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
34template <typename T>
35class
37{
38public:
39 static const mxClassID mx_class;
40 typedef T mx_type;
41};
42
43template <>
44class
46{
47public:
48 static const mxClassID mx_class = mxLOGICAL_CLASS;
49 typedef mxDouble mx_type;
50};
51
52template <>
53class
55{
56public:
57 static const mxClassID mx_class = mxCHAR_CLASS;
58 typedef mxChar mx_type;
59};
60
61template <>
62class
64{
65public:
66 static const mxClassID mx_class = mxDOUBLE_CLASS;
67 typedef mxDouble mx_type;
68};
69
70template <>
71class
73{
74public:
75 static const mxClassID mx_class = mxSINGLE_CLASS;
76 typedef mxSingle mx_type;
77};
78
79template <>
80class
82{
83public:
84 static const mxClassID mx_class = mxINT8_CLASS;
85 typedef mxInt8 mx_type;
86};
87
88template <>
89class
91{
92public:
93 static const mxClassID mx_class = mxUINT8_CLASS;
94 typedef mxUint8 mx_type;
95};
96
97template <>
98class
100{
101public:
102 static const mxClassID mx_class = mxINT16_CLASS;
103 typedef mxInt16 mx_type;
104};
105
106template <>
107class
109{
110public:
111 static const mxClassID mx_class = mxUINT16_CLASS;
112 typedef mxUint16 mx_type;
113};
114
115template <>
116class
118{
119public:
120 static const mxClassID mx_class = mxINT32_CLASS;
121 typedef mxInt32 mx_type;
122};
123
124template <>
125class
127{
128public:
129 static const mxClassID mx_class = mxUINT32_CLASS;
130 typedef mxUint32 mx_type;
131};
132
133template <>
134class
136{
137public:
138 static const mxClassID mx_class = mxINT64_CLASS;
139 typedef mxInt64 mx_type;
140};
141
142template <>
143class
145{
146public:
147 static const mxClassID mx_class = mxUINT64_CLASS;
148 typedef mxUint64 mx_type;
149};
150
151#endif
static const mxClassID mx_class