GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
oct-errno.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2005-2018 John W. Eaton
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
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License 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 <https://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if ! defined (octave_oct_errno_h)
24 #define octave_oct_errno_h 1
25 
26 #include "octave-config.h"
27 
28 #include <cerrno>
29 #include <map>
30 #include <string>
31 
32 #include "oct-map.h"
33 
34 class
36 {
37 protected:
38 
39  octave_errno (void);
40 
41 public:
42 
43  ~octave_errno (void) = default;
44 
45  static bool instance_ok (void);
46 
47  static void cleanup_instance (void) { delete instance; instance = nullptr; }
48 
49  static int lookup (const std::string& name);
50 
51  static octave_scalar_map list (void);
52 
53  static int get (void) { return errno; }
54 
55  static int set (int val)
56  {
57  int retval = errno;
58  errno = val;
59  return retval;
60  }
61 
62 private:
63 
64  std::map<std::string, int> errno_tbl;
65 
67 
68  int do_lookup (const std::string& name);
69 
70  octave_scalar_map do_list (void);
71 };
72 
73 #endif
static void cleanup_instance(void)
Definition: oct-errno.h:47
The value of lines which begin with a space character are not saved in the history list A value of all commands are saved on the history list
Definition: oct-hist.cc:734
static octave_errno * instance
Definition: oct-errno.h:66
identity matrix If supplied two scalar respectively For allows like xample val
Definition: data.cc:4986
octave_idx_type lookup(const T *x, octave_idx_type n, T y)
nd deftypefn *std::string name
Definition: sysdep.cc:647
octave_value retval
Definition: data.cc:6246
std::map< std::string, int > errno_tbl
Definition: oct-errno.h:64
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:888