Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #if !defined (octave_mex_function_h)
00024 #define octave_mex_function_h 1
00025
00026 #include <string>
00027
00028 #include "oct-shlib.h"
00029
00030 #include "ov-fcn.h"
00031 #include "ov-builtin.h"
00032 #include "ov-typeinfo.h"
00033
00034 class octave_shlib;
00035
00036 class octave_value;
00037 class octave_value_list;
00038
00039
00040
00041 class
00042 octave_mex_function : public octave_function
00043 {
00044 public:
00045
00046 octave_mex_function (void)
00047 : mex_fcn_ptr (), exit_fcn_ptr (), have_fmex (), sh_lib (),
00048 t_checked (), system_fcn_file () { }
00049
00050 octave_mex_function (void *fptr, bool fmex, const octave_shlib& shl,
00051 const std::string& nm = std::string ());
00052
00053 ~octave_mex_function (void);
00054
00055 octave_value subsref (const std::string& type,
00056 const std::list<octave_value_list>& idx)
00057 {
00058 octave_value_list tmp = subsref (type, idx, 1);
00059 return tmp.length () > 0 ? tmp(0) : octave_value ();
00060 }
00061
00062 octave_value_list subsref (const std::string& type,
00063 const std::list<octave_value_list>& idx,
00064 int nargout);
00065
00066 octave_function *function_value (bool = false) { return this; }
00067
00068 const octave_function *function_value (bool = false) const { return this; }
00069
00070 void mark_fcn_file_up_to_date (const octave_time& t) { t_checked = t; }
00071
00072 std::string fcn_file_name (void) const;
00073
00074 octave_time time_parsed (void) const;
00075
00076 octave_time time_checked (void) const { return t_checked; }
00077
00078 bool is_system_fcn_file (void) const { return system_fcn_file; }
00079
00080 bool is_builtin_function (void) const { return false; }
00081
00082 bool is_mex_function (void) const { return true; }
00083
00084 octave_value_list
00085 do_multi_index_op (int nargout, const octave_value_list& args);
00086
00087 void atexit (void (*fcn) (void)) { exit_fcn_ptr = fcn; }
00088
00089 octave_shlib get_shlib (void) const
00090 { return sh_lib; }
00091
00092 private:
00093
00094 void *mex_fcn_ptr;
00095
00096 void (*exit_fcn_ptr) (void);
00097
00098 bool have_fmex;
00099
00100 octave_shlib sh_lib;
00101
00102
00103
00104 mutable octave_time t_checked;
00105
00106
00107
00108
00109 bool system_fcn_file;
00110
00111
00112
00113 octave_mex_function (const octave_mex_function& fn);
00114
00115 octave_mex_function& operator = (const octave_mex_function& fn);
00116
00117 DECLARE_OCTAVE_ALLOCATOR
00118
00119 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
00120 };
00121
00122 #endif