annotate libinterp/corefcn/mxarray.h @ 31837:febd82d1a8de

use new macros to consistently delete copy and move member functions Use new OCTAVE_DISABLE_COPY_MOVE macro to consistently disable copy and move constructors and assignment operators. Consistently declare deleted functions in public class sections. Affected files: dw-main-window.h, gui-preferences.h, gui-settings.h, qt-application.h, qt-interpreter-events.h, variable-editor-model.cc, variable-editor-model.h, variable-editor.h, base-text-renderer.h, c-file-ptr-stream.h, dynamic-ld.h, error.h, event-manager.h, event-queue.h, fcn-info.h, ft-text-renderer.cc, gl-render.cc, gl-render.h, graphics.cc, graphics.in.h, gzfstream.h, interpreter.cc, interpreter.h, load-path.h, load-save.h, mex.cc, mxarray.h, oct-fstrm.h, oct-hist.h, oct-iostrm.h, oct-prcstrm.h, oct-procbuf.h, oct-stdstrm.h, oct-stream.cc, oct-stream.h, oct-strstrm.h, pager.h, settings.h, stack-frame.cc, symscope.h, symtab.h, text-renderer.h, url-handle-manager.h, __init_fltk__.cc, gzip.cc, cdef-class.cc, cdef-manager.h, ov-builtin.h, ov-class.cc, ov-classdef.h, ov-dld-fcn.h, ov-fcn.h, ov-mex-fcn.h, ov-typeinfo.h, ov-usr-fcn.h, octave.h, anon-fcn-validator.h, lex.h, oct-parse.yy, parse.h, profiler.h, pt-anon-scopes.h, pt-arg-list.h, pt-args-block.h, pt-array-list.h, pt-assign.h, pt-binop.h, pt-bp.h, pt-cbinop.h, pt-cell.h, pt-check.h, pt-classdef.h, pt-cmd.h, pt-colon.h, pt-const.h, pt-decl.h, pt-eval.h, pt-except.h, pt-exp.h, pt-fcn-handle.h, pt-id.h, pt-idx.h, pt-jump.h, pt-loop.h, pt-mat.h, pt-misc.h, pt-pr-code.h, pt-select.h, pt-spmd.h, pt-stmt.h, pt-tm-const.h, pt-unop.h, pt-walk.h, pt.h, token.h, Array-base.cc, idx-vector.h, oct-fftw.h, sparse-chol.cc, sparse-qr.cc, oct-env.h, action-container.h, cmd-edit.cc, cmd-edit.h, cmd-hist.h, oct-mutex.h, oct-refcount.h, oct-shlib.cc, oct-sort.h, oct-string.h, singleton-cleanup.h, unwind-prot.h, url-transfer.cc, and url-transfer.h.
author John W. Eaton <jwe@octave.org>
date Thu, 16 Feb 2023 14:43:18 -0500
parents c8dd3da44e83
children 1daf8bfceac3
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 //
31706
597f3ee61a48 update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 31607
diff changeset
3 // Copyright (C) 2001-2023 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
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
97 virtual mxArray_base * dup () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
98
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
99 virtual mxArray * as_mxArray () const { return nullptr; }
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
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 () = default;
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 bool is_octave_value () const { return false; }
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 int iscell () const = 0;
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 int is_char () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
108
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
109 virtual int is_class (const char *name_arg) const
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
110 {
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
111 int retval = 0;
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 const char *cname = get_class_name ();
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 if (cname && name_arg)
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
116 retval = ! strcmp (cname, name_arg);
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
117
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
118 return retval;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
119 }
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
120
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
121 virtual int is_complex () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
122
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
123 virtual int is_double () const = 0;
15351
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_function_handle () 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_int16 () 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_int32 () 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_int64 () 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_int8 () 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_logical () 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_numeric () 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_single () 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_sparse () 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_struct () 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_uint16 () 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_uint32 () 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_uint64 () 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_uint8 () 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_logical_scalar () const
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
154 {
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
155 return is_logical () && get_number_of_elements () == 1;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
156 }
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
157
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
158 virtual int is_logical_scalar_true () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
159
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
160 virtual mwSize get_m () const = 0;
15351
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 mwSize get_n () 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_dimensions () 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_number_of_dimensions () const = 0;
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
167
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
168 virtual void set_m (mwSize m) = 0;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
169
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
170 virtual void set_n (mwSize n) = 0;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
171
22471
667d353d1ab8 Clean up MEX API prototypes to match Matlab.
Rik <rik@octave.org>
parents: 22464
diff changeset
172 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
173
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
174 virtual mwSize get_number_of_elements () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
175
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
176 virtual int isempty () const = 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 bool is_scalar () const = 0;
22462
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22453
diff changeset
179
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
180 virtual mxClassID get_class_id () 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 const char * get_class_name () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
183
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
184 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
185
27956
2310164737b3 fix many spelling errors (bug #57613)
John W. Eaton <jwe@octave.org>
parents: 26405
diff changeset
186 // 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
187 // 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
188 // 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
189 // 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
190
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
191 virtual mxArray *
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
192 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
193 {
bd9e719f04cc new mxGetProperty function for MEX API
Piotr Held <pjheld@gmail.com>
parents: 23795
diff changeset
194 return nullptr;
bd9e719f04cc new mxGetProperty function for MEX API
Piotr Held <pjheld@gmail.com>
parents: 23795
diff changeset
195 }
bd9e719f04cc new mxGetProperty function for MEX API
Piotr Held <pjheld@gmail.com>
parents: 23795
diff changeset
196
23893
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
197 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
198 const mxArray * /*pval*/)
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
199 {
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
200 err_invalid_type ("set_property");
23893
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
201 }
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
202
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23442
diff changeset
203 virtual mxArray * get_cell (mwIndex /*idx*/) const
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
204 {
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
205 err_invalid_type ("get_cell");
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
206 }
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
207
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
208 virtual void set_cell (mwIndex idx, mxArray *val) = 0;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
209
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
210 virtual double get_scalar () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
211
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
212 virtual void * get_data () const = 0;
15351
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 mxDouble * get_doubles () const = 0;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
215 virtual mxSingle * get_singles () const = 0;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
216 virtual mxInt8 * get_int8s () const = 0;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
217 virtual mxInt16 * get_int16s () const = 0;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
218 virtual mxInt32 * get_int32s () const = 0;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
219 virtual mxInt64 * get_int64s () const = 0;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
220 virtual mxUint8 * get_uint8s () const = 0;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
221 virtual mxUint16 * get_uint16s () const = 0;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
222 virtual mxUint32 * get_uint32s () const = 0;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
223 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
224
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
225 virtual mxComplexDouble * get_complex_doubles () const = 0;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
226 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
227
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
228 virtual void * get_imag_data () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
229
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
230 virtual void set_data (void *pr) = 0;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
231
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
232 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
233 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
234 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
235 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
236 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
237 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
238 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
239 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
240 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
241 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
242
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_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
244 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
245
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
246 virtual void set_imag_data (void *pi) = 0;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
247
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
248 virtual mwIndex * get_ir () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
249
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
250 virtual mwIndex * get_jc () const = 0;
15351
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 mwSize get_nzmax () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
253
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
254 virtual void set_ir (mwIndex *ir) = 0;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
255
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
256 virtual void set_jc (mwIndex *jc) = 0;
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_nzmax (mwSize nzmax) = 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 int add_field (const char *key) = 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 remove_field (int key_num) = 0;
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
263
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23442
diff changeset
264 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
265
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
266 virtual void
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
267 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
268
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
269 virtual int get_number_of_fields () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
270
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23442
diff changeset
271 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
272
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
273 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
274
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
275 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
276
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
277 virtual char * array_to_string () const = 0;
15351
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 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
280
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
281 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
282
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
283 virtual bool mutation_needed () const { return false; }
15351
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 mxArray * mutate () const { return nullptr; }
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 octave_value as_octave_value () const = 0;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
288
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
289 protected:
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
290
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
291 mxArray_base (const mxArray_base&) = default;
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
292
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
293 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
294 {
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
295 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
296 ? 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
297 : size);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
298 }
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
299
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
300 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
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 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
303 }
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
304
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
305 //--------
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 // 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
308 bool m_interleaved;
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
309
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
310 };
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
311
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
312 // 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
313 // 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
314 // the semantics of mxArray objects in Matlab more directly.
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
315
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
316 class mxArray
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 public:
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
319
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
320 OCTINTERP_API mxArray (bool interleaved, const octave_value& ov);
6686
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, 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
323 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
324 bool init = true);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
325
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
326 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
327 mxComplexity flag = mxREAL);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
328
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
329 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
330 mxComplexity flag = mxREAL, bool init = true);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
331
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
332 OCTINTERP_API mxArray (bool interleaved, mxClassID id, double val);
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, mxLogical 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, const char *str);
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, mwSize m, 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, 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
341 mwSize nzmax, mxComplexity flag = mxREAL);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
342
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
343 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
344 int num_keys, const char **keys);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
345
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
346 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
347 const char **keys);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
348
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
349 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
350 const char **keys);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
351
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
352 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
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, 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
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, mwSize m, mwSize n);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
357
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
358 mxArray * dup () const
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
359 {
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
360 mxArray *retval = m_rep->as_mxArray ();
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
361
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
362 if (retval)
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
363 retval->set_name (m_name);
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
364 else
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
365 {
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
366 mxArray_base *new_rep = m_rep->dup ();
15351
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 retval = new mxArray (new_rep, m_name);
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
369 }
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
370
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
371 return retval;
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
372 }
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
373
31837
febd82d1a8de use new macros to consistently delete copy and move member functions
John W. Eaton <jwe@octave.org>
parents: 31827
diff changeset
374 OCTAVE_DISABLE_COPY_MOVE (mxArray)
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
375
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
376 OCTINTERP_API ~mxArray ();
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
377
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
378 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
379
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
380 int iscell () const { return m_rep->iscell (); }
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 is_char () const { return m_rep->is_char (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
383
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
384 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
385
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
386 int is_complex () const { return m_rep->is_complex (); }
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_double () const { return m_rep->is_double (); }
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_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
391
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
392 int is_int16 () const { return m_rep->is_int16 (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
393
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
394 int is_int32 () const { return m_rep->is_int32 (); }
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_int64 () const { return m_rep->is_int64 (); }
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_int8 () const { return m_rep->is_int8 (); }
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_logical () const { return m_rep->is_logical (); }
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_numeric () const { return m_rep->is_numeric (); }
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_single () const { return m_rep->is_single (); }
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_sparse () const { return m_rep->is_sparse (); }
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_struct () const { return m_rep->is_struct (); }
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_uint16 () const { return m_rep->is_uint16 (); }
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_uint32 () const { return m_rep->is_uint32 (); }
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_uint64 () const { return m_rep->is_uint64 (); }
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_uint8 () const { return m_rep->is_uint8 (); }
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_logical_scalar () const { return m_rep->is_logical_scalar (); }
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_true () const
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
421 { return m_rep->is_logical_scalar_true (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
422
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
423 mwSize get_m () const { return m_rep->get_m (); }
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_n () const { return m_rep->get_n (); }
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_dimensions () const { return m_rep->get_dimensions (); }
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_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
430 { return m_rep->get_number_of_dimensions (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
431
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
432 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
433
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
434 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
435
22471
667d353d1ab8 Clean up MEX API prototypes to match Matlab.
Rik <rik@octave.org>
parents: 22464
diff changeset
436 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
437 { 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
438
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
439 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
440 { return m_rep->get_number_of_elements (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
441
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
442 int isempty () const { return get_number_of_elements () == 0; }
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 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
445
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
446 const char * get_name () const { return m_name; }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
447
30122
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
448 OCTINTERP_API void set_name (const char *name);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
449
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
450 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
451
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
452 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
453
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
454 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
455 { 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
456
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
457 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
458 { m_rep->set_property (idx, pname, pval); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
459
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
460 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
461 { DO_VOID_MUTABLE_METHOD (set_class_name (name_arg)); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
462
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23442
diff changeset
463 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
464 { DO_MUTABLE_METHOD (mxArray *, get_cell (idx)); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
465
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
466 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
467 { DO_VOID_MUTABLE_METHOD (set_cell (idx, val)); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
468
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
469 double get_scalar () const { return m_rep->get_scalar (); }
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 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
472
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
473 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
474 { 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
475
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
476 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
477 { 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
478
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
479 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
480 { 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
481
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
482 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
483 { 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
484
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
485 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
486 { 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
487
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
488 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
489 { 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
490
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
491 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
492 { 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
493
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
494 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
495 { 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
496
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
497 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
498 { 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
499
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
500 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
501 { 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
502
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
503 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
504 { 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
505
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
506 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
507 { 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
508
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
509 void * get_imag_data () const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
510 { DO_MUTABLE_METHOD (void *, get_imag_data ()); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
511
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
512 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
513
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
514 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
515 { 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
516
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
517 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
518 { 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
519
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
520 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
521 { 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
522
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
523 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
524 { 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
525
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
526 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
527 { 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
528
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
529 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
530 { 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
531
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
532 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
533 { 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
534
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
535 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
536 { 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
537
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
538 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
539 { 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
540
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
541 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
542 { 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
543
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
544 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
545 { 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
546
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 28123
diff changeset
547 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
548 { 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
549
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
550 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
551
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
552 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
553
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
554 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
555
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
556 mwSize get_nzmax () const { return m_rep->get_nzmax (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
557
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
558 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
559
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
560 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
561
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
562 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
563
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
564 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
565
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
566 void remove_field (int key_num)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
567 { DO_VOID_MUTABLE_METHOD (remove_field (key_num)); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
568
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23442
diff changeset
569 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
570 { 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
571
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
572 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
573 { 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
574
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
575 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
576 { return m_rep->get_number_of_fields (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
577
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23442
diff changeset
578 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
579 { 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
580
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
581 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
582 { DO_MUTABLE_METHOD (int, get_field_number (key)); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
583
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
584 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
585 { return m_rep->get_string (buf, buflen); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
586
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
587 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
588
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
589 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
590 { return m_rep->calc_single_subscript (nsubs, subs); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
591
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
592 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
593 { return m_rep->get_element_size (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
594
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
595 bool mutation_needed () const { return m_rep->mutation_needed (); }
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 mxArray * mutate () const { return m_rep->mutate (); }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
598
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
599 static OCTINTERP_API void * malloc (std::size_t n);
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 * calloc (std::size_t n, std::size_t t);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
602
30223
b8841fcd28c8 combine calls to mxArray::malloc and mxArray::calloc in wrapper function
John W. Eaton <jwe@octave.org>
parents: 30122
diff changeset
603 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
604
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23442
diff changeset
605 static char * strsave (const char *str)
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
606 {
23457
21baad6b35c4 maint: Use C++11 nullptr rather than 0 or NULL when possible.
Rik <rik@octave.org>
parents: 23446
diff changeset
607 char *retval = nullptr;
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
608
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
609 if (str)
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
610 {
21568
3d60ed163b70 maint: Eliminate bad spacing around '='.
Rik <rik@octave.org>
parents: 21244
diff changeset
611 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
612
10317
42d098307c30 untabify additional source files
John W. Eaton <jwe@octave.org>
parents: 9906
diff changeset
613 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
614
b352120504bc ensure valid pointer is passed to strcpy (bug #55347)
John W. Eaton <jwe@octave.org>
parents: 26401
diff changeset
615 if (retval)
b352120504bc ensure valid pointer is passed to strcpy (bug #55347)
John W. Eaton <jwe@octave.org>
parents: 26401
diff changeset
616 strcpy (retval, str);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
617 }
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
618
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
619 return retval;
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
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
622 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
623 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
624
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
625 OCTINTERP_API octave_value as_octave_value () const;
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
626
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
627 private:
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
628
15351
a291f850743c modernize mxArray class hierarchy
John W. Eaton <jwe@octave.org>
parents: 15240
diff changeset
629 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
630 : m_rep (r), m_name (mxArray::strsave (n)) { }
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
631
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
632 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
633 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
634
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
635 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
636 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
637 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
638
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
639 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
640 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
641 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
642
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
643 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
644 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
645 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
646
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
647 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
648 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
649
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
650 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
651 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
652
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
653 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
654 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
655
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
656 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
657 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
658
29233
665c9ed14c97 Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28126
diff changeset
659 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
660 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
661 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
662
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
663 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
664
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
665 //--------
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 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
668
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
669 char *m_name;
8418f99cfcd0 maint: use "m_" prefix for member variables in class mxArray_base.
Rik <rik@octave.org>
parents: 29655
diff changeset
670
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
671 };
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
672
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
673 #undef DO_MUTABLE_METHOD
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
674 #undef DO_VOID_MUTABLE_METHOD
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
675
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
676 #endif
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents:
diff changeset
677 #endif