annotate libinterp/octave-value/cdef-object.h @ 31605:e88a07dec498 stable

maint: Use macros to begin/end C++ namespaces. * oct-conf-post-public.in.h: Define two macros (OCTAVE_BEGIN_NAMESPACE, OCTAVE_END_NAMESPACE) that can be used to start/end a namespace. * mk-opts.pl, build-env.h, build-env.in.cc, __betainc__.cc, __contourc__.cc, __dsearchn__.cc, __eigs__.cc, __expint__.cc, __ftp__.cc, __gammainc__.cc, __ichol__.cc, __ilu__.cc, __isprimelarge__.cc, __lin_interpn__.cc, __magick_read__.cc, __pchip_deriv__.cc, __qp__.cc, amd.cc, auto-shlib.cc, auto-shlib.h, balance.cc, base-text-renderer.cc, base-text-renderer.h, besselj.cc, bitfcns.cc, bsxfun.cc, c-file-ptr-stream.cc, c-file-ptr-stream.h, call-stack.cc, call-stack.h, ccolamd.cc, cellfun.cc, chol.cc, colamd.cc, colloc.cc, conv2.cc, daspk.cc, dasrt.cc, dassl.cc, data.cc, data.h, debug.cc, defaults.cc, defaults.h, defun-int.h, defun.cc, det.cc, dirfns.cc, display.cc, display.h, dlmread.cc, dmperm.cc, dot.cc, dynamic-ld.cc, dynamic-ld.h, eig.cc, ellipj.cc, environment.cc, environment.h, error.cc, error.h, errwarn.h, event-manager.cc, event-manager.h, event-queue.cc, event-queue.h, fcn-info.cc, fcn-info.h, fft.cc, fft2.cc, fftn.cc, file-io.cc, filter.cc, find.cc, ft-text-renderer.cc, ft-text-renderer.h, gcd.cc, getgrent.cc, getpwent.cc, getrusage.cc, givens.cc, gl-render.cc, gl-render.h, gl2ps-print.cc, gl2ps-print.h, graphics-toolkit.cc, graphics-toolkit.h, graphics.cc, graphics.in.h, gsvd.cc, gtk-manager.cc, gtk-manager.h, hash.cc, help.cc, help.h, hess.cc, hex2num.cc, hook-fcn.cc, hook-fcn.h, input.cc, input.h, interpreter-private.cc, interpreter-private.h, interpreter.cc, interpreter.h, inv.cc, jsondecode.cc, jsonencode.cc, kron.cc, latex-text-renderer.cc, latex-text-renderer.h, load-path.cc, load-path.h, load-save.cc, load-save.h, lookup.cc, ls-ascii-helper.cc, ls-ascii-helper.h, ls-oct-text.cc, ls-utils.cc, ls-utils.h, lsode.cc, lu.cc, mappers.cc, matrix_type.cc, max.cc, mex-private.h, mex.cc, mgorth.cc, nproc.cc, oct-fstrm.cc, oct-fstrm.h, oct-hdf5-types.cc, oct-hdf5-types.h, oct-hist.cc, oct-hist.h, oct-iostrm.cc, oct-iostrm.h, oct-opengl.h, oct-prcstrm.cc, oct-prcstrm.h, oct-procbuf.cc, oct-procbuf.h, oct-process.cc, oct-process.h, oct-stdstrm.h, oct-stream.cc, oct-stream.h, oct-strstrm.cc, oct-strstrm.h, oct-tex-lexer.in.ll, oct-tex-parser.yy, ordqz.cc, ordschur.cc, pager.cc, pager.h, pinv.cc, pow2.cc, pr-flt-fmt.cc, pr-output.cc, procstream.cc, procstream.h, psi.cc, qr.cc, quad.cc, quadcc.cc, qz.cc, rand.cc, rcond.cc, regexp.cc, schur.cc, settings.cc, settings.h, sighandlers.cc, sighandlers.h, sparse-xdiv.cc, sparse-xdiv.h, sparse-xpow.cc, sparse-xpow.h, sparse.cc, spparms.cc, sqrtm.cc, stack-frame.cc, stack-frame.h, stream-euler.cc, strfind.cc, strfns.cc, sub2ind.cc, svd.cc, sylvester.cc, symbfact.cc, syminfo.cc, syminfo.h, symrcm.cc, symrec.cc, symrec.h, symscope.cc, symscope.h, symtab.cc, symtab.h, syscalls.cc, sysdep.cc, sysdep.h, text-engine.cc, text-engine.h, text-renderer.cc, text-renderer.h, time.cc, toplev.cc, tril.cc, tsearch.cc, typecast.cc, url-handle-manager.cc, url-handle-manager.h, urlwrite.cc, utils.cc, utils.h, variables.cc, variables.h, xdiv.cc, xdiv.h, xnorm.cc, xnorm.h, xpow.cc, xpow.h, __delaunayn__.cc, __fltk_uigetfile__.cc, __glpk__.cc, __init_fltk__.cc, __init_gnuplot__.cc, __ode15__.cc, __voronoi__.cc, audiodevinfo.cc, audioread.cc, convhulln.cc, fftw.cc, gzip.cc, mk-build-env-features.sh, mk-builtins.pl, cdef-class.cc, cdef-class.h, cdef-fwd.h, cdef-manager.cc, cdef-manager.h, cdef-method.cc, cdef-method.h, cdef-object.cc, cdef-object.h, cdef-package.cc, cdef-package.h, cdef-property.cc, cdef-property.h, cdef-utils.cc, cdef-utils.h, ov-base.cc, ov-base.h, ov-bool-mat.cc, ov-builtin.h, ov-cell.cc, ov-class.cc, ov-class.h, ov-classdef.cc, ov-classdef.h, ov-complex.cc, ov-fcn-handle.cc, ov-fcn-handle.h, ov-fcn.h, ov-java.cc, ov-java.h, ov-mex-fcn.h, ov-null-mat.cc, ov-oncleanup.cc, ov-struct.cc, ov-typeinfo.cc, ov-typeinfo.h, ov-usr-fcn.cc, ov-usr-fcn.h, ov.cc, ov.h, octave.cc, octave.h, mk-ops.sh, op-b-b.cc, op-b-bm.cc, op-b-sbm.cc, op-bm-b.cc, op-bm-bm.cc, op-bm-sbm.cc, op-cdm-cdm.cc, op-cell.cc, op-chm.cc, op-class.cc, op-cm-cm.cc, op-cm-cs.cc, op-cm-m.cc, op-cm-s.cc, op-cm-scm.cc, op-cm-sm.cc, op-cs-cm.cc, op-cs-cs.cc, op-cs-m.cc, op-cs-s.cc, op-cs-scm.cc, op-cs-sm.cc, op-dm-dm.cc, op-dm-scm.cc, op-dm-sm.cc, op-dm-template.cc, op-dms-template.cc, op-fcdm-fcdm.cc, op-fcm-fcm.cc, op-fcm-fcs.cc, op-fcm-fm.cc, op-fcm-fs.cc, op-fcn.cc, op-fcs-fcm.cc, op-fcs-fcs.cc, op-fcs-fm.cc, op-fcs-fs.cc, op-fdm-fdm.cc, op-fm-fcm.cc, op-fm-fcs.cc, op-fm-fm.cc, op-fm-fs.cc, op-fs-fcm.cc, op-fs-fcs.cc, op-fs-fm.cc, op-fs-fs.cc, op-i16-i16.cc, op-i32-i32.cc, op-i64-i64.cc, op-i8-i8.cc, op-int-concat.cc, op-m-cm.cc, op-m-cs.cc, op-m-m.cc, op-m-s.cc, op-m-scm.cc, op-m-sm.cc, op-mi.cc, op-pm-pm.cc, op-pm-scm.cc, op-pm-sm.cc, op-pm-template.cc, op-range.cc, op-s-cm.cc, op-s-cs.cc, op-s-m.cc, op-s-s.cc, op-s-scm.cc, op-s-sm.cc, op-sbm-b.cc, op-sbm-bm.cc, op-sbm-sbm.cc, op-scm-cm.cc, op-scm-cs.cc, op-scm-m.cc, op-scm-s.cc, op-scm-scm.cc, op-scm-sm.cc, op-sm-cm.cc, op-sm-cs.cc, op-sm-m.cc, op-sm-s.cc, op-sm-scm.cc, op-sm-sm.cc, op-str-m.cc, op-str-s.cc, op-str-str.cc, op-struct.cc, op-ui16-ui16.cc, op-ui32-ui32.cc, op-ui64-ui64.cc, op-ui8-ui8.cc, ops.h, anon-fcn-validator.cc, anon-fcn-validator.h, bp-table.cc, bp-table.h, comment-list.cc, comment-list.h, filepos.h, lex.h, lex.ll, oct-lvalue.cc, oct-lvalue.h, oct-parse.yy, parse.h, profiler.cc, profiler.h, pt-anon-scopes.cc, pt-anon-scopes.h, pt-arg-list.cc, pt-arg-list.h, pt-args-block.cc, pt-args-block.h, pt-array-list.cc, pt-array-list.h, pt-assign.cc, pt-assign.h, pt-binop.cc, pt-binop.h, pt-bp.cc, pt-bp.h, pt-cbinop.cc, pt-cbinop.h, pt-cell.cc, pt-cell.h, pt-check.cc, pt-check.h, pt-classdef.cc, pt-classdef.h, pt-cmd.h, pt-colon.cc, pt-colon.h, pt-const.cc, pt-const.h, pt-decl.cc, pt-decl.h, pt-eval.cc, pt-eval.h, pt-except.cc, pt-except.h, pt-exp.cc, pt-exp.h, pt-fcn-handle.cc, pt-fcn-handle.h, pt-id.cc, pt-id.h, pt-idx.cc, pt-idx.h, pt-jump.h, pt-loop.cc, pt-loop.h, pt-mat.cc, pt-mat.h, pt-misc.cc, pt-misc.h, pt-pr-code.cc, pt-pr-code.h, pt-select.cc, pt-select.h, pt-spmd.cc, pt-spmd.h, pt-stmt.cc, pt-stmt.h, pt-tm-const.cc, pt-tm-const.h, pt-unop.cc, pt-unop.h, pt-vm-eval.cc, pt-walk.cc, pt-walk.h, pt.cc, pt.h, token.cc, token.h, Range.cc, Range.h, idx-vector.cc, idx-vector.h, range-fwd.h, CollocWt.cc, CollocWt.h, aepbalance.cc, aepbalance.h, chol.cc, chol.h, gepbalance.cc, gepbalance.h, gsvd.cc, gsvd.h, hess.cc, hess.h, lo-mappers.cc, lo-mappers.h, lo-specfun.cc, lo-specfun.h, lu.cc, lu.h, oct-convn.cc, oct-convn.h, oct-fftw.cc, oct-fftw.h, oct-norm.cc, oct-norm.h, oct-rand.cc, oct-rand.h, oct-spparms.cc, oct-spparms.h, qr.cc, qr.h, qrp.cc, qrp.h, randgamma.cc, randgamma.h, randmtzig.cc, randmtzig.h, randpoisson.cc, randpoisson.h, schur.cc, schur.h, sparse-chol.cc, sparse-chol.h, sparse-lu.cc, sparse-lu.h, sparse-qr.cc, sparse-qr.h, svd.cc, svd.h, child-list.cc, child-list.h, dir-ops.cc, dir-ops.h, file-ops.cc, file-ops.h, file-stat.cc, file-stat.h, lo-sysdep.cc, lo-sysdep.h, lo-sysinfo.cc, lo-sysinfo.h, mach-info.cc, mach-info.h, oct-env.cc, oct-env.h, oct-group.cc, oct-group.h, oct-password.cc, oct-password.h, oct-syscalls.cc, oct-syscalls.h, oct-time.cc, oct-time.h, oct-uname.cc, oct-uname.h, action-container.cc, action-container.h, base-list.h, cmd-edit.cc, cmd-edit.h, cmd-hist.cc, cmd-hist.h, f77-fcn.h, file-info.cc, file-info.h, lo-array-errwarn.cc, lo-array-errwarn.h, lo-hash.cc, lo-hash.h, lo-ieee.h, lo-regexp.cc, lo-regexp.h, lo-utils.cc, lo-utils.h, oct-base64.cc, oct-base64.h, oct-glob.cc, oct-glob.h, oct-inttypes.h, oct-mutex.cc, oct-mutex.h, oct-refcount.h, oct-shlib.cc, oct-shlib.h, oct-sparse.cc, oct-sparse.h, oct-string.h, octave-preserve-stream-state.h, pathsearch.cc, pathsearch.h, quit.cc, quit.h, unwind-prot.cc, unwind-prot.h, url-transfer.cc, url-transfer.h : Use new macros to begin/end C++ namespaces.
author Rik <rik@octave.org>
date Thu, 01 Dec 2022 14:23:45 -0800
parents 83f9f8bda883
children aac27ad79be6
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 //
30564
796f54d4ddbf update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 30503
diff changeset
3 // Copyright (C) 2012-2022 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 ////////////////////////////////////////////////////////////////////////
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26 #if ! defined (octave_cdef_object_h)
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27 #define octave_cdef_object_h 1
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29 #include "octave-config.h"
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
30
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31 #include <map>
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32 #include <string>
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 #include "oct-refcount.h"
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35
30503
838e73617671 cdef classes: Forward declare with visibility flags (bug #59820).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30075
diff changeset
36 #include "cdef-fwd.h"
27130
396d17dcfb9f don't include error.h in ov-base.h
John W. Eaton <jwe@octave.org>
parents: 26774
diff changeset
37 #include "error.h"
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
38 #include "oct-map.h"
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
39 #include "ov.h"
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
40 #include "ovl.h"
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
41
31605
e88a07dec498 maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents: 30565
diff changeset
42 OCTAVE_BEGIN_NAMESPACE(octave)
e88a07dec498 maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents: 30565
diff changeset
43
27971
ec769a7ab9fb fix more spelling errors (bug #57613)
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
44 // This is mainly a bootstrap class to declare the expected interface.
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
45 // The actual base class is cdef_class_base, which is declared after
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
46 // cdef_object, such that it can contain cdef_object objects.
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
47
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
48 class
29234
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27971
diff changeset
49 OCTINTERP_API
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
50 cdef_object_rep
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51 {
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
52 public:
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
53
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
54 friend class cdef_object;
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
55
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
56 cdef_object_rep (void) : m_count (1) { }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
57
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
58 cdef_object_rep& operator = (const cdef_object_rep&) = delete;
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
59
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
60 virtual ~cdef_object_rep (void) = default;
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
61
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
62 virtual cdef_class get_class (void) const;
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
63
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
64 virtual void set_class (const cdef_class&)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
65 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
66 err_invalid_object ("set_class");
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
67 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
68
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
69 virtual cdef_object_rep * clone (void) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
70 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
71 err_invalid_object ("clone");
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
72 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
73
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
74 virtual cdef_object_rep * empty_clone (void) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
75 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
76 err_invalid_object ("empty_clone");
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
77 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
78
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
79 virtual cdef_object_rep * copy (void) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
80 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
81 err_invalid_object ("copy");
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
82 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
83
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
84 virtual cdef_object_rep * make_array (void) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
85 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
86 err_invalid_object ("make_array");
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
87 }
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
88
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
89 virtual bool is_array (void) const { return false; }
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
90
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
91 virtual bool is_value_object (void) const { return false; }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
92
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
93 virtual bool is_handle_object (void) const { return false; }
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
94
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
95 virtual bool is_meta_object (void) const { return false; }
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
96
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
97 virtual Array<cdef_object> array_value (void) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
98 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
99 err_invalid_object ("array_value");
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
100 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
101
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
102 virtual void put (const std::string&, const octave_value&)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
103 { err_invalid_object ("put"); }
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
104
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
105 virtual octave_value get (const std::string&) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
106 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
107 err_invalid_object ("get");
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
108 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
109
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
110 virtual void set_property (octave_idx_type, const std::string&,
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
111 const octave_value&)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
112 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
113 err_invalid_object ("set_property");
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
114 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
115
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
116 virtual octave_value get_property (octave_idx_type, const std::string&) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
117 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
118 err_invalid_object ("get_property");
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
119 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
120
29950
6549fa7558ba eliminate some unnecessary octave:: namespace tags
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
121 virtual void break_closure_cycles (const std::shared_ptr<stack_frame>&)
29476
c74ff452e2bb avoid memory leaks when returning handles to nested functions
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
122 {
c74ff452e2bb avoid memory leaks when returning handles to nested functions
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
123 err_invalid_object ("break_closure_cycles");
c74ff452e2bb avoid memory leaks when returning handles to nested functions
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
124 }
c74ff452e2bb avoid memory leaks when returning handles to nested functions
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
125
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
126 virtual octave_value_list
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
127 subsref (const std::string&, const std::list<octave_value_list>&,
29654
d13d090cb03a use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents: 29476
diff changeset
128 int, std::size_t&, const cdef_class&, bool)
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
129 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
130 err_invalid_object ("subsref");
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
131 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
132
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
133 virtual octave_value
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
134 subsasgn (const std::string&, const std::list<octave_value_list>&,
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
135 const octave_value&)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
136 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
137 err_invalid_object ("subsasgn");
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
138 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
139
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
140 virtual string_vector map_keys (void) const;
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
141
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
142 virtual bool is_valid (void) const { return false; }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
143
29234
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27971
diff changeset
144 OCTINTERP_API std::string class_name (void) const;
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
145
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
146 virtual void mark_for_construction (const cdef_class&)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
147 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
148 err_invalid_object ("mark_for_construction");
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
149 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
150
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
151 virtual bool is_constructed_for (const cdef_class&) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
152 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
153 err_invalid_object ("is_constructed_for");
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
154 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
155
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
156 virtual bool is_partially_constructed_for (const cdef_class&) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
157 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
158 err_invalid_object ("is_partially_constructed_for");
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
159 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
160
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
161 virtual void mark_as_constructed (void)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
162 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
163 err_invalid_object ("mark_as_constructed");
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
164 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
165
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
166 virtual void mark_as_constructed (const cdef_class&)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
167 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
168 err_invalid_object ("mark_as_constructed");
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
169 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
170
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
171 virtual bool is_constructed (void) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
172 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
173 err_invalid_object ("is_constructed");
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
174 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
175
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
176 virtual octave_idx_type static_count (void) const { return 0; }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
177
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
178 virtual void destroy (void) { delete this; }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
179
29234
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27971
diff changeset
180 OCTINTERP_API void release (const cdef_object& obj);
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
181
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
182 virtual dim_vector dims (void) const { return dim_vector (); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
183
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
184 protected:
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
185
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
186 // Reference count
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
187 refcount<octave_idx_type> m_count;
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
188
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
189 // Restricted copying.
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
190
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
191 cdef_object_rep (const cdef_object_rep&) : m_count (1) { }
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
192
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
193 private:
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
194
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
195 OCTAVE_NORETURN void err_invalid_object (const char *who) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
196 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
197 error ("%s: invalid object", who);
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
198 }
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
199 };
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
200
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
201 class
30503
838e73617671 cdef classes: Forward declare with visibility flags (bug #59820).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30075
diff changeset
202 OCTINTERP_API
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
203 cdef_object
26771
b55f4781fc6e * cdef-object.h, cdef-object.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 26769
diff changeset
204 {
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
205 public:
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
206
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
207 // FIXME: use a null object?
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
208 cdef_object (void) : m_rep (new cdef_object_rep ()) { }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
209
30346
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30075
diff changeset
210 cdef_object (const cdef_object& obj) : m_rep (obj.m_rep)
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30075
diff changeset
211 { m_rep->m_count++; }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
212
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
213 cdef_object (cdef_object_rep *r) : m_rep (r) { }
26771
b55f4781fc6e * cdef-object.h, cdef-object.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 26769
diff changeset
214
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
215 virtual ~cdef_object (void) { m_rep->release (*this); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
216
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
217 cdef_object& operator = (const cdef_object& obj)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
218 {
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
219 if (m_rep != obj.m_rep)
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
220 {
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
221 m_rep->release (*this);
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
222
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
223 m_rep = obj.m_rep;
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
224 m_rep->m_count++;
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
225 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
226
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
227 return *this;
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
228 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
229
29234
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27971
diff changeset
230 OCTINTERP_API cdef_class get_class (void) const;
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
231
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
232 void set_class (const cdef_class& cls) { m_rep->set_class (cls); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
233
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
234 std::string class_name (void) const { return m_rep->class_name (); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
235
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
236 cdef_object clone (void) const { return cdef_object (m_rep->clone ()); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
237
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
238 cdef_object empty_clone (void) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
239 {
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
240 return cdef_object (m_rep->empty_clone ());
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
241 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
242
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
243 dim_vector dims (void) const { return m_rep->dims (); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
244
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
245 cdef_object make_array (void) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
246 {
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
247 return cdef_object (m_rep->make_array ());
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
248 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
249
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
250 cdef_object copy (void) const { return cdef_object (m_rep->copy ()); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
251
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
252 bool is_array (void) const { return m_rep->is_array (); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
253
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
254 bool is_value_object (void) const { return m_rep->is_value_object (); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
255
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
256 bool is_handle_object (void) const { return m_rep->is_handle_object (); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
257
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
258 bool is_meta_object (void) const { return m_rep->is_meta_object (); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
259
30346
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30075
diff changeset
260 Array<cdef_object> array_value (void) const
91c6288781ba maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents: 30075
diff changeset
261 { return m_rep->array_value (); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
262
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
263 void put (const std::string& pname, const octave_value& val)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
264 {
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
265 m_rep->put (pname, val);
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
266 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
267
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
268 octave_value get (const std::string& pname) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
269 {
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
270 return m_rep->get (pname);
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
271 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
272
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
273 void set_property (octave_idx_type idx, const std::string& pname,
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
274 const octave_value& pval)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
275 {
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
276 return m_rep->set_property (idx, pname, pval);
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
277 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
278
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
279 octave_value
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
280 get_property (octave_idx_type idx, const std::string& pname) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
281 {
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
282 return m_rep->get_property (idx, pname);
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
283 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
284
29950
6549fa7558ba eliminate some unnecessary octave:: namespace tags
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
285 void break_closure_cycles (const std::shared_ptr<stack_frame>& frame)
29476
c74ff452e2bb avoid memory leaks when returning handles to nested functions
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
286 {
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
287 m_rep->break_closure_cycles (frame);
29476
c74ff452e2bb avoid memory leaks when returning handles to nested functions
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
288 }
c74ff452e2bb avoid memory leaks when returning handles to nested functions
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
289
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
290 octave_value_list
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
291 subsref (const std::string& type, const std::list<octave_value_list>& idx,
29654
d13d090cb03a use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents: 29476
diff changeset
292 int nargout, std::size_t& skip, const cdef_class& context,
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
293 bool auto_add = false)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
294 {
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
295 return m_rep->subsref (type, idx, nargout, skip, context, auto_add);
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
296 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
297
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
298 octave_value
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
299 subsasgn (const std::string& type, const std::list<octave_value_list>& idx,
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
300 const octave_value& rhs, int ignore_copies = 0)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
301 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
302 make_unique (ignore_copies);
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
303 return m_rep->subsasgn (type, idx, rhs);
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
304 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
305
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
306 string_vector map_keys (void) const { return m_rep->map_keys (); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
307
29234
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27971
diff changeset
308 OCTINTERP_API octave_map map_value (void) const;
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
309
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
310 const cdef_object_rep * get_rep (void) const { return m_rep; }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
311
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
312 bool ok (void) const { return m_rep->is_valid (); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
313
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
314 void mark_for_construction (const cdef_class& cls)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
315 {
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
316 m_rep->mark_for_construction (cls);
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
317 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
318
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
319 bool is_constructed (void) const { return m_rep->is_constructed (); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
320
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
321 bool is_constructed_for (const cdef_class& cls) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
322 {
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
323 return m_rep->is_constructed_for (cls);
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
324 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
325
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
326 bool is_partially_constructed_for (const cdef_class& cls) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
327 {
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
328 return m_rep->is_partially_constructed_for (cls);
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
329 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
330
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
331 void mark_as_constructed (void) { m_rep->mark_as_constructed (); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
332
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
333 void mark_as_constructed (const cdef_class& cls)
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
334 { m_rep->mark_as_constructed (cls); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
335
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
336 bool is (const cdef_object& obj) const { return m_rep == obj.m_rep; }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
337
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
338 protected:
26771
b55f4781fc6e * cdef-object.h, cdef-object.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 26769
diff changeset
339
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
340 cdef_object_rep * get_rep (void) { return m_rep; }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
341
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
342 void make_unique (int ignore_copies)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
343 {
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
344 if (m_rep->m_count > ignore_copies + 1)
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
345 *this = clone ();
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
346 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
347
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
348 private:
26771
b55f4781fc6e * cdef-object.h, cdef-object.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 26769
diff changeset
349
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
350 cdef_object_rep *m_rep;
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
351 };
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
352
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
353 class
30503
838e73617671 cdef classes: Forward declare with visibility flags (bug #59820).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30075
diff changeset
354 OCTINTERP_API
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
355 cdef_object_base : public cdef_object_rep
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
356 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
357 public:
26771
b55f4781fc6e * cdef-object.h, cdef-object.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 26769
diff changeset
358
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
359 cdef_object_base (void)
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
360 : cdef_object_rep (), m_klass ()
27445
c98953e85220 eliminate unused object_count variable in cdef_class_rep
John W. Eaton <jwe@octave.org>
parents: 27130
diff changeset
361 { }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
362
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
363 cdef_object_base& operator = (const cdef_object_base&) = delete;
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
364
27445
c98953e85220 eliminate unused object_count variable in cdef_class_rep
John W. Eaton <jwe@octave.org>
parents: 27130
diff changeset
365 ~cdef_object_base (void) { }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
366
29234
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27971
diff changeset
367 OCTINTERP_API cdef_class get_class (void) const;
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
368
29234
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27971
diff changeset
369 OCTINTERP_API void set_class (const cdef_class& cls);
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
370
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
371 cdef_object_rep * empty_clone (void) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
372 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
373 return new cdef_object_base (*this);
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
374 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
375
29234
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27971
diff changeset
376 OCTINTERP_API cdef_object_rep * make_array (void) const;
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
377
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
378 protected:
26771
b55f4781fc6e * cdef-object.h, cdef-object.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 26769
diff changeset
379
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
380 // Restricted copying!
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
381 cdef_object_base (const cdef_object_base& obj)
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
382 : cdef_object_rep (obj), m_klass (obj.m_klass)
27445
c98953e85220 eliminate unused object_count variable in cdef_class_rep
John W. Eaton <jwe@octave.org>
parents: 27130
diff changeset
383 { }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
384
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
385 private:
26771
b55f4781fc6e * cdef-object.h, cdef-object.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 26769
diff changeset
386
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
387 // The class of the object
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
388 cdef_object m_klass;
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
389 };
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
390
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
391 class
30503
838e73617671 cdef classes: Forward declare with visibility flags (bug #59820).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30075
diff changeset
392 OCTINTERP_API
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
393 cdef_object_array : public cdef_object_base
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
394 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
395 public:
26771
b55f4781fc6e * cdef-object.h, cdef-object.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 26769
diff changeset
396
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
397 cdef_object_array (void) : cdef_object_base () { }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
398
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
399 cdef_object_array (const Array<cdef_object>& a)
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
400 : cdef_object_base (), m_array (a)
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
401 { }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
402
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
403 cdef_object_array& operator = (const cdef_object_array&) = delete;
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
404
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
405 ~cdef_object_array (void) = default;
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
406
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
407 cdef_object_rep * clone (void) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
408 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
409 return new cdef_object_array (*this);
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
410 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
411
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
412 dim_vector dims (void) const { return m_array.dims (); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
413
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
414 bool is_valid (void) const { return true; }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
415
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
416 bool is_array (void) const { return true; }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
417
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
418 Array<cdef_object> array_value (void) const { return m_array; }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
419
29234
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27971
diff changeset
420 OCTINTERP_API octave_value_list
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
421 subsref (const std::string& type, const std::list<octave_value_list>& idx,
29654
d13d090cb03a use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents: 29476
diff changeset
422 int nargout, std::size_t& skip, const cdef_class& context,
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
423 bool auto_add);
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
424
29234
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27971
diff changeset
425 OCTINTERP_API octave_value
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
426 subsasgn (const std::string& type, const std::list<octave_value_list>& idx,
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
427 const octave_value& rhs);
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
428
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
429 void set_property (octave_idx_type idx, const std::string& pname,
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
430 const octave_value& pval)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
431 {
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
432 cdef_object& tmp = m_array.elem (idx);
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
433
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
434 return tmp.put (pname, pval);
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
435 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
436
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
437 octave_value
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
438 get_property (octave_idx_type idx, const std::string& pname) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
439 {
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
440 cdef_object tmp = m_array.elem (idx);
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
441
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
442 return tmp.get (pname);
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
443 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
444
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
445 private:
26771
b55f4781fc6e * cdef-object.h, cdef-object.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 26769
diff changeset
446
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
447 Array<cdef_object> m_array;
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
448
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
449 void fill_empty_values (void) { fill_empty_values (m_array); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
450
29234
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27971
diff changeset
451 OCTINTERP_API void fill_empty_values (Array<cdef_object>& arr);
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
452
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
453 // Private copying!
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
454 cdef_object_array (const cdef_object_array& obj)
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
455 : cdef_object_base (obj), m_array (obj.m_array)
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
456 { }
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
457 };
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
458
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
459 class
30503
838e73617671 cdef classes: Forward declare with visibility flags (bug #59820).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30075
diff changeset
460 OCTINTERP_API
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
461 cdef_object_scalar : public cdef_object_base
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
462 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
463 public:
26771
b55f4781fc6e * cdef-object.h, cdef-object.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 26769
diff changeset
464
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
465 cdef_object_scalar (void) : cdef_object_base () { }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
466
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
467 cdef_object_scalar& operator = (const cdef_object_scalar&) = delete;
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
468
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
469 ~cdef_object_scalar (void) = default;
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
470
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
471 dim_vector dims (void) const { return dim_vector (1, 1); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
472
29950
6549fa7558ba eliminate some unnecessary octave:: namespace tags
John W. Eaton <jwe@octave.org>
parents: 29655
diff changeset
473 void break_closure_cycles (const std::shared_ptr<stack_frame>& frame);
29476
c74ff452e2bb avoid memory leaks when returning handles to nested functions
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
474
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
475 void put (const std::string& pname, const octave_value& val)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
476 {
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
477 m_map.assign (pname, val);
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
478 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
479
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
480 octave_value get (const std::string& pname) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
481 {
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
482 Cell val = m_map.contents (pname);
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
483
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
484 if (val.numel () < 1)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
485 error ("get: unknown slot: %s", pname.c_str ());
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
486
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
487 return val(0, 0);
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
488 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
489
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
490 void set_property (octave_idx_type idx, const std::string& pname,
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
491 const octave_value& pval)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
492 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
493 if (idx != 0)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
494 error ("invalid index"); // FIXME
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
495
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
496 put (pname, pval);
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
497 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
498
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
499 octave_value
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
500 get_property (octave_idx_type idx, const std::string& pname) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
501 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
502 if (idx != 0)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
503 error ("invalid index"); // FIXME
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
504
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
505 return get (pname);
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
506 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
507
29234
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27971
diff changeset
508 OCTINTERP_API octave_value_list
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
509 subsref (const std::string& type, const std::list<octave_value_list>& idx,
29654
d13d090cb03a use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents: 29476
diff changeset
510 int nargout, std::size_t& skip, const cdef_class& context,
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
511 bool auto_add);
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
512
29234
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27971
diff changeset
513 OCTINTERP_API octave_value
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
514 subsasgn (const std::string& type, const std::list<octave_value_list>& idx,
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
515 const octave_value& rhs);
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
516
29234
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27971
diff changeset
517 OCTINTERP_API void mark_for_construction (const cdef_class&);
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
518
29234
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27971
diff changeset
519 OCTINTERP_API bool is_constructed_for (const cdef_class& cls) const;
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
520
29234
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27971
diff changeset
521 OCTINTERP_API bool
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27971
diff changeset
522 is_partially_constructed_for (const cdef_class& cls) const;
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
523
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
524 void mark_as_constructed (void) { m_ctor_list.clear (); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
525
29234
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27971
diff changeset
526 OCTINTERP_API void mark_as_constructed (const cdef_class& cls);
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
527
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
528 bool is_constructed (void) const { return m_ctor_list.empty (); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
529
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
530 protected:
26771
b55f4781fc6e * cdef-object.h, cdef-object.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 26769
diff changeset
531
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
532 // Object property values
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
533 octave_scalar_map m_map;
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
534
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
535 // Internal/temporary structure used during object construction
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
536 std::map< cdef_class, std::list<cdef_class>> m_ctor_list;
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
537
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
538 protected:
26771
b55f4781fc6e * cdef-object.h, cdef-object.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 26769
diff changeset
539
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
540 // Restricted object copying!
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
541 cdef_object_scalar (const cdef_object_scalar& obj)
30075
0e0cc2760540 maint: use "m_" prefix for member variables in some classdef classes.
John W. Eaton <jwe@octave.org>
parents: 29950
diff changeset
542 : cdef_object_base (obj), m_map (obj.m_map), m_ctor_list (obj.m_ctor_list)
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
543 { }
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
544 };
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
545
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
546 class
30503
838e73617671 cdef classes: Forward declare with visibility flags (bug #59820).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30075
diff changeset
547 OCTINTERP_API
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
548 handle_cdef_object : public cdef_object_scalar
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
549 {
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
550 public:
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
551
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
552 handle_cdef_object (void) : cdef_object_scalar () { }
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
553
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
554 handle_cdef_object& operator = (const handle_cdef_object&) = delete;
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
555
29234
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27971
diff changeset
556 OCTINTERP_API ~handle_cdef_object (void);
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
557
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
558 cdef_object_rep * clone (void) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
559 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
560 handle_cdef_object *obj = const_cast<handle_cdef_object *> (this);
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
561 obj->m_count++;
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
562 return obj;
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
563 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
564
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
565 cdef_object_rep * copy (void) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
566 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
567 return new handle_cdef_object (*this);
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
568 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
569
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
570 bool is_valid (void) const { return true; }
26771
b55f4781fc6e * cdef-object.h, cdef-object.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 26769
diff changeset
571
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
572 bool is_handle_object (void) const { return true; }
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
573
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
574 protected:
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
575
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
576 // Restricted copying!
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
577 handle_cdef_object (const handle_cdef_object& obj)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
578 : cdef_object_scalar (obj)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
579 { }
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
580 };
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
581
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
582 class
30503
838e73617671 cdef classes: Forward declare with visibility flags (bug #59820).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30075
diff changeset
583 OCTINTERP_API
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
584 value_cdef_object : public cdef_object_scalar
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
585 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
586 public:
26771
b55f4781fc6e * cdef-object.h, cdef-object.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 26769
diff changeset
587
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
588 value_cdef_object (void) : cdef_object_scalar () { }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
589
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
590 value_cdef_object& operator = (const value_cdef_object&) = delete;
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
591
29234
853e60367cb6 Set API tags in files in libinterp/octave-value (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents: 27971
diff changeset
592 OCTINTERP_API ~value_cdef_object (void);
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
593
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
594 cdef_object_rep * clone (void) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
595 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
596 return new value_cdef_object (*this);
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
597 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
598
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
599 cdef_object_rep * copy (void) const { return clone (); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
600
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
601 bool is_valid (void) const { return true; }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
602
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
603 bool is_value_object (void) const { return true; }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
604
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
605 private:
26771
b55f4781fc6e * cdef-object.h, cdef-object.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 26769
diff changeset
606
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
607 // Private copying!
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
608 value_cdef_object (const value_cdef_object& obj)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
609 : cdef_object_scalar (obj)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
610 { }
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
611 };
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
612
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
613 class
30503
838e73617671 cdef classes: Forward declare with visibility flags (bug #59820).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30075
diff changeset
614 OCTINTERP_API
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
615 cdef_meta_object_rep : public handle_cdef_object
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
616 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
617 public:
26771
b55f4781fc6e * cdef-object.h, cdef-object.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 26769
diff changeset
618
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
619 cdef_meta_object_rep (void) : handle_cdef_object () { }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
620
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
621 cdef_meta_object_rep& operator = (const cdef_meta_object_rep&) = delete;
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
622
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
623 ~cdef_meta_object_rep (void) = default;
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
624
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
625 cdef_object_rep * copy (void) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
626 { return new cdef_meta_object_rep (*this); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
627
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
628 bool is_meta_object (void) const { return true; }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
629
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
630 virtual bool is_class (void) const { return false; }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
631
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
632 virtual bool is_property (void) const { return false; }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
633
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
634 virtual bool is_method (void) const { return false; }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
635
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
636 virtual bool is_package (void) const { return false; }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
637
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
638 virtual octave_value_list
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
639 meta_subsref (const std::string& /* type */,
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
640 const std::list<octave_value_list>& /* idx */,
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
641 int /* nargout */)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
642 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
643 error ("subsref: invalid meta object");
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
644 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
645
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
646 virtual void meta_release (void) { }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
647
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
648 virtual bool meta_accepts_postfix_index (char /* type */) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
649 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
650 return false;
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
651 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
652
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
653 protected:
26771
b55f4781fc6e * cdef-object.h, cdef-object.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 26769
diff changeset
654
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
655 // Restricted copying!
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
656 cdef_meta_object_rep (const cdef_meta_object_rep& obj)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
657 : handle_cdef_object (obj)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
658 { }
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
659 };
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
660
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
661 class
30503
838e73617671 cdef classes: Forward declare with visibility flags (bug #59820).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30075
diff changeset
662 OCTINTERP_API
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
663 cdef_meta_object : public cdef_object
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
664 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
665 public:
26771
b55f4781fc6e * cdef-object.h, cdef-object.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 26769
diff changeset
666
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
667 cdef_meta_object (void) : cdef_object () { }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
668
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
669 // Object consistency is checked in sub-classes.
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
670 cdef_meta_object (const cdef_meta_object& obj) : cdef_object (obj) { }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
671
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
672 cdef_meta_object (cdef_meta_object_rep *r) : cdef_object (r) { }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
673
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
674 cdef_meta_object (const cdef_object& obj) : cdef_object (obj) { }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
675
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
676 cdef_meta_object& operator = (const cdef_object&) = delete;
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
677
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
678 ~cdef_meta_object (void) = default;
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
679
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
680 bool is_class (void) const { return get_rep ()->is_class (); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
681
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
682 bool is_property (void) const { return get_rep ()->is_property (); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
683
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
684 bool is_method (void) const { return get_rep ()->is_method (); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
685
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
686 bool is_package (void) const { return get_rep ()->is_package (); }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
687
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
688 octave_value_list
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
689 meta_subsref (const std::string& type,
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
690 const std::list<octave_value_list>& idx, int nargout)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
691 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
692 return get_rep ()->meta_subsref (type, idx, nargout);
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
693 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
694
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
695 void meta_release (void) { get_rep ()->meta_release (); }
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
696
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
697 bool meta_accepts_postfix_index (char type) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
698 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
699 return get_rep ()->meta_accepts_postfix_index (type);
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
700 }
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
701
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
702 private:
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
703
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
704 cdef_meta_object_rep * get_rep (void)
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
705 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
706 return dynamic_cast<cdef_meta_object_rep *> (cdef_object::get_rep ());
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
707 }
26771
b55f4781fc6e * cdef-object.h, cdef-object.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 26769
diff changeset
708
26774
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
709 const cdef_meta_object_rep * get_rep (void) const
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
710 {
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
711 return dynamic_cast<const cdef_meta_object_rep *> (cdef_object::get_rep ());
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
712 }
568c2ab2782d move classdef classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 26771
diff changeset
713 };
31605
e88a07dec498 maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents: 30565
diff changeset
714
e88a07dec498 maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents: 30565
diff changeset
715 OCTAVE_END_NAMESPACE(octave)
26769
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
716
2f847e3e8d6b split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
diff changeset
717 #endif