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)
68 s_instances.erase (m_file);
74 virtual void *
search (
const std::string&,
86 {
return m_time_loaded; }
93 OCTAVE_API std::list<std::string> function_names ()
const;
95 OCTAVE_API void add_fcn_name (
const std::string&);
97 OCTAVE_API bool remove_fcn_name (
const std::string&);
134 if (--m_rep->m_count == 0 && m_rep != &s_nil_rep)
148 if (m_rep != sl.m_rep)
150 if (--m_rep->m_count == 0 && m_rep != &s_nil_rep)
161 {
return (m_rep == sl.m_rep); }
163 operator bool ()
const {
return m_rep->is_open (); }
170 std::list<std::string> removed_fcns = m_rep->function_names ();
172 m_rep->clear_fcn_names ();
182 void *
f = m_rep->search (nm, mangler);
184 m_rep->add_fcn_name (nm);
189 void add (
const std::string& name)
190 { m_rep->add_fcn_name (name); }
193 {
return m_rep->remove_fcn_name (name); }
196 {
return m_rep->num_fcn_names (); }
199 {
return m_rep->is_out_of_date (); }
202 {
return m_rep->file_name (); }
205 {
return m_rep->time_loaded (); }
217 OCTAVE_END_NAMESPACE(
octave)
std::map< std::string, std::size_t >::const_iterator fcn_names_const_iterator
virtual void * search(const std::string &, const name_mangler &=name_mangler())
std::size_t num_fcn_names() const
sys::time time_loaded() const
static std::map< std::string, dynlib_rep * > s_instances
virtual bool is_open() const
std::map< std::string, std::size_t > m_fcn_names
std::string file_name() const
std::map< std::string, std::size_t >::iterator fcn_names_iterator
refcount< octave_idx_type > m_count
void * search(const std::string &nm, const name_mangler &mangler=name_mangler()) const
void open(const std::string &f)
std::string file_name() const
std::list< std::string > close()
bool is_out_of_date() const
std::function< std::string(const std::string &)> name_mangler
dynamic_library(const std::string &f, bool fake=true)
sys::time time_loaded() const
std::size_t number_of_functions_loaded() const
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
int release_unreferenced_dynamic_libraries()