26 #if ! defined (octave_hook_fcn_h)
27 #define octave_hook_fcn_h 1
29 #include "octave-config.h"
49 virtual std::
string id ()
const {
return ""; }
51 virtual bool is_valid ()
const {
return false; }
62 static std::shared_ptr<base_hook_function>
75 std::string
id ()
const {
return m_rep->id (); }
77 bool is_valid ()
const {
return m_rep->is_valid (); }
81 m_rep->eval (initial_args);
86 std::shared_ptr<base_hook_function> m_rep;
96 : m_name (
n), m_data (
d)
103 std::string
id ()
const {
return m_name; }
121 : m_ident (), m_valid (false), m_fcn_handle (fh_arg), m_data (
d)
129 std::ostringstream buf;
131 m_ident = fh->fcn_name () +
':' + buf.str ();
139 std::string
id ()
const {
return m_ident; }
158 typedef std::map<std::string, hook_function>
map_type;
165 bool
empty ()
const {
return m_fcn_map.empty (); }
167 void clear () { m_fcn_map.clear (); }
176 return m_fcn_map.find (
id);
181 return m_fcn_map.find (
id);
192 auto p = m_fcn_map.begin ();
194 while (p != m_fcn_map.end ())
196 std::string hook_fcn_id = p->first;
202 hook_fcn.
eval (initial_args);
213 OCTAVE_END_NAMESPACE(
octave)
virtual void eval(const octave_value_list &)
virtual bool is_valid() const
fcn_handle_hook_function(const octave_value &fh_arg, const octave_value &d)
void eval(const octave_value_list &initial_args)
fcn_handle_hook_function()=delete
const_iterator find(const std::string &id) const
map_type::iterator iterator
map_type::const_iterator const_iterator
void run(const octave_value_list &initial_args=octave_value_list())
std::map< std::string, hook_function > map_type
const_iterator end() const
iterator find(const std::string &id)
void insert(const std::string &id, const hook_function &f)
void eval(const octave_value_list &initial_args)
named_hook_function()=delete
named_hook_function(const std::string &n, const octave_value &d)
void eval(const octave_value_list &initial_args)
octave_fcn_handle * fcn_handle_value(bool silent=false) const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
F77_RET_T const F77_DBLE const F77_DBLE * f
octave_function * is_valid_function(const std::string &fcn_name, const std::string &warn_for, bool warn)