GNU Octave  4.2.1
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-fcn-inline.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2004-2017 David Bateman
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_fcn_inline_h)
24 #define octave_ov_fcn_inline_h 1
25 
26 #include "octave-config.h"
27 
28 #include <iosfwd>
29 #include <string>
30 
31 #include "ov-base.h"
32 #include "ov-base-mat.h"
33 #include "ov-fcn.h"
34 #include "ov-typeinfo.h"
35 #include "symtab.h"
36 #include "ov-fcn-handle.h"
37 
38 // Inline functions.
39 
40 class
43 {
44 public:
45 
47  : octave_fcn_handle (), iftext (), ifargs () { }
48 
50  const std::string& n = "");
51 
53  : octave_fcn_handle (fi), iftext (fi.iftext), ifargs (fi.ifargs) { }
54 
55  ~octave_fcn_inline (void) { }
56 
57  octave_base_value *clone (void) const
58  { return new octave_fcn_inline (*this); }
60  { return new octave_fcn_inline (); }
61 
62  bool is_inline_function (void) const { return true; }
63 
64  octave_fcn_inline *fcn_inline_value (bool = false) { return this; }
65 
66  std::string fcn_text (void) const { return iftext; }
67 
68  string_vector fcn_arg_names (void) const { return ifargs; }
69 
70  octave_value convert_to_str_internal (bool, bool, char) const;
71 
72  octave_map map_value (void) const;
73 
74  bool save_ascii (std::ostream& os);
75 
76  bool load_ascii (std::istream& is);
77 
78  bool save_binary (std::ostream& os, bool& save_as_floats);
79 
80  bool load_binary (std::istream& is, bool swap,
82 
83  bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats);
84 
85  bool load_hdf5 (octave_hdf5_id loc_id, const char *name);
86 
87  void print (std::ostream& os, bool pr_as_read_syntax = false);
88 
89  void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const;
90 
91 private:
92 
94 
95  // The expression of an inline function.
97 
98  // The args of an inline function.
100 };
101 
102 #endif
bool is_inline_function(void) const
Definition: ov-fcn-inline.h:62
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE const F77_DBLE * f
static double fi[256]
Definition: randmtzig.cc:440
std::string fcn_text(void) const
Definition: ov-fcn-inline.h:66
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
Definition: cellfun.cc:398
bool swap
Definition: load-save.cc:725
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
Definition: ov-base.h:148
octave_fcn_inline(const octave_fcn_inline &fi)
Definition: ov-fcn-inline.h:52
OCTAVE_EXPORT octave_value_list any number nd example oindent prints the prompt xample Pick a any number!nd example oindent and waits for the user to enter a value The string entered by the user is evaluated as an so it may be a literal a variable name
Definition: input.cc:871
#define OCTINTERP_API
Definition: mexproto.h:69
octave_base_value * clone(void) const
Definition: ov-fcn-inline.h:57
string_vector ifargs
Definition: ov-fcn-inline.h:99
bool save_as_floats
Definition: load-save.cc:1581
int64_t octave_hdf5_id
std::string iftext
Definition: ov-fcn-inline.h:96
octave_base_value * empty_clone(void) const
Definition: ov-fcn-inline.h:59
string_vector fcn_arg_names(void) const
Definition: ov-fcn-inline.h:68
write the output to stdout if nargout is
Definition: load-save.cc:1576
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:854
octave_fcn_inline * fcn_inline_value(bool=false)
Definition: ov-fcn-inline.h:64