24 #if !defined (octave_oct_shlib_h)
25 #define octave_oct_shlib_h 1
39 typedef std::string (*name_mangler) (
const std::string&);
40 typedef void (*close_hook) (
const std::string&);
47 : count (1), file (), tm_loaded (time_t ()), fcn_names () { }
57 instances.erase (file);
60 virtual bool is_open (
void)
const
63 virtual void *
search (
const std::string&, name_mangler = 0)
66 bool is_out_of_date (
void)
const;
69 static shlib_rep *new_instance (
const std::string&
f);
71 static shlib_rep *get_instance (
const std::string&
f,
bool fake);
76 std::string file_name (
void)
const
81 void add_fcn_name (
const std::string&);
83 bool remove_fcn_name (
const std::string&);
85 void do_close_hook (close_hook cl_hook);
93 void fake_reload (
void);
116 : rep (
shlib_rep::get_instance (f, fake)) { }
120 if (--rep->count == 0)
134 if (--rep->count == 0)
145 {
return (rep == sl.
rep); }
147 operator bool ()
const {
return rep->is_open (); }
149 void open (
const std::string&
f)
152 void close (close_hook cl_hook = 0)
155 rep->do_close_hook (cl_hook);
160 void *
search (
const std::string& nm, name_mangler mangler = 0)
const
162 void *
f = rep->search (nm, mangler);
164 rep->add_fcn_name (nm);
169 void add (
const std::string& name)
170 { rep->add_fcn_name (name); }
172 bool remove (
const std::string& name)
173 {
return rep->remove_fcn_name (name); }
175 size_t number_of_functions_loaded (
void)
const
176 {
return rep->num_fcn_names (); }
178 bool is_out_of_date (
void)
const
179 {
return rep->is_out_of_date (); }
181 std::string file_name (
void)
const
182 {
return rep->file_name (); }
185 {
return rep->time_loaded (); }