annotate libinterp/corefcn/mxarray.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 2e484f9f1f18
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ////////////////////////////////////////////////////////////////////////
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 //
32632
2e484f9f1f18 maint: update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 31855
diff changeset
3 // Copyright (C) 2001-2024 The Octave Project Developers
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 // See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 // distribution or <https://octave.org/copyright/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
7 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
8 // This file is part of Octave.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
9 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
10 // Octave is free software: you can redistribute it and/or modify it
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
11 // under the terms of the GNU General Public License as published by
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
12 // the Free Software Foundation, either version 3 of the License, or
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
13 // (at your option) any later version.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
14 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
15 // Octave is distributed in the hope that it will be useful, but
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
18 // GNU General Public License for more details.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
19 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
20 // You should have received a copy of the GNU General Public License
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
21 // along with Octave; see the file COPYING. If not, see
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
22 // <https://www.gnu.org/licenses/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ////////////////////////////////////////////////////////////////////////
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
25
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
26 /*
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
27
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
28 Part of this code was originally distributed as part of Octave Forge under
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
29 the following terms:
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
30
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
31 Author: Paul Kienzle
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
32 I grant this code to the public domain.
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
33 2001-03-22
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
34
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
35 THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
36 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
37 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
38 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
39 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
40 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
41 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
42 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
43 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
44 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
45 SUCH DAMAGE.
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
46
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
47 */
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
48
21241
bae38398f5f1 use consistent style for all liboctave and libinterp include guards
John W. Eaton <jwe@octave.org>
parents: 21151
diff changeset
49 #if ! defined (octave_mxarray_h)
bae38398f5f1 use consistent style for all liboctave and libinterp include guards
John W. Eaton <jwe@octave.org>
parents: 21151
diff changeset
50 #define octave_mxarray_h 1
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
51
21244
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21241
diff changeset
52 #include "octave-config.h"
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21241
diff changeset
53
28123
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents: 27957
diff changeset
54 #include "mxtypes.h"
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
55
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
56 #if ! defined (MXARRAY_TYPEDEFS_ONLY)
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
57
7417
33577b0d4df2 [project @ 2008-01-25 01:21:35 by jwe]
jwe
parents: 7056
diff changeset
58 #include <cstring>
21151
bfd5e48c41a1 Rename local error in mex I/F from invalid_type_error to err_invalid_type.
Rik <rik@octave.org>
parents: 21066
diff changeset
59 #include "error.h"
7417
33577b0d4df2 [project @ 2008-01-25 01:21:35 by jwe]
jwe
parents: 7056
diff changeset
60
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
61 class octave_value;
23442
53f5f8231c37 allow most header files to be compiled separately
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
62 class dim_vector;
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
63
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21568
diff changeset
64 #define DO_MUTABLE_METHOD(RET_T, METHOD_CALL) \
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
65 RET_T retval = m_rep->METHOD_CALL; \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21568
diff changeset
66 \
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
67 if (m_rep->mutation_needed ()) \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21568
diff changeset
68 { \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21568
diff changeset
69 maybe_mutate (); \
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
70 retval = m_rep->METHOD_CALL; \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21568
diff changeset
71 } \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21568
diff changeset
72 \
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
73 return retval
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
74
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21568
diff changeset
75 #define DO_VOID_MUTABLE_METHOD(METHOD_CALL) \
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
76 m_rep->METHOD_CALL; \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21568
diff changeset
77 \
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
78 if (m_rep->mutation_needed ()) \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21568
diff changeset
79 { \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21568
diff changeset
80 maybe_mutate (); \
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
81 m_rep->METHOD_CALL; \
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
82 }
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
83
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
84 class OCTINTERP_API mxArray;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
85
21151
bfd5e48c41a1 Rename local error in mex I/F from invalid_type_error to err_invalid_type.
Rik <rik@octave.org>
parents: 21066
diff changeset
86 // A class to provide the default implementation of some of the
bfd5e48c41a1 Rename local error in mex I/F from invalid_type_error to err_invalid_type.
Rik <rik@octave.org>
parents: 21066
diff changeset
87 // virtual functions declared in the mxArray class.
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
88
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
89 class OCTINTERP_API mxArray_base
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
90 {
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
91 protected:
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
92
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
93 OCTINTERP_API mxArray_base (bool interleaved);
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
94
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
95 public:
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
96
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
97 mxArray_base () = delete;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
98
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
99 OCTAVE_DEFAULT_COPY_MOVE (mxArray_base)
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
100
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
101 virtual mxArray_base * dup () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
102
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
103 virtual mxArray * as_mxArray () const { return nullptr; }
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
104
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
105 virtual ~mxArray_base () = default;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
106
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
107 virtual bool is_octave_value () const { return false; }
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
108
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
109 virtual int iscell () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
110
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
111 virtual int is_char () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
112
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
113 virtual int is_class (const char *name_arg) const
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
114 {
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
115 int retval = 0;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
116
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
117 const char *cname = get_class_name ();
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
118
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
119 if (cname && name_arg)
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
120 retval = ! strcmp (cname, name_arg);
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
121
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
122 return retval;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
123 }
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
124
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
125 virtual int is_complex () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
126
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
127 virtual int is_double () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
128
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
129 virtual int is_function_handle () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
130
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
131 virtual int is_int16 () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
132
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
133 virtual int is_int32 () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
134
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
135 virtual int is_int64 () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
136
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
137 virtual int is_int8 () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
138
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
139 virtual int is_logical () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
140
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
141 virtual int is_numeric () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
142
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
143 virtual int is_single () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
144
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
145 virtual int is_sparse () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
146
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
147 virtual int is_struct () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
148
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
149 virtual int is_uint16 () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
150
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
151 virtual int is_uint32 () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
152
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
153 virtual int is_uint64 () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
154
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
155 virtual int is_uint8 () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
156
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
157 virtual int is_logical_scalar () const
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
158 {
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
159 return is_logical () && get_number_of_elements () == 1;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
160 }
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
161
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
162 virtual int is_logical_scalar_true () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
163
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
164 virtual mwSize get_m () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
165
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
166 virtual mwSize get_n () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
167
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
168 virtual mwSize * get_dimensions () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
169
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
170 virtual mwSize get_number_of_dimensions () const = 0;
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
171
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
172 virtual void set_m (mwSize m) = 0;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
173
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
174 virtual void set_n (mwSize n) = 0;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
175
22471
667d353d1ab8 Clean up MEX API prototypes to match Matlab.
Rik <rik@octave.org>
parents: 22464
diff changeset
176 virtual int set_dimensions (mwSize *dims_arg, mwSize ndims_arg) = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
177
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
178 virtual mwSize get_number_of_elements () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
179
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
180 virtual int isempty () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
181
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
182 virtual bool is_scalar () const = 0;
22462
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22453
diff changeset
183
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
184 virtual mxClassID get_class_id () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
185
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
186 virtual const char * get_class_name () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
187
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
188 virtual void set_class_name (const char *name_arg) = 0;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
189
27956
2310164737b3 fix many spelling errors (bug #57613)
John W. Eaton <jwe@octave.org>
parents: 26405
diff changeset
190 // The following functions aren't pure virtual because they are only
2310164737b3 fix many spelling errors (bug #57613)
John W. Eaton <jwe@octave.org>
parents: 26405
diff changeset
191 // valid for one type. Making them pure virtual would mean that they
23893
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
192 // have to be implemented for all derived types, and all of those
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
193 // would need to throw errors instead of just doing it once here.
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
194
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
195 virtual mxArray *
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
196 get_property (mwIndex /*idx*/, const char * /*pname*/) const
23884
bd9e719f04cc new mxGetProperty function for MEX API
Piotr Held <pjheld@gmail.com>
parents: 23795
diff changeset
197 {
bd9e719f04cc new mxGetProperty function for MEX API
Piotr Held <pjheld@gmail.com>
parents: 23795
diff changeset
198 return nullptr;
bd9e719f04cc new mxGetProperty function for MEX API
Piotr Held <pjheld@gmail.com>
parents: 23795
diff changeset
199 }
bd9e719f04cc new mxGetProperty function for MEX API
Piotr Held <pjheld@gmail.com>
parents: 23795
diff changeset
200
23893
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
201 virtual void set_property (mwIndex /*idx*/, const char * /*pname*/,
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
202 const mxArray * /*pval*/)
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
203 {
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
204 err_invalid_type ("set_property");
23893
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
205 }
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
206
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23442
diff changeset
207 virtual mxArray * get_cell (mwIndex /*idx*/) const
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
208 {
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
209 err_invalid_type ("get_cell");
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
210 }
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
211
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
212 virtual void set_cell (mwIndex idx, mxArray *val) = 0;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
213
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
214 virtual double get_scalar () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
215
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
216 virtual void * get_data () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
217
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
218 virtual mxDouble * get_doubles () const = 0;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
219 virtual mxSingle * get_singles () const = 0;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
220 virtual mxInt8 * get_int8s () const = 0;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
221 virtual mxInt16 * get_int16s () const = 0;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
222 virtual mxInt32 * get_int32s () const = 0;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
223 virtual mxInt64 * get_int64s () const = 0;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
224 virtual mxUint8 * get_uint8s () const = 0;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
225 virtual mxUint16 * get_uint16s () const = 0;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
226 virtual mxUint32 * get_uint32s () const = 0;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
227 virtual mxUint64 * get_uint64s () const = 0;
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
228
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
229 virtual mxComplexDouble * get_complex_doubles () const = 0;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
230 virtual mxComplexSingle * get_complex_singles () const = 0;
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
231
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
232 virtual void * get_imag_data () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
233
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
234 virtual void set_data (void *pr) = 0;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
235
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
236 virtual int set_doubles (mxDouble *data) = 0;
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
237 virtual int set_singles (mxSingle *data) = 0;
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
238 virtual int set_int8s (mxInt8 *data) = 0;
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
239 virtual int set_int16s (mxInt16 *data) = 0;
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
240 virtual int set_int32s (mxInt32 *data) = 0;
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
241 virtual int set_int64s (mxInt64 *data) = 0;
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
242 virtual int set_uint8s (mxUint8 *data) = 0;
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
243 virtual int set_uint16s (mxUint16 *data) = 0;
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
244 virtual int set_uint32s (mxUint32 *data) = 0;
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
245 virtual int set_uint64s (mxUint64 *data) = 0;
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
246
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
247 virtual int set_complex_doubles (mxComplexDouble *data) = 0;
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
248 virtual int set_complex_singles (mxComplexSingle *data) = 0;
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
249
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
250 virtual void set_imag_data (void *pi) = 0;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
251
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
252 virtual mwIndex * get_ir () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
253
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
254 virtual mwIndex * get_jc () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
255
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
256 virtual mwSize get_nzmax () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
257
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
258 virtual void set_ir (mwIndex *ir) = 0;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
259
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
260 virtual void set_jc (mwIndex *jc) = 0;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
261
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
262 virtual void set_nzmax (mwSize nzmax) = 0;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
263
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
264 virtual int add_field (const char *key) = 0;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
265
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
266 virtual void remove_field (int key_num) = 0;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
267
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23442
diff changeset
268 virtual mxArray * get_field_by_number (mwIndex index, int key_num) const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
269
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
270 virtual void
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
271 set_field_by_number (mwIndex index, int key_num, mxArray *val) = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
272
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
273 virtual int get_number_of_fields () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
274
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23442
diff changeset
275 virtual const char * get_field_name_by_number (int key_num) const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
276
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
277 virtual int get_field_number (const char *key) const = 0;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
278
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
279 virtual int get_string (char *buf, mwSize buflen) const = 0;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
280
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
281 virtual char * array_to_string () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
282
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
283 virtual mwIndex calc_single_subscript (mwSize nsubs, mwIndex *subs) const = 0;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
284
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
285 virtual std::size_t get_element_size () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
286
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
287 virtual bool mutation_needed () const { return false; }
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
288
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
289 virtual mxArray * mutate () const { return nullptr; }
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
290
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
291 virtual octave_value as_octave_value () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
292
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
293 protected:
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
294
29572
aef11bb4e6d1 use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
295 std::size_t get_numeric_element_size (std::size_t size) const
21151
bfd5e48c41a1 Rename local error in mex I/F from invalid_type_error to err_invalid_type.
Rik <rik@octave.org>
parents: 21066
diff changeset
296 {
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
297 return (m_interleaved
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
298 ? is_complex () ? 2 * size : size
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
299 : size);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
300 }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
301
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
302 OCTAVE_NORETURN void err_invalid_type (const char *op) const
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
303 {
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
304 error ("%s: invalid type for mxArray::%s", get_class_name (), op);
21151
bfd5e48c41a1 Rename local error in mex I/F from invalid_type_error to err_invalid_type.
Rik <rik@octave.org>
parents: 21066
diff changeset
305 }
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
306
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
307 //--------
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
308
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
309 // If TRUE, we are using interleaved storage for complex numeric arrays.
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
310 bool m_interleaved;
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
311
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
312 };
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
313
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
314 // The main interface class. The representation can be based on an
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
315 // octave_value object or a separate object that tries to reproduce
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
316 // the semantics of mxArray objects in Matlab more directly.
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
317
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
318 class mxArray
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
319 {
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
320 public:
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
321
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
322 OCTINTERP_API mxArray (bool interleaved, const octave_value& ov);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
323
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
324 OCTINTERP_API mxArray (bool interleaved, mxClassID id, mwSize ndims,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
325 const mwSize *dims, mxComplexity flag = mxREAL,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
326 bool init = true);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
327
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
328 OCTINTERP_API mxArray (bool interleaved, mxClassID id, const dim_vector& dv,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
329 mxComplexity flag = mxREAL);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
330
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
331 OCTINTERP_API mxArray (bool interleaved, mxClassID id, mwSize m, mwSize n,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
332 mxComplexity flag = mxREAL, bool init = true);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
333
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
334 OCTINTERP_API mxArray (bool interleaved, mxClassID id, double val);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
335
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
336 OCTINTERP_API mxArray (bool interleaved, mxClassID id, mxLogical val);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
337
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
338 OCTINTERP_API mxArray (bool interleaved, const char *str);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
339
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
340 OCTINTERP_API mxArray (bool interleaved, mwSize m, const char **str);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
341
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
342 OCTINTERP_API mxArray (bool interleaved, mxClassID id, mwSize m, mwSize n,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
343 mwSize nzmax, mxComplexity flag = mxREAL);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
344
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
345 OCTINTERP_API mxArray (bool interleaved, mwSize ndims, const mwSize *dims,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
346 int num_keys, const char **keys);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
347
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
348 OCTINTERP_API mxArray (bool interleaved, const dim_vector& dv, int num_keys,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
349 const char **keys);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
350
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
351 OCTINTERP_API mxArray (bool interleaved, mwSize m, mwSize n, int num_keys,
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
352 const char **keys);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
353
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
354 OCTINTERP_API mxArray (bool interleaved, mwSize ndims, const mwSize *dims);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
355
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
356 OCTINTERP_API mxArray (bool interleaved, const dim_vector& dv);
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
357
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
358 OCTINTERP_API mxArray (bool interleaved, mwSize m, mwSize n);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
359
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
360 mxArray * dup () const
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
361 {
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
362 mxArray *retval = m_rep->as_mxArray ();
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
363
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
364 if (retval)
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
365 retval->set_name (m_name);
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
366 else
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
367 {
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
368 mxArray_base *new_rep = m_rep->dup ();
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
369
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
370 retval = new mxArray (new_rep, m_name);
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
371 }
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
372
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
373 return retval;
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
374 }
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
375
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31837
diff changeset
376 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (mxArray)
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
377
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
378 OCTINTERP_API ~mxArray ();
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
379
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
380 bool is_octave_value () const { return m_rep->is_octave_value (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
381
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
382 int iscell () const { return m_rep->iscell (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
383
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
384 int is_char () const { return m_rep->is_char (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
385
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
386 int is_class (const char *name_arg) const { return m_rep->is_class (name_arg); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
387
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
388 int is_complex () const { return m_rep->is_complex (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
389
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
390 int is_double () const { return m_rep->is_double (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
391
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
392 int is_function_handle () const { return m_rep->is_function_handle (); }
11100
cdf940db26a0 provide mxIsFunctionHandle MEX interface function
John W. Eaton <jwe@octave.org>
parents: 10317
diff changeset
393
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
394 int is_int16 () const { return m_rep->is_int16 (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
395
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
396 int is_int32 () const { return m_rep->is_int32 (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
397
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
398 int is_int64 () const { return m_rep->is_int64 (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
399
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
400 int is_int8 () const { return m_rep->is_int8 (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
401
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
402 int is_logical () const { return m_rep->is_logical (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
403
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
404 int is_numeric () const { return m_rep->is_numeric (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
405
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
406 int is_single () const { return m_rep->is_single (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
407
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
408 int is_sparse () const { return m_rep->is_sparse (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
409
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
410 int is_struct () const { return m_rep->is_struct (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
411
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
412 int is_uint16 () const { return m_rep->is_uint16 (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
413
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
414 int is_uint32 () const { return m_rep->is_uint32 (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
415
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
416 int is_uint64 () const { return m_rep->is_uint64 (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
417
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
418 int is_uint8 () const { return m_rep->is_uint8 (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
419
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
420 int is_logical_scalar () const { return m_rep->is_logical_scalar (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
421
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
422 int is_logical_scalar_true () const
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
423 { return m_rep->is_logical_scalar_true (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
424
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
425 mwSize get_m () const { return m_rep->get_m (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
426
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
427 mwSize get_n () const { return m_rep->get_n (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
428
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
429 mwSize * get_dimensions () const { return m_rep->get_dimensions (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
430
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
431 mwSize get_number_of_dimensions () const
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
432 { return m_rep->get_number_of_dimensions (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
433
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
434 void set_m (mwSize m) { DO_VOID_MUTABLE_METHOD (set_m (m)); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
435
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
436 void set_n (mwSize n) { DO_VOID_MUTABLE_METHOD (set_n (n)); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
437
22471
667d353d1ab8 Clean up MEX API prototypes to match Matlab.
Rik <rik@octave.org>
parents: 22464
diff changeset
438 int set_dimensions (mwSize *dims_arg, mwSize ndims_arg)
667d353d1ab8 Clean up MEX API prototypes to match Matlab.
Rik <rik@octave.org>
parents: 22464
diff changeset
439 { DO_MUTABLE_METHOD (int, set_dimensions (dims_arg, ndims_arg)); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
440
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
441 mwSize get_number_of_elements () const
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
442 { return m_rep->get_number_of_elements (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
443
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
444 int isempty () const { return get_number_of_elements () == 0; }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
445
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
446 bool is_scalar () const { return m_rep->is_scalar (); }
22462
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22453
diff changeset
447
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
448 const char * get_name () const { return m_name; }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
449
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
450 OCTINTERP_API void set_name (const char *name);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
451
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
452 mxClassID get_class_id () const { return m_rep->get_class_id (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
453
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
454 const char * get_class_name () const { return m_rep->get_class_name (); }
23893
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
455
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
456 mxArray * get_property (mwIndex idx, const char *pname) const
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
457 { return m_rep->get_property (idx, pname); }
23893
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
458
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
459 void set_property (mwIndex idx, const char *pname, const mxArray *pval)
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
460 { m_rep->set_property (idx, pname, pval); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
461
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
462 void set_class_name (const char *name_arg)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
463 { DO_VOID_MUTABLE_METHOD (set_class_name (name_arg)); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
464
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23442
diff changeset
465 mxArray * get_cell (mwIndex idx) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
466 { DO_MUTABLE_METHOD (mxArray *, get_cell (idx)); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
467
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
468 void set_cell (mwIndex idx, mxArray *val)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
469 { DO_VOID_MUTABLE_METHOD (set_cell (idx, val)); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
470
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
471 double get_scalar () const { return m_rep->get_scalar (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
472
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
473 void * get_data () const { DO_MUTABLE_METHOD (void *, get_data ()); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
474
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
475 mxDouble * get_doubles () const
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
476 { DO_MUTABLE_METHOD (mxDouble *, get_doubles ()); }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
477
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
478 mxSingle * get_singles () const
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
479 { DO_MUTABLE_METHOD (mxSingle *, get_singles ()); }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
480
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
481 mxInt8 * get_int8s () const
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
482 { DO_MUTABLE_METHOD (mxInt8 *, get_int8s ()); }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
483
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
484 mxInt16 * get_int16s () const
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
485 { DO_MUTABLE_METHOD (mxInt16 *, get_int16s ()); }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
486
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
487 mxInt32 * get_int32s () const
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
488 { DO_MUTABLE_METHOD (mxInt32 *, get_int32s ()); }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
489
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
490 mxInt64 * get_int64s () const
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
491 { DO_MUTABLE_METHOD (mxInt64 *, get_int64s ()); }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
492
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
493 mxUint8 * get_uint8s () const
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
494 { DO_MUTABLE_METHOD (mxUint8 *, get_uint8s ()); }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
495
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
496 mxUint16 * get_uint16s () const
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
497 { DO_MUTABLE_METHOD (mxUint16 *, get_uint16s ()); }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
498
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
499 mxUint32 * get_uint32s () const
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
500 { DO_MUTABLE_METHOD (mxUint32 *, get_uint32s ()); }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
501
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
502 mxUint64 * get_uint64s () const
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
503 { DO_MUTABLE_METHOD (mxUint64 *, get_uint64s ()); }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
504
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
505 mxComplexDouble * get_complex_doubles () const
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
506 { DO_MUTABLE_METHOD (mxComplexDouble *, get_complex_doubles ()); }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
507
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
508 mxComplexSingle * get_complex_singles () const
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
509 { DO_MUTABLE_METHOD (mxComplexSingle *, get_complex_singles ()); }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
510
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
511 void * get_imag_data () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
512 { DO_MUTABLE_METHOD (void *, get_imag_data ()); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
513
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
514 void set_data (void *pr) { DO_VOID_MUTABLE_METHOD (set_data (pr)); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
515
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
516 int set_doubles (mxDouble *data)
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
517 { DO_MUTABLE_METHOD (int, set_doubles (data)); }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
518
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
519 int set_singles (mxSingle *data)
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
520 { DO_MUTABLE_METHOD (int, set_singles (data)); }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
521
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
522 int set_int8s (mxInt8 *data)
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
523 { DO_MUTABLE_METHOD (int, set_int8s (data)); }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
524
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
525 int set_int16s (mxInt16 *data)
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
526 { DO_MUTABLE_METHOD (int, set_int16s (data)); }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
527
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
528 int set_int32s (mxInt32 *data)
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
529 { DO_MUTABLE_METHOD (int, set_int32s (data)); }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
530
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
531 int set_int64s (mxInt64 *data)
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
532 { DO_MUTABLE_METHOD (int, set_int64s (data)); }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
533
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
534 int set_uint8s (mxUint8 *data)
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
535 { DO_MUTABLE_METHOD (int, set_uint8s (data)); }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
536
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
537 int set_uint16s (mxUint16 *data)
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
538 { DO_MUTABLE_METHOD (int, set_uint16s (data)); }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
539
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
540 int set_uint32s (mxUint32 *data)
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
541 { DO_MUTABLE_METHOD (int, set_uint32s (data)); }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
542
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
543 int set_uint64s (mxUint64 *data)
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
544 { DO_MUTABLE_METHOD (int, set_uint64s (data)); }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
545
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
546 int set_complex_doubles (mxComplexDouble *data)
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
547 { DO_MUTABLE_METHOD (int, set_complex_doubles (data)); }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
548
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
549 int set_complex_singles (mxComplexSingle *data)
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
550 { DO_MUTABLE_METHOD (int, set_complex_singles (data)); }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
551
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
552 void set_imag_data (void *pi) { DO_VOID_MUTABLE_METHOD (set_imag_data (pi)); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
553
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
554 mwIndex * get_ir () const { DO_MUTABLE_METHOD (mwIndex *, get_ir ()); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
555
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
556 mwIndex * get_jc () const { DO_MUTABLE_METHOD (mwIndex *, get_jc ()); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
557
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
558 mwSize get_nzmax () const { return m_rep->get_nzmax (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
559
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
560 void set_ir (mwIndex *ir) { DO_VOID_MUTABLE_METHOD (set_ir (ir)); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
561
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
562 void set_jc (mwIndex *jc) { DO_VOID_MUTABLE_METHOD (set_jc (jc)); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
563
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
564 void set_nzmax (mwSize nzmax) { DO_VOID_MUTABLE_METHOD (set_nzmax (nzmax)); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
565
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
566 int add_field (const char *key) { DO_MUTABLE_METHOD (int, add_field (key)); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
567
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
568 void remove_field (int key_num)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
569 { DO_VOID_MUTABLE_METHOD (remove_field (key_num)); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
570
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23442
diff changeset
571 mxArray * get_field_by_number (mwIndex index, int key_num) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
572 { DO_MUTABLE_METHOD (mxArray *, get_field_by_number (index, key_num)); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
573
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
574 void set_field_by_number (mwIndex index, int key_num, mxArray *val)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
575 { DO_VOID_MUTABLE_METHOD (set_field_by_number (index, key_num, val)); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
576
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
577 int get_number_of_fields () const
30346
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30223
diff changeset
578 { return m_rep->get_number_of_fields (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
579
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23442
diff changeset
580 const char * get_field_name_by_number (int key_num) const
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30565
diff changeset
581 { DO_MUTABLE_METHOD (const char *, get_field_name_by_number (key_num)); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
582
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
583 int get_field_number (const char *key) const
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
584 { DO_MUTABLE_METHOD (int, get_field_number (key)); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
585
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
586 int get_string (char *buf, mwSize buflen) const
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
587 { return m_rep->get_string (buf, buflen); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
588
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
589 char * array_to_string () const { return m_rep->array_to_string (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
590
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
591 mwIndex calc_single_subscript (mwSize nsubs, mwIndex *subs) const
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
592 { return m_rep->calc_single_subscript (nsubs, subs); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
593
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
594 std::size_t get_element_size () const
30346
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30223
diff changeset
595 { return m_rep->get_element_size (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
596
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
597 bool mutation_needed () const { return m_rep->mutation_needed (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
598
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
599 mxArray * mutate () const { return m_rep->mutate (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
600
29572
aef11bb4e6d1 use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
601 static OCTINTERP_API void * malloc (std::size_t n);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
602
29572
aef11bb4e6d1 use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
603 static OCTINTERP_API void * calloc (std::size_t n, std::size_t t);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
604
30223
b8841fcd28c8 combine calls to mxArray::malloc and mxArray::calloc in wrapper function
John W. Eaton <jwe@octave.org>
parents: 30122
diff changeset
605 static OCTINTERP_API void * alloc (bool init, std::size_t n, std::size_t t);
b8841fcd28c8 combine calls to mxArray::malloc and mxArray::calloc in wrapper function
John W. Eaton <jwe@octave.org>
parents: 30122
diff changeset
606
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23442
diff changeset
607 static char * strsave (const char *str)
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
608 {
23457
21baad6b35c4 maint: Use C++11 nullptr rather than 0 or NULL when possible.
Rik <rik@octave.org>
parents: 23446
diff changeset
609 char *retval = nullptr;
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
610
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
611 if (str)
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
612 {
21568
3d60ed163b70 maint: Eliminate bad spacing around '='.
Rik <rik@octave.org>
parents: 21244
diff changeset
613 mwSize sz = sizeof (mxChar) * (strlen (str) + 1);
26405
b352120504bc ensure valid pointer is passed to strcpy (bug #55347)
John W. Eaton <jwe@octave.org>
parents: 26401
diff changeset
614
10317
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 9906
diff changeset
615 retval = static_cast<char *> (mxArray::malloc (sz));
26405
b352120504bc ensure valid pointer is passed to strcpy (bug #55347)
John W. Eaton <jwe@octave.org>
parents: 26401
diff changeset
616
b352120504bc ensure valid pointer is passed to strcpy (bug #55347)
John W. Eaton <jwe@octave.org>
parents: 26401
diff changeset
617 if (retval)
b352120504bc ensure valid pointer is passed to strcpy (bug #55347)
John W. Eaton <jwe@octave.org>
parents: 26401
diff changeset
618 strcpy (retval, str);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
619 }
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
620
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
621 return retval;
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
622 }
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
623
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
624 static OCTINTERP_API octave_value
25451
f84755f24ccd allow NULL mxArray* to be returned as undefined from fcn calls (bug #54096)
John W. Eaton <jwe@octave.org>
parents: 25054
diff changeset
625 as_octave_value (const mxArray *ptr, bool null_is_empty = true);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
626
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
627 OCTINTERP_API octave_value as_octave_value () const;
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
628
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
629 private:
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
630
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
631 mxArray (mxArray_base *r, const char *n)
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
632 : m_rep (r), m_name (mxArray::strsave (n)) { }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
633
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
634 static OCTINTERP_API mxArray_base *
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
635 create_rep (bool interleaved, const octave_value& ov);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
636
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
637 static OCTINTERP_API mxArray_base *
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
638 create_rep (bool interleaved, mxClassID id, mwSize ndims,
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
639 const mwSize *dims, mxComplexity flag, bool init);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
640
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
641 static OCTINTERP_API mxArray_base *
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
642 create_rep (bool interleaved, mxClassID id, const dim_vector& dv,
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
643 mxComplexity flag);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
644
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
645 static OCTINTERP_API mxArray_base *
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
646 create_rep (bool interleaved, mxClassID id, mwSize m, mwSize n,
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
647 mxComplexity flag, bool init);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
648
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
649 static OCTINTERP_API mxArray_base *
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
650 create_rep (bool interleaved, mxClassID id, double val);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
651
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
652 static OCTINTERP_API mxArray_base *
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
653 create_rep (bool interleaved, mxClassID id, mxLogical val);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
654
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
655 static OCTINTERP_API mxArray_base *
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
656 create_rep (bool interleaved, const char *str);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
657
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
658 static OCTINTERP_API mxArray_base *
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
659 create_rep (bool interleaved, mwSize m, const char **str);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
660
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
661 static OCTINTERP_API mxArray_base *
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
662 create_rep (bool interleaved, mxClassID id, mwSize m, mwSize n,
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
663 mwSize nzmax, mxComplexity flag);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
664
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
665 OCTINTERP_API void maybe_mutate () const;
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
666
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
667 //--------
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
668
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
669 mutable mxArray_base *m_rep;
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
670
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
671 char *m_name;
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
672
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
673 };
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
674
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
675 #undef DO_MUTABLE_METHOD
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
676 #undef DO_VOID_MUTABLE_METHOD
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
677
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
678 #endif
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
679 #endif