26 #if ! defined (octave_cdef_package_h)
27 #define octave_cdef_package_h 1
29 #include "octave-config.h"
60 cdef_package_rep&
operator = (
const cdef_package_rep&) =
delete;
62 ~cdef_package_rep () =
default;
65 {
return new cdef_package_rep (*
this); }
71 void set_name (
const std::string& nm) {
put (
"Name", nm); }
74 install_class (
const cdef_class& cls,
const std::string& nm);
77 install_function (
const octave_value& fcn,
const std::string& nm);
80 install_package (
const cdef_package& pack,
const std::string& nm);
82 OCTINTERP_API
Cell get_classes ()
const;
84 OCTINTERP_API
Cell get_functions ()
const;
86 OCTINTERP_API
Cell get_packages ()
const;
99 m_package_map.clear ();
107 const std::list<octave_value_list>& idx,
int nargout);
113 return (type ==
'.');
116 OCTINTERP_API
octave_value find (
const std::string& nm);
120 std::string m_full_name;
121 std::map<std::string, cdef_class> m_class_map;
122 std::map<std::string, octave_value> m_function_map;
123 std::map<std::string, cdef_package> m_package_map;
129 typedef std::map<std::string, cdef_class>::iterator class_iterator;
130 typedef std::map<std::string, cdef_class>::const_iterator class_const_iterator;
131 typedef std::map<std::string, octave_value>::iterator function_iterator;
132 typedef std::map<std::string, octave_value>::const_iterator
133 function_const_iterator;
134 typedef std::map<std::string, cdef_package>::iterator package_iterator;
135 typedef std::map<std::string, cdef_package>::const_iterator
136 package_const_iterator;
138 cdef_package_rep (
const cdef_package_rep& p)
140 m_class_map (p.m_class_map), m_function_map (p.m_function_map),
141 m_package_map (p.m_package_map), m_member_count (p.m_member_count)
158 get_rep ()->set_name (nm);
168 error (
"internal error: invalid assignment from %s to meta.package object",
183 get_rep ()->install_class (cls, nm);
188 get_rep ()->install_function (fcn, nm);
193 get_rep ()->install_package (pack, nm);
198 return get_rep ()->get_classes ();
203 return get_rep ()->get_functions ();
208 return get_rep ()->get_packages ();
211 std::string
get_name ()
const {
return get_rep ()->get_name (); }
215 return get_rep ()->find (nm);
220 cdef_package_rep * get_rep ()
225 const cdef_package_rep * get_rep ()
const
233 OCTAVE_END_NAMESPACE(
octave)
cdef_class & operator=(const cdef_class &cls)
std::string get_name() const
const cdef_object_rep * get_rep() const
cdef_object & operator=(const cdef_object &obj)
void put(const std::string &pname, const octave_value &val)
std::string class_name() const
octave_value get(const std::string &pname) const
void install_package(const cdef_package &pack, const std::string &nm)
cdef_package(const cdef_object &obj)
cdef_package(const cdef_package &pack)
Cell get_functions() const
void install_function(const octave_value &fcn, const std::string &nm)
cdef_package(const std::string &nm)
void install_class(const cdef_class &cls, const std::string &nm)
Cell get_packages() const
octave_value find(const std::string &nm)
friend void install_classdef(octave::interpreter &interp)
std::string get_name() const
std::string string_value(bool force=false) const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
void() error(const char *fmt,...)