GNU Octave  6.2.0
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-2021 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_oct_errno_h)
27 #define octave_oct_errno_h 1
28 
29 #include "octave-config.h"
30 
31 #include <cerrno>
32 #include <map>
33 #include <string>
34 
35 #include "oct-map.h"
36 
37 class
39 {
40 protected:
41 
42  octave_errno (void);
43 
44 public:
45 
46  ~octave_errno (void) = default;
47 
48  static bool instance_ok (void);
49 
50  static void cleanup_instance (void) { delete instance; instance = nullptr; }
51 
52  static int lookup (const std::string& name);
53 
54  static octave_scalar_map list (void);
55 
56  static int get (void) { return errno; }
57 
58  static int set (int val)
59  {
60  int retval = errno;
61  errno = val;
62  return retval;
63  }
64 
65 private:
66 
67  std::map<std::string, int> errno_tbl;
68 
70 
71  int do_lookup (const std::string& name);
72 
73  octave_scalar_map do_list (void);
74 };
75 
76 #endif
octave_idx_type lookup(const T *x, octave_idx_type n, T y)
static int set(int val)
Definition: oct-errno.h:58
std::map< std::string, int > errno_tbl
Definition: oct-errno.h:67
~octave_errno(void)=default
static octave_errno * instance
Definition: oct-errno.h:69
static void cleanup_instance(void)
Definition: oct-errno.h:50
static int get(void)
Definition: oct-errno.h:56
QString name
octave_value::octave_value(const Array< char > &chm, char type) return retval
Definition: ov.cc:811