26 #if ! defined (octave_cdef_package_h)
27 #define octave_cdef_package_h 1
29 #include "octave-config.h"
66 std::string
get_name (
void)
const {
return get(
"Name").string_value (); }
68 void set_name (
const std::string& nm) { put (
"Name", nm); }
70 void install_class (
const cdef_class& cls,
const std::string& nm);
72 void install_function (
const octave_value& fcn,
const std::string& nm);
74 void install_package (
const cdef_package& pack,
const std::string& nm);
76 Cell get_classes (
void)
const;
78 Cell get_functions (
void)
const;
80 Cell get_packages (
void)
const;
100 meta_subsref (
const std::string&
type,
101 const std::list<octave_value_list>& idx,
int nargout);
103 void meta_release (
void);
107 return (
type ==
'.');
126 typedef std::map<std::string, octave_value>::const_iterator
129 typedef std::map<std::string, cdef_package>::const_iterator
134 class_map (p.class_map), function_map (p.function_map),
135 package_map (p.package_map), member_count (p.member_count)
152 get_rep ()->set_name (nm);
162 error (
"internal error: invalid assignment from %s to meta.package object",
163 class_name ().c_str ());
177 get_rep ()->install_class (cls, nm);
182 get_rep ()->install_function (fcn, nm);
187 get_rep ()->install_package (pack, nm);
192 return get_rep ()->get_classes ();
197 return get_rep ()->get_functions ();
202 return get_rep ()->get_packages ();
205 std::string
get_name (
void)
const {
return get_rep ()->get_name (); }
209 return get_rep ()->find (nm);
cdef_object & operator=(const cdef_object &obj)
const cdef_object_rep * get_rep(void) const
std::map< std::string, cdef_class >::const_iterator class_const_iterator
std::map< std::string, cdef_package > package_map
std::map< std::string, cdef_package >::const_iterator package_const_iterator
std::map< std::string, octave_value >::iterator function_iterator
std::map< std::string, cdef_package >::iterator package_iterator
octave_idx_type member_count
bool is_package(void) const
void set_name(const std::string &nm)
std::map< std::string, octave_value > function_map
octave_idx_type static_count(void) const
std::string get_name(void) const
std::map< std::string, cdef_class > class_map
bool meta_accepts_postfix_index(char type) const
cdef_package_rep(const cdef_package_rep &p)
cdef_object_rep * copy(void) const
std::map< std::string, cdef_class >::iterator class_iterator
~cdef_package_rep(void)=default
std::map< std::string, octave_value >::const_iterator function_const_iterator
void install_package(const cdef_package &pack, const std::string &nm)
octave_value find(const std::string &nm)
Cell get_functions(void) const
cdef_package(const std::string &nm)
cdef_package(const cdef_object &obj)
friend void install_classdef(interpreter &interp)
const cdef_package_rep * get_rep(void) const
Cell get_classes(void) const
cdef_package_rep * get_rep(void)
std::string get_name(void) const
Cell get_packages(void) const
~cdef_package(void)=default
void install_function(const octave_value &fcn, const std::string &nm)
void install_class(const cdef_class &cls, const std::string &nm)
cdef_package(const cdef_package &pack)
static octave_idx_type find(octave_idx_type i, octave_idx_type *pp)
void error(const char *fmt,...)