GNU Octave  9.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-2024 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 () : m_count (1) { }
57 
59 
60  virtual ~cdef_object_rep () = default;
61 
62  virtual cdef_class get_class () 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 () const
70  {
71  err_invalid_object ("clone");
72  }
73 
74  virtual cdef_object_rep * empty_clone () const
75  {
76  err_invalid_object ("empty_clone");
77  }
78 
79  virtual cdef_object_rep * copy () const
80  {
81  err_invalid_object ("copy");
82  }
83 
84  virtual cdef_object_rep * make_array () const
85  {
86  err_invalid_object ("make_array");
87  }
88 
89  virtual bool is_array () const { return false; }
90 
91  virtual bool is_value_object () const { return false; }
92 
93  virtual bool is_handle_object () const { return false; }
94 
95  virtual bool is_meta_object () const { return false; }
96 
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 () const;
141 
142  virtual bool is_valid () const { return false; }
143 
144  OCTINTERP_API std::string class_name () 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 ()
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 () const
172  {
173  err_invalid_object ("is_constructed");
174  }
175 
176  virtual octave_idx_type static_count () const { return 0; }
177 
178  virtual void destroy () { delete this; }
179 
180  OCTINTERP_API void release (const cdef_object& obj);
181 
182  virtual dim_vector dims () 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 () : 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 
213  cdef_object (cdef_object_rep *r) : m_rep (r) { }
214 
215  virtual ~cdef_object () { 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 () const;
231 
232  void set_class (const cdef_class& cls) { m_rep->set_class (cls); }
233 
234  std::string class_name () const { return m_rep->class_name (); }
235 
236  cdef_object clone () const { return cdef_object (m_rep->clone ()); }
237 
239  {
240  return cdef_object (m_rep->empty_clone ());
241  }
242 
243  dim_vector dims () const { return m_rep->dims (); }
244 
246  {
247  return cdef_object (m_rep->make_array ());
248  }
249 
250  cdef_object copy () const { return cdef_object (m_rep->copy ()); }
251 
252  bool is_array () const { return m_rep->is_array (); }
253 
254  bool is_value_object () const { return m_rep->is_value_object (); }
255 
256  bool is_handle_object () const { return m_rep->is_handle_object (); }
257 
258  bool is_meta_object () 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 () const { return m_rep->map_keys (); }
307 
308  OCTINTERP_API octave_map map_value () const;
309 
310  const cdef_object_rep * get_rep () const { return m_rep; }
311 
312  bool ok () const { return m_rep->is_valid (); }
313 
315  {
316  m_rep->mark_for_construction (cls);
317  }
318 
319  bool is_constructed () 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 
331  void mark_as_constructed () { m_rep->mark_as_constructed (); }
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 () { 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 
350  cdef_object_rep *m_rep;
351 };
352 
353 class
354 OCTINTERP_API
356 {
357 public:
358 
360  : cdef_object_rep (), m_klass ()
361  { }
362 
364 
366 
367  OCTINTERP_API cdef_class get_class () 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 () 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
388  cdef_object m_klass;
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 () = default;
406 
408  {
409  return new cdef_object_array (*this);
410  }
411 
412  dim_vector dims () const { return m_array.dims (); }
413 
414  bool is_valid () const { return true; }
415 
416  bool is_array () const { return true; }
417 
418  Array<cdef_object> array_value () 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 
447  Array<cdef_object> m_array;
448 
449  void fill_empty_values () { 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 () = default;
470 
471  dim_vector dims () 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 () { m_ctor_list.clear (); }
525 
526  OCTINTERP_API void mark_as_constructed (const cdef_class& cls);
527 
528  bool is_constructed () 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 ();
557 
559  {
560  handle_cdef_object *obj = const_cast<handle_cdef_object *> (this);
561  obj->m_count++;
562  return obj;
563  }
564 
566  {
567  return new handle_cdef_object (*this);
568  }
569 
570  bool is_valid () const { return true; }
571 
572  bool is_handle_object () 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 ();
593 
595  {
596  return new value_cdef_object (*this);
597  }
598 
599  cdef_object_rep * copy () const { return clone (); }
600 
601  bool is_valid () const { return true; }
602 
603  bool is_value_object () 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 () = default;
624 
626  { return new cdef_meta_object_rep (*this); }
627 
628  bool is_meta_object () const { return true; }
629 
630  virtual bool is_class () const { return false; }
631 
632  virtual bool is_property () const { return false; }
633 
634  virtual bool is_method () const { return false; }
635 
636  virtual bool is_package () const { return false; }
637 
638  void doc_string (const std::string& txt) { m_doc_string = txt; }
639 
640  std::string doc_string () const { return m_doc_string; }
641 
642  virtual octave_value_list
643  meta_subsref (const std::string& /* type */,
644  const std::list<octave_value_list>& /* idx */,
645  int /* nargout */)
646  {
647  error ("subsref: invalid meta object");
648  }
649 
650  virtual void meta_release () { }
651 
652  virtual bool meta_accepts_postfix_index (char /* type */) const
653  {
654  return false;
655  }
656 
657 protected:
658 
659  std::string m_doc_string;
660 
661  // Restricted copying!
663  : handle_cdef_object (obj)
664  { }
665 };
666 
667 class
668 OCTINTERP_API
670 {
671 public:
672 
674 
675  // Object consistency is checked in sub-classes.
677 
679 
680  cdef_meta_object (const cdef_object& obj) : cdef_object (obj) { }
681 
683 
684  ~cdef_meta_object () = default;
685 
686  bool is_class () const { return get_rep ()->is_class (); }
687 
688  bool is_property () const { return get_rep ()->is_property (); }
689 
690  bool is_method () const { return get_rep ()->is_method (); }
691 
692  bool is_package () const { return get_rep ()->is_package (); }
693 
694  void doc_string (const std::string& txt) { get_rep ()->doc_string (txt); }
695 
696  std::string doc_string () const { return get_rep ()->doc_string (); }
697 
699  meta_subsref (const std::string& type,
700  const std::list<octave_value_list>& idx, int nargout)
701  {
702  return get_rep ()->meta_subsref (type, idx, nargout);
703  }
704 
705  void meta_release () { get_rep ()->meta_release (); }
706 
707  bool meta_accepts_postfix_index (char type) const
708  {
709  return get_rep ()->meta_accepts_postfix_index (type);
710  }
711 
712 private:
713 
715  {
716  return dynamic_cast<cdef_meta_object_rep *> (cdef_object::get_rep ());
717  }
718 
719  const cdef_meta_object_rep * get_rep () const
720  {
721  return dynamic_cast<const cdef_meta_object_rep *> (cdef_object::get_rep ());
722  }
723 };
724 
725 OCTAVE_END_NAMESPACE(octave)
726 
727 #endif
octave_idx_type numel() 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:662
virtual bool meta_accepts_postfix_index(char) const
Definition: cdef-object.h:652
virtual bool is_class() const
Definition: cdef-object.h:630
cdef_object_rep * copy() const
Definition: cdef-object.h:625
~cdef_meta_object_rep()=default
bool is_meta_object() const
Definition: cdef-object.h:628
std::string doc_string() const
Definition: cdef-object.h:640
virtual void meta_release()
Definition: cdef-object.h:650
virtual octave_value_list meta_subsref(const std::string &, const std::list< octave_value_list > &, int)
Definition: cdef-object.h:643
void doc_string(const std::string &txt)
Definition: cdef-object.h:638
virtual bool is_package() const
Definition: cdef-object.h:636
std::string m_doc_string
Definition: cdef-object.h:659
virtual bool is_property() const
Definition: cdef-object.h:632
virtual bool is_method() const
Definition: cdef-object.h:634
bool meta_accepts_postfix_index(char type) const
Definition: cdef-object.h:707
bool is_property() const
Definition: cdef-object.h:688
bool is_package() const
Definition: cdef-object.h:692
cdef_meta_object(const cdef_object &obj)
Definition: cdef-object.h:680
bool is_method() const
Definition: cdef-object.h:690
cdef_meta_object(cdef_meta_object_rep *r)
Definition: cdef-object.h:678
bool is_class() const
Definition: cdef-object.h:686
cdef_meta_object(const cdef_meta_object &obj)
Definition: cdef-object.h:676
~cdef_meta_object()=default
void doc_string(const std::string &txt)
Definition: cdef-object.h:694
octave_value_list meta_subsref(const std::string &type, const std::list< octave_value_list > &idx, int nargout)
Definition: cdef-object.h:699
std::string doc_string() const
Definition: cdef-object.h:696
bool is_valid() const
Definition: cdef-object.h:414
void set_property(octave_idx_type idx, const std::string &pname, const octave_value &pval)
Definition: cdef-object.h:429
dim_vector dims() const
Definition: cdef-object.h:412
~cdef_object_array()=default
cdef_object_rep * clone() const
Definition: cdef-object.h:407
Array< cdef_object > array_value() 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_array() const
Definition: cdef-object.h:416
cdef_object_array(const Array< cdef_object > &a)
Definition: cdef-object.h:399
cdef_object_rep * empty_clone() const
Definition: cdef-object.h:371
cdef_object_base(const cdef_object_base &obj)
Definition: cdef-object.h:381
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() const
Definition: cdef-object.h:89
virtual void mark_as_constructed(const cdef_class &)
Definition: cdef-object.h:166
virtual void mark_as_constructed()
Definition: cdef-object.h:161
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 void set_property(octave_idx_type, const std::string &, const octave_value &)
Definition: cdef-object.h:110
virtual ~cdef_object_rep()=default
virtual octave_value get(const std::string &) const
Definition: cdef-object.h:105
virtual bool is_constructed() const
Definition: cdef-object.h:171
virtual bool is_meta_object() const
Definition: cdef-object.h:95
virtual cdef_object_rep * clone() const
Definition: cdef-object.h:69
virtual cdef_object_rep * make_array() const
Definition: cdef-object.h:84
virtual cdef_object_rep * empty_clone() const
Definition: cdef-object.h:74
virtual octave_value get_property(octave_idx_type, const std::string &) const
Definition: cdef-object.h:116
virtual Array< cdef_object > array_value() const
Definition: cdef-object.h:97
virtual bool is_partially_constructed_for(const cdef_class &) const
Definition: cdef-object.h:156
cdef_object_rep(const cdef_object_rep &)
Definition: cdef-object.h:191
virtual void put(const std::string &, const octave_value &)
Definition: cdef-object.h:102
virtual void destroy()
Definition: cdef-object.h:178
virtual bool is_handle_object() const
Definition: cdef-object.h:93
virtual octave_idx_type static_count() const
Definition: cdef-object.h:176
virtual cdef_object_rep * copy() const
Definition: cdef-object.h:79
virtual bool is_valid() const
Definition: cdef-object.h:142
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
virtual dim_vector dims() const
Definition: cdef-object.h:182
virtual bool is_value_object() const
Definition: cdef-object.h:91
refcount< octave_idx_type > m_count
Definition: cdef-object.h:187
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
bool is_constructed() 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 mark_as_constructed()
Definition: cdef-object.h:524
dim_vector dims() const
Definition: cdef-object.h:471
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()=default
cdef_object clone() const
Definition: cdef-object.h:236
bool is_array() const
Definition: cdef-object.h:252
bool is_constructed() const
Definition: cdef-object.h:319
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
const cdef_object_rep * get_rep() const
Definition: cdef-object.h:310
cdef_class get_class() const
Definition: cdef-object.cc:183
void mark_for_construction(const cdef_class &cls)
Definition: cdef-object.h:314
cdef_object & operator=(const cdef_object &obj)
Definition: cdef-object.h:217
octave_map map_value() const
Definition: cdef-object.cc:137
bool is_partially_constructed_for(const cdef_class &cls) const
Definition: cdef-object.h:326
bool is_handle_object() const
Definition: cdef-object.h:256
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
virtual ~cdef_object()
Definition: cdef-object.h:215
bool ok() const
Definition: cdef-object.h:312
cdef_object(const cdef_object &obj)
Definition: cdef-object.h:210
string_vector map_keys() const
Definition: cdef-object.h:306
void mark_as_constructed()
Definition: cdef-object.h:331
void set_class(const cdef_class &cls)
Definition: cdef-object.h:232
std::string class_name() const
Definition: cdef-object.h:234
bool is_meta_object() const
Definition: cdef-object.h:258
dim_vector dims() const
Definition: cdef-object.h:243
cdef_object make_array() const
Definition: cdef-object.h:245
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
cdef_object empty_clone() const
Definition: cdef-object.h:238
bool is_value_object() const
Definition: cdef-object.h:254
cdef_object copy() const
Definition: cdef-object.h:250
cdef_object(cdef_object_rep *r)
Definition: cdef-object.h:213
Array< cdef_object > array_value() const
Definition: cdef-object.h:260
cdef_object_rep * get_rep()
Definition: cdef-object.h:340
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
Vector representing the dimensions (size) of an Array.
Definition: dim-vector.h:94
handle_cdef_object(const handle_cdef_object &obj)
Definition: cdef-object.h:577
cdef_object_rep * copy() const
Definition: cdef-object.h:565
bool is_handle_object() const
Definition: cdef-object.h:572
cdef_object_rep * clone() const
Definition: cdef-object.h:558
bool is_valid() const
Definition: cdef-object.h:570
bool is_value_object() const
Definition: cdef-object.h:603
bool is_valid() const
Definition: cdef-object.h:601
cdef_object_rep * copy() const
Definition: cdef-object.h:599
cdef_object_rep * clone() const
Definition: cdef-object.h:594
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
std::string release()
void() error(const char *fmt,...)
Definition: error.cc:988
T * r
Definition: mx-inlines.cc:781