GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
mx-type-traits.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2020-2025 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 <string>
32
33#include "mxtypes.h"
34#include "oct-inttypes-fwd.h"
35
36template <typename T>
38{
39public:
40 static const mxClassID mx_class;
41 typedef T mx_type;
42};
43
44template <>
46{
47public:
48 static const mxClassID mx_class = mxLOGICAL_CLASS;
49 typedef mxDouble mx_type;
50};
51
52template <>
53class mx_type_traits<char>
54{
55public:
56 static const mxClassID mx_class = mxCHAR_CLASS;
57 typedef mxChar mx_type;
58};
59
60template <>
62{
63public:
64 static const mxClassID mx_class = mxDOUBLE_CLASS;
65 typedef mxDouble mx_type;
66};
67
68template <>
70{
71public:
72 static const mxClassID mx_class = mxSINGLE_CLASS;
73 typedef mxSingle mx_type;
74};
75
76template <>
78{
79public:
80 static const mxClassID mx_class = mxINT8_CLASS;
81 typedef mxInt8 mx_type;
82};
83
84template <>
86{
87public:
88 static const mxClassID mx_class = mxUINT8_CLASS;
89 typedef mxUint8 mx_type;
90};
91
92template <>
94{
95public:
96 static const mxClassID mx_class = mxINT16_CLASS;
97 typedef mxInt16 mx_type;
98};
99
100template <>
102{
103public:
104 static const mxClassID mx_class = mxUINT16_CLASS;
105 typedef mxUint16 mx_type;
106};
107
108template <>
110{
111public:
112 static const mxClassID mx_class = mxINT32_CLASS;
113 typedef mxInt32 mx_type;
114};
115
116template <>
118{
119public:
120 static const mxClassID mx_class = mxUINT32_CLASS;
121 typedef mxUint32 mx_type;
122};
123
124template <>
126{
127public:
128 static const mxClassID mx_class = mxINT64_CLASS;
129 typedef mxInt64 mx_type;
130};
131
132template <>
134{
135public:
136 static const mxClassID mx_class = mxUINT64_CLASS;
137 typedef mxUint64 mx_type;
138};
139
140#endif
static const mxClassID mx_class