26 #if defined (HAVE_CONFIG_H)
56 cdef_package::cdef_package_rep::install_class (
const cdef_class& cls,
57 const std::string& nm)
59 m_class_map[nm] = cls;
65 cdef_package::cdef_package_rep::install_function (
const octave_value& fcn,
66 const std::string& nm)
68 m_function_map[nm] = fcn;
72 cdef_package::cdef_package_rep::install_package (
const cdef_package& pack,
73 const std::string& nm)
75 m_package_map[nm] = pack;
80 template <
typename T1,
typename T2>
84 Cell retval (1,
m.size ());
87 for (
const auto& it :
m)
88 retval(i++) =
to_ov (it.second);
94 cdef_package::cdef_package_rep::get_classes ()
const
100 cdef_package::cdef_package_rep::get_functions ()
const
106 cdef_package::cdef_package_rep::get_packages ()
const
112 cdef_package::cdef_package_rep::find (
const std::string& nm)
114 std::string symbol_name = get_name () +
'.' + nm;
118 return interp.
find (symbol_name);
122 cdef_package::cdef_package_rep::meta_subsref
123 (
const std::string& type,
const std::list<octave_value_list>& idx,
132 if (idx.front ().length () != 1)
133 error (
"invalid meta.package indexing");
135 std::string nm = idx.front ()(0).xstring_value (
"invalid meta.package indexing, expected a symbol name");
138 std::cerr <<
"meta.package query: " << nm << std::endl;
144 error (
"member '%s' in package '%s' does not exist",
145 nm.c_str (), get_name ().c_str ());
164 retval = interp.
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");
189 cdef_package::cdef_package_rep::meta_release ()
200 if (
this != cdm.
meta ().get_rep ())
204 OCTAVE_END_NAMESPACE(
octave)
Cell map2Cell(const std::map< T1, T2 > &m)
octave_value to_ov(const cdef_object &obj)
const cdef_package & meta() const
void unregister_package(const cdef_package &pkg)
octave_value find(const std::string &name)
octave_value_list feval(const char *name, const octave_value_list &args=octave_value_list(), int nargout=0)
Evaluate an Octave function (built-in or interpreted) and return the list of result values.
virtual bool accepts_postfix_index(char type) const
octave_value next_subsref(const std::string &type, const std::list< octave_value_list > &idx, std::size_t skip=1)
octave_function * function_value(bool silent=false) const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
void() error(const char *fmt,...)
interpreter & __get_interpreter__()
cdef_manager & __get_cdef_manager__()