26 #if ! defined (octave_oct_shlib_h)
27 #define octave_oct_shlib_h 1
29 #include "octave-config.h"
46 typedef std::function<std::string (
const std::string&)>
name_mangler;
53 : m_count (1), m_fcn_names (), m_file (), m_time_loaded (OCTAVE_TIME_T ()),
54 m_search_all_loaded (false)
66 s_instances.erase (m_file);
72 virtual void *
search (
const std::string&,
84 {
return m_time_loaded; }
91 OCTAVE_API std::list<std::string> function_names (
void)
const;
93 OCTAVE_API void add_fcn_name (
const std::string&);
95 OCTAVE_API bool remove_fcn_name (
const std::string&);
132 if (--m_rep->m_count == 0 && m_rep != &s_nil_rep)
146 if (m_rep != sl.
m_rep)
148 if (--m_rep->m_count == 0 && m_rep != &s_nil_rep)
159 {
return (m_rep == sl.
m_rep); }
161 operator bool ()
const {
return m_rep->is_open (); }
168 std::list<std::string> removed_fcns = m_rep->function_names ();
170 m_rep->clear_fcn_names ();
180 void *
f = m_rep->search (nm, mangler);
182 m_rep->add_fcn_name (nm);
187 void add (
const std::string& name)
188 { m_rep->add_fcn_name (name); }
191 {
return m_rep->remove_fcn_name (name); }
194 {
return m_rep->num_fcn_names (); }
197 {
return m_rep->is_out_of_date (); }
200 {
return m_rep->file_name (); }
203 {
return m_rep->time_loaded (); }
sys::time time_loaded(void) const
std::map< std::string, std::size_t >::const_iterator fcn_names_const_iterator
virtual bool is_open(void) const
virtual void * search(const std::string &, const name_mangler &=name_mangler())
std::string file_name(void) const
static OCTAVE_API std::map< std::string, dynlib_rep * > s_instances
void clear_fcn_names(void)
std::size_t num_fcn_names(void) const
std::map< std::string, std::size_t > m_fcn_names
std::map< std::string, std::size_t >::iterator fcn_names_iterator
virtual ~dynlib_rep(void)
refcount< octave_idx_type > m_count
sys::time time_loaded(void) const
void * search(const std::string &nm, const name_mangler &mangler=name_mangler()) const
void open(const std::string &f)
bool is_out_of_date(void) const
std::string file_name(void) const
std::function< std::string(const std::string &)> name_mangler
std::size_t number_of_functions_loaded(void) const
static OCTAVE_API dynlib_rep s_nil_rep
dynamic_library(const std::string &f, bool fake=true)
std::list< std::string > close(void)
dynamic_library(const dynamic_library &sl)
void add(const std::string &name)
bool remove(const std::string &name)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
bool operator==(const dim_vector &a, const dim_vector &b)
F77_RET_T const F77_DBLE const F77_DBLE * f
OCTAVE_API int release_unreferenced_dynamic_libraries(void)