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_dynamic_ld_h)
00024 #define octave_dynamic_ld_h 1
00025
00026 #include <string>
00027
00028 #include "oct-shlib.h"
00029
00030 class octave_function;
00031
00032 class
00033 octave_dynamic_loader
00034 {
00035 protected:
00036
00037 octave_dynamic_loader (void) { }
00038
00039 public:
00040
00041 virtual ~octave_dynamic_loader (void) { }
00042
00043 static octave_function *
00044 load_oct (const std::string& fcn_name,
00045 const std::string& file_name = std::string (),
00046 bool relative = false);
00047
00048 static octave_function *
00049 load_mex (const std::string& fcn_name,
00050 const std::string& file_name = std::string (),
00051 bool relative = false);
00052
00053 static bool remove_oct (const std::string& fcn_name, octave_shlib& shl);
00054
00055 static bool remove_mex (const std::string& fcn_name, octave_shlib& shl);
00056
00057 private:
00058
00059
00060
00061 octave_dynamic_loader (const octave_dynamic_loader&);
00062
00063 octave_dynamic_loader& operator = (const octave_dynamic_loader&);
00064
00065 static octave_dynamic_loader *instance;
00066
00067 static void cleanup_instance (void) { delete instance; instance = 0; }
00068
00069 static bool instance_ok (void);
00070
00071 octave_function *
00072 do_load_oct (const std::string& fcn_name,
00073 const std::string& file_name = std::string (),
00074 bool relative = false);
00075
00076 octave_function *
00077 do_load_mex (const std::string& fcn_name,
00078 const std::string& file_name = std::string (),
00079 bool relative = false);
00080
00081 bool do_remove_oct (const std::string& fcn_name, octave_shlib& shl);
00082
00083 bool do_remove_mex (const std::string& fcn_name, octave_shlib& shl);
00084
00085 static bool doing_load;
00086
00087 protected:
00088
00089 static std::string name_mangler (const std::string& name);
00090
00091 static std::string name_uscore_mangler (const std::string& name);
00092
00093 static std::string mex_mangler (const std::string& name);
00094
00095 static std::string mex_uscore_mangler (const std::string& name);
00096
00097 static std::string mex_f77_mangler (const std::string& name);
00098 };
00099
00100 #endif