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);
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);
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 (); }
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); }
176 {
return rep->num_fcn_names (); }
179 {
return rep->is_out_of_date (); }
182 {
return rep->file_name (); }
185 {
return rep->time_loaded (); }
void * search(const std::string &nm, name_mangler mangler=0) const
octave_time time_loaded(void) const
octave_refcount< int > count
octave_shlib(const octave_shlib &sl)
octave_time time_loaded(void) const
size_t number_of_functions_loaded(void) const
std::string file_name(void) const
octave_shlib(const std::string &f, bool fake=true)
std::map< std::string, size_t >::iterator fcn_names_iterator
size_t num_fcn_names(void) const
F77_RET_T const double const double * f
static std::map< std::string, shlib_rep * > instances
bool operator==(const dim_vector &a, const dim_vector &b)
void add(const std::string &name)
std::map< std::string, size_t > fcn_names
bool is_out_of_date(void) const
void open(const std::string &f)
virtual void * search(const std::string &, name_mangler=0)
virtual bool is_open(void) const
void close(close_hook cl_hook=0)
std::map< std::string, size_t >::const_iterator fcn_names_const_iterator
std::string file_name(void) const