GNU Octave  4.0.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-fcn-inline.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2004-2015 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 <iosfwd>
27 #include <string>
28 
29 
30 #include "ov-base.h"
31 #include "ov-base-mat.h"
32 #include "ov-fcn.h"
33 #include "ov-typeinfo.h"
34 #include "symtab.h"
35 #include "ov-fcn-handle.h"
36 
37 // Inline functions.
38 
39 class
42 {
43 public:
44 
46  : octave_fcn_handle (), iftext (), ifargs () { }
47 
48  octave_fcn_inline (const std::string& f, const string_vector& a,
49  const std::string& n = std::string ());
50 
52  : octave_fcn_handle (fi), iftext (fi.iftext), ifargs (fi.ifargs) { }
53 
54  ~octave_fcn_inline (void) { }
55 
56  octave_base_value *clone (void) const
57  { return new octave_fcn_inline (*this); }
59  { return new octave_fcn_inline (); }
60 
61  bool is_inline_function (void) const { return true; }
62 
63  octave_fcn_inline *fcn_inline_value (bool = false) { return this; }
64 
65  std::string fcn_text (void) const { return iftext; }
66 
67  string_vector fcn_arg_names (void) const { return ifargs; }
68 
69  octave_value convert_to_str_internal (bool, bool, char) const;
70 
71  octave_map map_value (void) const;
72 
73  bool save_ascii (std::ostream& os);
74 
75  bool load_ascii (std::istream& is);
76 
77  bool save_binary (std::ostream& os, bool& save_as_floats);
78 
79  bool load_binary (std::istream& is, bool swap,
81 
82  bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats);
83 
84  bool load_hdf5 (octave_hdf5_id loc_id, const char *name);
85 
86  void print (std::ostream& os, bool pr_as_read_syntax = false);
87 
88  void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const;
89 
90 private:
91 
92 
94 
95  // The expression of an inline function.
96  std::string iftext;
97 
98  // The args of an inline function.
100 };
101 
102 #endif
bool is_inline_function(void) const
Definition: ov-fcn-inline.h:61
std::string fcn_text(void) const
Definition: ov-fcn-inline.h:65
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
Definition: ov-base.h:142
octave_fcn_inline(const octave_fcn_inline &fi)
Definition: ov-fcn-inline.h:51
F77_RET_T const double const double * f
#define OCTINTERP_API
Definition: mexproto.h:66
octave_base_value * clone(void) const
Definition: ov-fcn-inline.h:56
string_vector ifargs
Definition: ov-fcn-inline.h:99
std::string iftext
Definition: ov-fcn-inline.h:96
static double fi[256]
Definition: randmtzig.c:443
octave_base_value * empty_clone(void) const
Definition: ov-fcn-inline.h:58
string_vector fcn_arg_names(void) const
Definition: ov-fcn-inline.h:67
octave_fcn_inline * fcn_inline_value(bool=false)
Definition: ov-fcn-inline.h:63