00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #if !defined (octave_dynamic_ld_h)
00025 #define octave_dynamic_ld_h 1
00026
00027 #include <string>
00028
00029 #include "oct-shlib.h"
00030
00031 class octave_function;
00032
00033 class
00034 octave_dynamic_loader
00035 {
00036 protected:
00037
00038 octave_dynamic_loader (void) { }
00039
00040 public:
00041
00042 virtual ~octave_dynamic_loader (void) { }
00043
00044 static octave_function *
00045 load_oct (const std::string& fcn_name,
00046 const std::string& file_name = std::string (),
00047 bool relative = false);
00048
00049 static octave_function *
00050 load_mex (const std::string& fcn_name,
00051 const std::string& file_name = std::string (),
00052 bool relative = false);
00053
00054 static bool remove_oct (const std::string& fcn_name, octave_shlib& shl);
00055
00056 static bool remove_mex (const std::string& fcn_name, octave_shlib& shl);
00057
00058 private:
00059
00060
00061
00062 octave_dynamic_loader (const octave_dynamic_loader&);
00063
00064 octave_dynamic_loader& operator = (const octave_dynamic_loader&);
00065
00066 static octave_dynamic_loader *instance;
00067
00068 static bool instance_ok (void);
00069
00070 octave_function *
00071 do_load_oct (const std::string& fcn_name,
00072 const std::string& file_name = std::string (),
00073 bool relative = false);
00074
00075 octave_function *
00076 do_load_mex (const std::string& fcn_name,
00077 const std::string& file_name = std::string (),
00078 bool relative = false);
00079
00080 bool do_remove_oct (const std::string& fcn_name, octave_shlib& shl);
00081
00082 bool do_remove_mex (const std::string& fcn_name, octave_shlib& shl);
00083
00084 static bool doing_load;
00085
00086 protected:
00087
00088 static std::string name_mangler (const std::string& name);
00089
00090 static std::string name_uscore_mangler (const std::string& name);
00091
00092 static std::string mex_mangler (const std::string& name);
00093
00094 static std::string mex_uscore_mangler (const std::string& name);
00095
00096 static std::string mex_f77_mangler (const std::string& name);
00097 };
00098
00099 #endif
00100
00101
00102
00103
00104
00105