GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
cdef-object.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2012-2023 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if ! defined (octave_cdef_object_h)
27 #define octave_cdef_object_h 1
28 
29 #include "octave-config.h"
30 
31 #include <map>
32 #include <string>
33 
34 #include "oct-refcount.h"
35 
36 #include "cdef-fwd.h"
37 #include "error.h"
38 #include "oct-map.h"
39 #include "ov.h"
40 #include "ovl.h"
41 
43 
44 // This is mainly a bootstrap class to declare the expected interface.
45 // The actual base class is cdef_class_base, which is declared after
46 // cdef_object, such that it can contain cdef_object objects.
47 
48 class
49 OCTINTERP_API
51 {
52 public:
53 
54  friend class cdef_object;
55 
56  cdef_object_rep (void) : m_count (1) { }
57 
59 
60  virtual ~cdef_object_rep (void) = default;
61 
62  virtual cdef_class get_class (void) const;
63 
64  virtual void set_class (const cdef_class&)
65  {
66  err_invalid_object ("set_class");
67  }
68 
69  virtual cdef_object_rep * clone (void) const
70  {
71  err_invalid_object ("clone");
72  }
73 
74  virtual cdef_object_rep * empty_clone (void) const
75  {
76  err_invalid_object ("empty_clone");
77  }
78 
79  virtual cdef_object_rep * copy (void) const
80  {
81  err_invalid_object ("copy");
82  }
83 
84  virtual cdef_object_rep * make_array (void) const
85  {
86  err_invalid_object ("make_array");
87  }
88 
89  virtual bool is_array (void) const { return false; }
90 
91  virtual bool is_value_object (void) const { return false; }
92 
93  virtual bool is_handle_object (void) const { return false; }
94 
95  virtual bool is_meta_object (void) const { return false; }
96 
97  virtual Array<cdef_object> array_value (void) const
98  {
99  err_invalid_object ("array_value");
100  }
101 
102  virtual void put (const std::string&, const octave_value&)
103  { err_invalid_object ("put"); }
104 
105  virtual octave_value get (const std::string&) const
106  {
107  err_invalid_object ("get");
108  }
109 
110  virtual void set_property (octave_idx_type, const std::string&,
111  const octave_value&)
112  {
113  err_invalid_object ("set_property");
114  }
115 
116  virtual octave_value get_property (octave_idx_type, const std::string&) const
117  {
118  err_invalid_object ("get_property");
119  }
120 
121  virtual void break_closure_cycles (const std::shared_ptr<stack_frame>&)
122  {
123  err_invalid_object ("break_closure_cycles");
124  }
125 
126  virtual octave_value_list
127  subsref (const std::string&, const std::list<octave_value_list>&,
128  int, std::size_t&, const cdef_class&, bool)
129  {
130  err_invalid_object ("subsref");
131  }
132 
133  virtual octave_value
134  subsasgn (const std::string&, const std::list<octave_value_list>&,
135  const octave_value&)
136  {
137  err_invalid_object ("subsasgn");
138  }
139 
140  virtual string_vector map_keys (void) const;
141 
142  virtual bool is_valid (void) const { return false; }
143 
144  OCTINTERP_API std::string class_name (void) const;
145 
146  virtual void mark_for_construction (const cdef_class&)
147  {
148  err_invalid_object ("mark_for_construction");
149  }
150 
151  virtual bool is_constructed_for (const cdef_class&) const
152  {
153  err_invalid_object ("is_constructed_for");
154  }
155 
156  virtual bool is_partially_constructed_for (const cdef_class&) const
157  {
158  err_invalid_object ("is_partially_constructed_for");
159  }
160 
161  virtual void mark_as_constructed (void)
162  {
163  err_invalid_object ("mark_as_constructed");
164  }
165 
166  virtual void mark_as_constructed (const cdef_class&)
167  {
168  err_invalid_object ("mark_as_constructed");
169  }
170 
171  virtual bool is_constructed (void) const
172  {
173  err_invalid_object ("is_constructed");
174  }
175 
176  virtual octave_idx_type static_count (void) const { return 0; }
177 
178  virtual void destroy (void) { delete this; }
179 
180  OCTINTERP_API void release (const cdef_object& obj);
181 
182  virtual dim_vector dims (void) const { return dim_vector (); }
183 
184 protected:
185 
186  // Reference count
188 
189  // Restricted copying.
190 
191  cdef_object_rep (const cdef_object_rep&) : m_count (1) { }
192 
193 private:
194 
195  OCTAVE_NORETURN void err_invalid_object (const char *who) const
196  {
197  error ("%s: invalid object", who);
198  }
199 };
200 
201 class
202 OCTINTERP_API
204 {
205 public:
206 
207  // FIXME: use a null object?
208  cdef_object (void) : m_rep (new cdef_object_rep ()) { }
209 
210  cdef_object (const cdef_object& obj) : m_rep (obj.m_rep)
211  { m_rep->m_count++; }
212 
214 
215  virtual ~cdef_object (void) { m_rep->release (*this); }
216 
218  {
219  if (m_rep != obj.m_rep)
220  {
221  m_rep->release (*this);
222 
223  m_rep = obj.m_rep;
224  m_rep->m_count++;
225  }
226 
227  return *this;
228  }
229 
230  OCTINTERP_API cdef_class get_class (void) const;
231 
232  void set_class (const cdef_class& cls) { m_rep->set_class (cls); }
233 
234  std::string class_name (void) const { return m_rep->class_name (); }
235 
236  cdef_object clone (void) const { return cdef_object (m_rep->clone ()); }
237 
239  {
240  return cdef_object (m_rep->empty_clone ());
241  }
242 
243  dim_vector dims (void) const { return m_rep->dims (); }
244 
245  cdef_object make_array (void) const
246  {
247  return cdef_object (m_rep->make_array ());
248  }
249 
250  cdef_object copy (void) const { return cdef_object (m_rep->copy ()); }
251 
252  bool is_array (void) const { return m_rep->is_array (); }
253 
254  bool is_value_object (void) const { return m_rep->is_value_object (); }
255 
256  bool is_handle_object (void) const { return m_rep->is_handle_object (); }
257 
258  bool is_meta_object (void) const { return m_rep->is_meta_object (); }
259 
261  { return m_rep->array_value (); }
262 
263  void put (const std::string& pname, const octave_value& val)
264  {
265  m_rep->put (pname, val);
266  }
267 
268  octave_value get (const std::string& pname) const
269  {
270  return m_rep->get (pname);
271  }
272 
273  void set_property (octave_idx_type idx, const std::string& pname,
274  const octave_value& pval)
275  {
276  return m_rep->set_property (idx, pname, pval);
277  }
278 
280  get_property (octave_idx_type idx, const std::string& pname) const
281  {
282  return m_rep->get_property (idx, pname);
283  }
284 
285  void break_closure_cycles (const std::shared_ptr<stack_frame>& frame)
286  {
287  m_rep->break_closure_cycles (frame);
288  }
289 
291  subsref (const std::string& type, const std::list<octave_value_list>& idx,
292  int nargout, std::size_t& skip, const cdef_class& context,
293  bool auto_add = false)
294  {
295  return m_rep->subsref (type, idx, nargout, skip, context, auto_add);
296  }
297 
299  subsasgn (const std::string& type, const std::list<octave_value_list>& idx,
300  const octave_value& rhs, int ignore_copies = 0)
301  {
302  make_unique (ignore_copies);
303  return m_rep->subsasgn (type, idx, rhs);
304  }
305 
306  string_vector map_keys (void) const { return m_rep->map_keys (); }
307 
308  OCTINTERP_API octave_map map_value (void) const;
309 
310  const cdef_object_rep * get_rep (void) const { return m_rep; }
311 
312  bool ok (void) const { return m_rep->is_valid (); }
313 
315  {
317  }
318 
319  bool is_constructed (void) const { return m_rep->is_constructed (); }
320 
321  bool is_constructed_for (const cdef_class& cls) const
322  {
323  return m_rep->is_constructed_for (cls);
324  }
325 
326  bool is_partially_constructed_for (const cdef_class& cls) const
327  {
328  return m_rep->is_partially_constructed_for (cls);
329  }
330 
332 
333  void mark_as_constructed (const cdef_class& cls)
334  { m_rep->mark_as_constructed (cls); }
335 
336  bool is (const cdef_object& obj) const { return m_rep == obj.m_rep; }
337 
338 protected:
339 
340  cdef_object_rep * get_rep (void) { return m_rep; }
341 
342  void make_unique (int ignore_copies)
343  {
344  if (m_rep->m_count > ignore_copies + 1)
345  *this = clone ();
346  }
347 
348 private:
349 
351 };
352 
353 class
354 OCTINTERP_API
356 {
357 public:
358 
360  : cdef_object_rep (), m_klass ()
361  { }
362 
364 
365  ~cdef_object_base (void) { }
366 
367  OCTINTERP_API cdef_class get_class (void) const;
368 
369  OCTINTERP_API void set_class (const cdef_class& cls);
370 
372  {
373  return new cdef_object_base (*this);
374  }
375 
376  OCTINTERP_API cdef_object_rep * make_array (void) const;
377 
378 protected:
379 
380  // Restricted copying!
382  : cdef_object_rep (obj), m_klass (obj.m_klass)
383  { }
384 
385 private:
386 
387  // The class of the object
389 };
390 
391 class
392 OCTINTERP_API
394 {
395 public:
396 
398 
400  : cdef_object_base (), m_array (a)
401  { }
402 
404 
405  ~cdef_object_array (void) = default;
406 
407  cdef_object_rep * clone (void) const
408  {
409  return new cdef_object_array (*this);
410  }
411 
412  dim_vector dims (void) const { return m_array.dims (); }
413 
414  bool is_valid (void) const { return true; }
415 
416  bool is_array (void) const { return true; }
417 
418  Array<cdef_object> array_value (void) const { return m_array; }
419 
420  OCTINTERP_API octave_value_list
421  subsref (const std::string& type, const std::list<octave_value_list>& idx,
422  int nargout, std::size_t& skip, const cdef_class& context,
423  bool auto_add);
424 
425  OCTINTERP_API octave_value
426  subsasgn (const std::string& type, const std::list<octave_value_list>& idx,
427  const octave_value& rhs);
428 
429  void set_property (octave_idx_type idx, const std::string& pname,
430  const octave_value& pval)
431  {
432  cdef_object& tmp = m_array.elem (idx);
433 
434  return tmp.put (pname, pval);
435  }
436 
438  get_property (octave_idx_type idx, const std::string& pname) const
439  {
440  cdef_object tmp = m_array.elem (idx);
441 
442  return tmp.get (pname);
443  }
444 
445 private:
446 
448 
449  void fill_empty_values (void) { fill_empty_values (m_array); }
450 
451  OCTINTERP_API void fill_empty_values (Array<cdef_object>& arr);
452 
453  // Private copying!
455  : cdef_object_base (obj), m_array (obj.m_array)
456  { }
457 };
458 
459 class
460 OCTINTERP_API
462 {
463 public:
464 
466 
468 
469  ~cdef_object_scalar (void) = default;
470 
471  dim_vector dims (void) const { return dim_vector (1, 1); }
472 
473  void break_closure_cycles (const std::shared_ptr<stack_frame>& frame);
474 
475  void put (const std::string& pname, const octave_value& val)
476  {
477  m_map.assign (pname, val);
478  }
479 
480  octave_value get (const std::string& pname) const
481  {
482  Cell val = m_map.contents (pname);
483 
484  if (val.numel () < 1)
485  error ("get: unknown slot: %s", pname.c_str ());
486 
487  return val(0, 0);
488  }
489 
490  void set_property (octave_idx_type idx, const std::string& pname,
491  const octave_value& pval)
492  {
493  if (idx != 0)
494  error ("invalid index"); // FIXME
495 
496  put (pname, pval);
497  }
498 
500  get_property (octave_idx_type idx, const std::string& pname) const
501  {
502  if (idx != 0)
503  error ("invalid index"); // FIXME
504 
505  return get (pname);
506  }
507 
508  OCTINTERP_API octave_value_list
509  subsref (const std::string& type, const std::list<octave_value_list>& idx,
510  int nargout, std::size_t& skip, const cdef_class& context,
511  bool auto_add);
512 
513  OCTINTERP_API octave_value
514  subsasgn (const std::string& type, const std::list<octave_value_list>& idx,
515  const octave_value& rhs);
516 
517  OCTINTERP_API void mark_for_construction (const cdef_class&);
518 
519  OCTINTERP_API bool is_constructed_for (const cdef_class& cls) const;
520 
521  OCTINTERP_API bool
522  is_partially_constructed_for (const cdef_class& cls) const;
523 
524  void mark_as_constructed (void) { m_ctor_list.clear (); }
525 
526  OCTINTERP_API void mark_as_constructed (const cdef_class& cls);
527 
528  bool is_constructed (void) const { return m_ctor_list.empty (); }
529 
530 protected:
531 
532  // Object property values
534 
535  // Internal/temporary structure used during object construction
536  std::map< cdef_class, std::list<cdef_class>> m_ctor_list;
537 
538 protected:
539 
540  // Restricted object copying!
542  : cdef_object_base (obj), m_map (obj.m_map), m_ctor_list (obj.m_ctor_list)
543  { }
544 };
545 
546 class
547 OCTINTERP_API
549 {
550 public:
551 
553 
555 
556  OCTINTERP_API ~handle_cdef_object (void);
557 
558  cdef_object_rep * clone (void) const
559  {
560  handle_cdef_object *obj = const_cast<handle_cdef_object *> (this);
561  obj->m_count++;
562  return obj;
563  }
564 
565  cdef_object_rep * copy (void) const
566  {
567  return new handle_cdef_object (*this);
568  }
569 
570  bool is_valid (void) const { return true; }
571 
572  bool is_handle_object (void) const { return true; }
573 
574 protected:
575 
576  // Restricted copying!
578  : cdef_object_scalar (obj)
579  { }
580 };
581 
582 class
583 OCTINTERP_API
585 {
586 public:
587 
589 
591 
592  OCTINTERP_API ~value_cdef_object (void);
593 
594  cdef_object_rep * clone (void) const
595  {
596  return new value_cdef_object (*this);
597  }
598 
599  cdef_object_rep * copy (void) const { return clone (); }
600 
601  bool is_valid (void) const { return true; }
602 
603  bool is_value_object (void) const { return true; }
604 
605 private:
606 
607  // Private copying!
609  : cdef_object_scalar (obj)
610  { }
611 };
612 
613 class
614 OCTINTERP_API
616 {
617 public:
618 
620 
622 
623  ~cdef_meta_object_rep (void) = default;
624 
625  cdef_object_rep * copy (void) const
626  { return new cdef_meta_object_rep (*this); }
627 
628  bool is_meta_object (void) const { return true; }
629 
630  virtual bool is_class (void) const { return false; }
631 
632  virtual bool is_property (void) const { return false; }
633 
634  virtual bool is_method (void) const { return false; }
635 
636  virtual bool is_package (void) const { return false; }
637 
638  virtual octave_value_list
639  meta_subsref (const std::string& /* type */,
640  const std::list<octave_value_list>& /* idx */,
641  int /* nargout */)
642  {
643  error ("subsref: invalid meta object");
644  }
645 
646  virtual void meta_release (void) { }
647 
648  virtual bool meta_accepts_postfix_index (char /* type */) const
649  {
650  return false;
651  }
652 
653 protected:
654 
655  // Restricted copying!
657  : handle_cdef_object (obj)
658  { }
659 };
660 
661 class
662 OCTINTERP_API
664 {
665 public:
666 
668 
669  // Object consistency is checked in sub-classes.
671 
673 
674  cdef_meta_object (const cdef_object& obj) : cdef_object (obj) { }
675 
677 
678  ~cdef_meta_object (void) = default;
679 
680  bool is_class (void) const { return get_rep ()->is_class (); }
681 
682  bool is_property (void) const { return get_rep ()->is_property (); }
683 
684  bool is_method (void) const { return get_rep ()->is_method (); }
685 
686  bool is_package (void) const { return get_rep ()->is_package (); }
687 
689  meta_subsref (const std::string& type,
690  const std::list<octave_value_list>& idx, int nargout)
691  {
692  return get_rep ()->meta_subsref (type, idx, nargout);
693  }
694 
695  void meta_release (void) { get_rep ()->meta_release (); }
696 
697  bool meta_accepts_postfix_index (char type) const
698  {
699  return get_rep ()->meta_accepts_postfix_index (type);
700  }
701 
702 private:
703 
705  {
706  return dynamic_cast<cdef_meta_object_rep *> (cdef_object::get_rep ());
707  }
708 
709  const cdef_meta_object_rep * get_rep (void) const
710  {
711  return dynamic_cast<const cdef_meta_object_rep *> (cdef_object::get_rep ());
712  }
713 };
714 
716 
717 #endif
OCTAVE_END_NAMESPACE(octave)
class OCTINTERP_API cdef_object
Definition: cdef-fwd.h:34
OCTARRAY_OVERRIDABLE_FUNC_API octave_idx_type numel(void) const
Number of elements in the array.
Definition: Array.h:414
Definition: Cell.h:43
cdef_meta_object_rep(const cdef_meta_object_rep &obj)
Definition: cdef-object.h:656
virtual void meta_release(void)
Definition: cdef-object.h:646
virtual bool is_class(void) const
Definition: cdef-object.h:630
virtual bool meta_accepts_postfix_index(char) const
Definition: cdef-object.h:648
virtual bool is_property(void) const
Definition: cdef-object.h:632
virtual bool is_method(void) const
Definition: cdef-object.h:634
cdef_object_rep * copy(void) const
Definition: cdef-object.h:625
bool is_meta_object(void) const
Definition: cdef-object.h:628
virtual octave_value_list meta_subsref(const std::string &, const std::list< octave_value_list > &, int)
Definition: cdef-object.h:639
virtual bool is_package(void) const
Definition: cdef-object.h:636
~cdef_meta_object_rep(void)=default
cdef_meta_object(void)
Definition: cdef-object.h:667
bool meta_accepts_postfix_index(char type) const
Definition: cdef-object.h:697
const cdef_meta_object_rep * get_rep(void) const
Definition: cdef-object.h:709
cdef_meta_object(const cdef_object &obj)
Definition: cdef-object.h:674
void meta_release(void)
Definition: cdef-object.h:695
cdef_meta_object(cdef_meta_object_rep *r)
Definition: cdef-object.h:672
cdef_meta_object(const cdef_meta_object &obj)
Definition: cdef-object.h:670
bool is_class(void) const
Definition: cdef-object.h:680
~cdef_meta_object(void)=default
bool is_method(void) const
Definition: cdef-object.h:684
cdef_meta_object_rep * get_rep(void)
Definition: cdef-object.h:704
bool is_property(void) const
Definition: cdef-object.h:682
bool is_package(void) const
Definition: cdef-object.h:686
octave_value_list meta_subsref(const std::string &type, const std::list< octave_value_list > &idx, int nargout)
Definition: cdef-object.h:689
bool is_array(void) const
Definition: cdef-object.h:416
void fill_empty_values(void)
Definition: cdef-object.h:449
Array< cdef_object > m_array
Definition: cdef-object.h:447
void set_property(octave_idx_type idx, const std::string &pname, const octave_value &pval)
Definition: cdef-object.h:429
cdef_object_array(const cdef_object_array &obj)
Definition: cdef-object.h:454
cdef_object_rep * clone(void) const
Definition: cdef-object.h:407
~cdef_object_array(void)=default
Array< cdef_object > array_value(void) const
Definition: cdef-object.h:418
octave_value get_property(octave_idx_type idx, const std::string &pname) const
Definition: cdef-object.h:438
bool is_valid(void) const
Definition: cdef-object.h:414
dim_vector dims(void) const
Definition: cdef-object.h:412
cdef_object_array(const Array< cdef_object > &a)
Definition: cdef-object.h:399
~cdef_object_base(void)
Definition: cdef-object.h:365
cdef_object_base(void)
Definition: cdef-object.h:359
cdef_object m_klass
Definition: cdef-object.h:388
cdef_object_rep * empty_clone(void) const
Definition: cdef-object.h:371
cdef_object_base(const cdef_object_base &obj)
Definition: cdef-object.h:381
virtual bool is_valid(void) const
Definition: cdef-object.h:142
OCTINTERP_API void release(const cdef_object &obj)
Definition: cdef-object.cc:44
virtual void break_closure_cycles(const std::shared_ptr< stack_frame > &)
Definition: cdef-object.h:121
virtual octave_value_list subsref(const std::string &, const std::list< octave_value_list > &, int, std::size_t &, const cdef_class &, bool)
Definition: cdef-object.h:127
virtual bool is_array(void) const
Definition: cdef-object.h:89
virtual void mark_as_constructed(const cdef_class &)
Definition: cdef-object.h:166
virtual void destroy(void)
Definition: cdef-object.h:178
virtual bool is_constructed_for(const cdef_class &) const
Definition: cdef-object.h:151
virtual void set_class(const cdef_class &)
Definition: cdef-object.h:64
virtual octave_idx_type static_count(void) const
Definition: cdef-object.h:176
virtual void set_property(octave_idx_type, const std::string &, const octave_value &)
Definition: cdef-object.h:110
virtual bool is_constructed(void) const
Definition: cdef-object.h:171
virtual octave_value get(const std::string &) const
Definition: cdef-object.h:105
virtual cdef_object_rep * empty_clone(void) const
Definition: cdef-object.h:74
virtual string_vector map_keys(void) const
Definition: cdef-object.cc:126
virtual Array< cdef_object > array_value(void) const
Definition: cdef-object.h:97
virtual cdef_object_rep * clone(void) const
Definition: cdef-object.h:69
OCTINTERP_API std::string class_name(void) const
Definition: cdef-object.cc:120
virtual octave_value get_property(octave_idx_type, const std::string &) const
Definition: cdef-object.h:116
virtual bool is_partially_constructed_for(const cdef_class &) const
Definition: cdef-object.h:156
virtual dim_vector dims(void) const
Definition: cdef-object.h:182
cdef_object_rep(const cdef_object_rep &)
Definition: cdef-object.h:191
cdef_object_rep(void)
Definition: cdef-object.h:56
virtual cdef_object_rep * copy(void) const
Definition: cdef-object.h:79
virtual bool is_handle_object(void) const
Definition: cdef-object.h:93
virtual void put(const std::string &, const octave_value &)
Definition: cdef-object.h:102
virtual cdef_object_rep * make_array(void) const
Definition: cdef-object.h:84
OCTAVE_NORETURN void err_invalid_object(const char *who) const
Definition: cdef-object.h:195
virtual bool is_value_object(void) const
Definition: cdef-object.h:91
virtual bool is_meta_object(void) const
Definition: cdef-object.h:95
virtual ~cdef_object_rep(void)=default
virtual void mark_for_construction(const cdef_class &)
Definition: cdef-object.h:146
virtual octave_value subsasgn(const std::string &, const std::list< octave_value_list > &, const octave_value &)
Definition: cdef-object.h:134
refcount< octave_idx_type > m_count
Definition: cdef-object.h:187
virtual void mark_as_constructed(void)
Definition: cdef-object.h:161
dim_vector dims(void) const
Definition: cdef-object.h:471
octave_scalar_map m_map
Definition: cdef-object.h:533
std::map< cdef_class, std::list< cdef_class > > m_ctor_list
Definition: cdef-object.h:536
void mark_as_constructed(void)
Definition: cdef-object.h:524
bool is_constructed(void) const
Definition: cdef-object.h:528
octave_value get_property(octave_idx_type idx, const std::string &pname) const
Definition: cdef-object.h:500
void put(const std::string &pname, const octave_value &val)
Definition: cdef-object.h:475
octave_value get(const std::string &pname) const
Definition: cdef-object.h:480
void set_property(octave_idx_type idx, const std::string &pname, const octave_value &pval)
Definition: cdef-object.h:490
cdef_object_scalar(const cdef_object_scalar &obj)
Definition: cdef-object.h:541
~cdef_object_scalar(void)=default
void break_closure_cycles(const std::shared_ptr< stack_frame > &frame)
Definition: cdef-object.h:285
void mark_as_constructed(const cdef_class &cls)
Definition: cdef-object.h:333
void mark_for_construction(const cdef_class &cls)
Definition: cdef-object.h:314
void mark_as_constructed(void)
Definition: cdef-object.h:331
OCTINTERP_API octave_map map_value(void) const
Definition: cdef-object.cc:137
bool is_meta_object(void) const
Definition: cdef-object.h:258
cdef_object & operator=(const cdef_object &obj)
Definition: cdef-object.h:217
bool is_partially_constructed_for(const cdef_class &cls) const
Definition: cdef-object.h:326
cdef_object_rep * get_rep(void)
Definition: cdef-object.h:340
bool ok(void) const
Definition: cdef-object.h:312
bool is_array(void) const
Definition: cdef-object.h:252
virtual ~cdef_object(void)
Definition: cdef-object.h:215
cdef_object empty_clone(void) const
Definition: cdef-object.h:238
void put(const std::string &pname, const octave_value &val)
Definition: cdef-object.h:263
void set_property(octave_idx_type idx, const std::string &pname, const octave_value &pval)
Definition: cdef-object.h:273
dim_vector dims(void) const
Definition: cdef-object.h:243
bool is_handle_object(void) const
Definition: cdef-object.h:256
cdef_object(const cdef_object &obj)
Definition: cdef-object.h:210
void set_class(const cdef_class &cls)
Definition: cdef-object.h:232
string_vector map_keys(void) const
Definition: cdef-object.h:306
const cdef_object_rep * get_rep(void) const
Definition: cdef-object.h:310
cdef_object copy(void) const
Definition: cdef-object.h:250
cdef_object make_array(void) const
Definition: cdef-object.h:245
cdef_object(void)
Definition: cdef-object.h:208
std::string class_name(void) const
Definition: cdef-object.h:234
octave_value subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs, int ignore_copies=0)
Definition: cdef-object.h:299
OCTINTERP_API cdef_class get_class(void) const
Definition: cdef-object.cc:183
cdef_object(cdef_object_rep *r)
Definition: cdef-object.h:213
cdef_object_rep * m_rep
Definition: cdef-object.h:350
bool is(const cdef_object &obj) const
Definition: cdef-object.h:336
void make_unique(int ignore_copies)
Definition: cdef-object.h:342
octave_value get(const std::string &pname) const
Definition: cdef-object.h:268
octave_value_list subsref(const std::string &type, const std::list< octave_value_list > &idx, int nargout, std::size_t &skip, const cdef_class &context, bool auto_add=false)
Definition: cdef-object.h:291
bool is_constructed_for(const cdef_class &cls) const
Definition: cdef-object.h:321
octave_value get_property(octave_idx_type idx, const std::string &pname) const
Definition: cdef-object.h:280
bool is_constructed(void) const
Definition: cdef-object.h:319
Array< cdef_object > array_value(void) const
Definition: cdef-object.h:260
cdef_object clone(void) const
Definition: cdef-object.h:236
bool is_value_object(void) const
Definition: cdef-object.h:254
Vector representing the dimensions (size) of an Array.
Definition: dim-vector.h:94
cdef_object_rep * copy(void) const
Definition: cdef-object.h:565
handle_cdef_object(const handle_cdef_object &obj)
Definition: cdef-object.h:577
cdef_object_rep * clone(void) const
Definition: cdef-object.h:558
bool is_valid(void) const
Definition: cdef-object.h:570
bool is_handle_object(void) const
Definition: cdef-object.h:572
cdef_object_rep * copy(void) const
Definition: cdef-object.h:599
value_cdef_object(const value_cdef_object &obj)
Definition: cdef-object.h:608
cdef_object_rep * clone(void) const
Definition: cdef-object.h:594
bool is_valid(void) const
Definition: cdef-object.h:601
bool is_value_object(void) const
Definition: cdef-object.h:603
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
std::string release(void)
Definition: defaults.cc:143
void error(const char *fmt,...)
Definition: error.cc:979
T * r
Definition: mx-inlines.cc:773