26 #if defined (HAVE_CONFIG_H)
58 const std::string& nm)
67 const std::string& nm)
69 m_function_map[nm] = fcn;
74 const std::string& nm)
76 m_package_map[nm] = pack;
81 template <
typename T1,
typename T2>
85 Cell retval (1,
m.size ());
88 for (
auto it =
m.begin (); it !=
m.end (); ++it, ++i)
89 retval(i) =
to_ov (it->second);
115 std::string symbol_name =
get_name () +
'.' + nm;
119 return interp.
find (symbol_name);
124 (
const std::string& type,
const std::list<octave_value_list>& idx,
133 if (idx.front ().length () != 1)
134 error (
"invalid meta.package indexing");
136 std::string nm = idx.front ()(
137 0).xstring_value (
"invalid meta.package indexing, expected a symbol name");
140 std::cerr <<
"meta.package query: " << nm << std::endl;
146 error (
"member '%s' in package '%s' does not exist",
164 retval =
feval (o, tmp_args, nargout);
169 if (type.size () > 1 && idx.size () > 1)
170 retval = retval(0).next_subsref (nargout, type,
173 else if (type.size () > 1 && idx.size () > 1)
181 error (
"invalid meta.package indexing");
Cell map2Cell(const std::map< T1, T2 > &m)
octave_value to_ov(const cdef_object &obj)
const cdef_package & meta(void) const
void unregister_package(const cdef_package &pkg)
OCTINTERP_API Cell get_packages(void) const
OCTINTERP_API void install_package(const cdef_package &pack, const std::string &nm)
OCTINTERP_API void meta_release(void)
OCTINTERP_API Cell get_functions(void) const
OCTINTERP_API Cell get_classes(void) const
OCTINTERP_API void install_class(const cdef_class &cls, const std::string &nm)
OCTINTERP_API void install_function(const octave_value &fcn, const std::string &nm)
OCTINTERP_API octave_value find(const std::string &nm)
OCTINTERP_API octave_value_list meta_subsref(const std::string &type, const std::list< octave_value_list > &idx, int nargout)
std::map< std::string, cdef_class > m_class_map
octave_idx_type m_member_count
cdef_package_rep * get_rep(void)
std::string get_name(void) const
octave_value find(const std::string &nm)
octave_value find(const std::string &name)
virtual bool accepts_postfix_index(char type) const
bool is_function(void) const
OCTINTERP_API octave_function * function_value(bool silent=false) const
bool is_defined(void) const
OCTINTERP_API octave_value next_subsref(const std::string &type, const std::list< octave_value_list > &idx, std::size_t skip=1)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
void error(const char *fmt,...)
interpreter & __get_interpreter__(void)
cdef_manager & __get_cdef_manager__(void)
octave_value_list feval(const char *name, const octave_value_list &args, int nargout)
Evaluate an Octave function (built-in or interpreted) and return the list of result values.