Octave-Forge - Extra packages for GNU Octave | |
Home · Packages · Developers · Documentation · FAQ · Bugs · Mailing Lists · Links · Code |
00001 /* 00002 00003 Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2007, 2008 00004 John W. Eaton 00005 00006 This file is part of Octave. 00007 00008 Octave is free software; you can redistribute it and/or modify it 00009 under the terms of the GNU General Public License as published by the 00010 Free Software Foundation; either version 3 of the License, or (at your 00011 option) any later version. 00012 00013 Octave is distributed in the hope that it will be useful, but WITHOUT 00014 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00015 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00016 for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with Octave; see the file COPYING. If not, see 00020 <http://www.gnu.org/licenses/>. 00021 00022 */ 00023 00024 #if !defined (octave_dld_function_h) 00025 #define octave_dld_function_h 1 00026 00027 #include <string> 00028 00029 #include "oct-shlib.h" 00030 00031 #include "ov-fcn.h" 00032 #include "ov-builtin.h" 00033 #include "ov-typeinfo.h" 00034 00035 class octave_shlib; 00036 00037 class octave_value; 00038 class octave_value_list; 00039 00040 // Dynamically-linked functions. 00041 00042 class 00043 OCTINTERP_API 00044 octave_dld_function : public octave_builtin 00045 { 00046 public: 00047 00048 octave_dld_function (void) { } 00049 00050 octave_dld_function (octave_builtin::fcn ff, const octave_shlib& shl, 00051 const std::string& nm = std::string (), 00052 const std::string& ds = std::string ()); 00053 00054 ~octave_dld_function (void); 00055 00056 void mark_fcn_file_up_to_date (const octave_time& t) { t_checked = t; } 00057 00058 std::string fcn_file_name (void) const; 00059 00060 octave_time time_parsed (void) const; 00061 00062 octave_time time_checked (void) const { return t_checked; } 00063 00064 bool is_system_fcn_file (void) const { return system_fcn_file; } 00065 00066 bool is_builtin_function (void) const { return false; } 00067 00068 bool is_dld_function (void) const { return true; } 00069 00070 static octave_dld_function* create (octave_builtin::fcn ff, 00071 const octave_shlib& shl, 00072 const std::string& nm = std::string (), 00073 const std::string& ds = std::string ()); 00074 00075 private: 00076 00077 octave_shlib sh_lib; 00078 00079 // The time the file was last checked to see if it needs to be 00080 // parsed again. 00081 mutable octave_time t_checked; 00082 00083 // True if this function came from a file that is considered to be a 00084 // system function. This affects whether we check the time stamp 00085 // on the file to see if it has changed. 00086 bool system_fcn_file; 00087 00088 // No copying! 00089 00090 octave_dld_function (const octave_dld_function& fn); 00091 00092 octave_dld_function& operator = (const octave_dld_function& fn); 00093 00094 DECLARE_OCTAVE_ALLOCATOR 00095 00096 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA 00097 }; 00098 00099 #endif 00100 00101 /* 00102 ;;; Local Variables: *** 00103 ;;; mode: C++ *** 00104 ;;; End: *** 00105 */