GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ov-null-mat.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2008-2013 Jaroslav Hajek
4 
5 This file is part of Octave.
6 
7 Octave is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if !defined (octave_ov_null_mat_h)
24 #define octave_ov_null_mat_h 1
25 
26 #include "ov.h"
27 #include "ov-re-mat.h"
28 #include "ov-str-mat.h"
29 
30 // Design rationale:
31 // The constructors are hidden. There is only one null matrix (or null string)
32 // object, that can have shallow copies. Cloning the object returns just a
33 // normal empty matrix, so all the shallow copies are, in fact, read-only. This
34 // conveniently ensures that any attempt to fiddle with the null matrix
35 // destroys its special status.
36 
37 // The special [] value.
38 
39 class
42 {
44 
45 public:
46 
47  static const octave_value instance;
48 
49  bool is_null_value (void) const { return true; }
50 
51  type_conv_info numeric_conversion_function (void) const;
52 
53 private:
54 
56 };
57 
58 // The special "" value
59 
60 class
63 {
65 
66 public:
67 
68  static const octave_value instance;
69 
70  bool is_null_value (void) const { return true; }
71 
72  type_conv_info numeric_conversion_function (void) const;
73 
74 
75 private:
76 
78 };
79 
80 // The special '' value
81 
82 class
85 {
87 
88 public:
89 
90  static const octave_value instance;
91 
92  bool is_null_value (void) const { return true; }
93 
94  type_conv_info numeric_conversion_function (void) const;
95 
96 private:
97 
99 };
100 
101 #endif