GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
ov-null-mat.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2008-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_ov_null_mat_h)
27 #define octave_ov_null_mat_h 1
28 
29 #include "octave-config.h"
30 
31 #include "ov.h"
32 #include "ov-re-mat.h"
33 #include "ov-str-mat.h"
34 
35 // Design rationale:
36 // The constructors are hidden. There is only one null matrix (or null string)
37 // object, that can have shallow copies. Cloning the object returns just a
38 // normal empty matrix, so all the shallow copies are, in fact, read-only.
39 // This conveniently ensures that any attempt to fiddle with the null matrix
40 // destroys its special status.
41 
42 // The special [] value.
43 
44 class
45 OCTINTERP_API
47 {
49 
50 public:
51 
52  static const octave_value instance;
53 
54  bool isnull () const { return true; }
55  bool vm_need_storable_call () const { return true; }
56 
57  type_conv_info numeric_conversion_function () const;
58 
59 private:
60 
62 };
63 
64 // The special "" value
65 
66 class
67 OCTINTERP_API
69 {
71 
72 public:
73 
74  static const octave_value instance;
75 
76  bool is_storable () const { return false; }
77 
78  bool isnull () const { return true; }
79  bool vm_need_storable_call () const { return true; }
80 
81  type_conv_info numeric_conversion_function () const;
82 
83 private:
84 
86 };
87 
88 // The special '' value
89 
90 class
91 OCTINTERP_API
93 {
95 
96 public:
97 
98  static const octave_value instance;
99 
100  bool is_storable () const { return false; }
101 
102  bool isnull () const { return true; }
103 
104  bool vm_need_storable_call () const { return true; }
105 
106  type_conv_info numeric_conversion_function () const;
107 
108 private:
109 
111 };
112 
113 #endif
bool isnull() const
Definition: ov-null-mat.h:54
bool vm_need_storable_call() const
Definition: ov-null-mat.h:55
static const octave_value instance
Definition: ov-null-mat.h:52
static const octave_value instance
Definition: ov-null-mat.h:98
bool isnull() const
Definition: ov-null-mat.h:102
bool is_storable() const
Definition: ov-null-mat.h:100
bool vm_need_storable_call() const
Definition: ov-null-mat.h:104
bool vm_need_storable_call() const
Definition: ov-null-mat.h:79
bool isnull() const
Definition: ov-null-mat.h:78
bool is_storable() const
Definition: ov-null-mat.h:76
static const octave_value instance
Definition: ov-null-mat.h:74
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
Definition: ov-base.h:181