
#include <rutz/assocarray.h>
Collaboration diagram for rutz::assoc_array_base:

The use must provide a pointer to a function that knows how to properly destroy the actual contained objects according to their true type.
Definition at line 48 of file assocarray.h.
Public Types | |
| typedef void( | kill_func_t )(void *) |
| Function type for destroying elements. | |
Public Member Functions | |
| assoc_array_base (kill_func_t *f, const char *descr, bool nocase) | |
| Default constructor. | |
| ~assoc_array_base () | |
| Virtual destructor. | |
| rutz::fstring | get_known_keys (const char *sep) const |
| Get a list of known keys, separated by sep. | |
| void | throw_for_key (const char *key, const rutz::file_pos &pos) const |
| Raise an exception reporting an unknown key. | |
| void | throw_for_key (const rutz::fstring &key, const rutz::file_pos &pos) const |
| Raise an exception reporting an unknown key. | |
| void * | get_value_for_key (const rutz::fstring &name) const |
| Retrieve the object associated with the tag name. | |
| void * | get_value_for_key (const char *name) const |
| Retrieve the object associated with the tag name. | |
| void | set_value_for_key (const char *name, void *ptr) |
| Associate the object at ptr with the tag name. | |
| void | clear () |
| Clear all entries, calling the kill function for each. | |
Classes | |
| struct | impl |
|
|
Function type for destroying elements.
Definition at line 52 of file assocarray.h. |
|
||||||||||||||||
|
Default constructor.
Definition at line 91 of file assocarray.cc. References GVX_TRACE. |
|
|
Virtual destructor.
Definition at line 99 of file assocarray.cc. |
|
|
Clear all entries, calling the kill function for each.
Definition at line 145 of file assocarray.cc. References GVX_TRACE, rutz::assoc_array_base::impl::kill_func, and rutz::assoc_array_base::impl::values. Referenced by ~assoc_array_base(). |
|
|
Get a list of known keys, separated by sep.
Definition at line 106 of file assocarray.cc. References first, and rutz::assoc_array_base::impl::values. Referenced by rutz::assoc_array< rutz::creator_base< base_t > >::get_known_keys(), and throw_for_key(). |
|
|
Retrieve the object associated with the tag name.
Definition at line 165 of file assocarray.cc. References get_value_for_key(). |
|
|
Retrieve the object associated with the tag name.
Definition at line 159 of file assocarray.cc. References GVX_TRACE, and rutz::assoc_array_base::impl::values. Referenced by rutz::assoc_array< rutz::creator_base< base_t > >::get_ptr_for_key(), and get_value_for_key(). |
|
||||||||||||
|
Associate the object at ptr with the tag name.
Definition at line 170 of file assocarray.cc. References GVX_TRACE, rutz::assoc_array_base::impl::kill_func, and rutz::assoc_array_base::impl::values. Referenced by rutz::assoc_array< rutz::creator_base< base_t > >::set_ptr_for_key(). |
|
||||||||||||
|
Raise an exception reporting an unknown key.
Definition at line 140 of file assocarray.cc. References rutz::fstring::c_str(), and throw_for_key(). |
|
||||||||||||
|
Raise an exception reporting an unknown key.
Definition at line 130 of file assocarray.cc. References rutz::fstring::c_str(), get_known_keys(), rutz::assoc_array_base::impl::key_description, and rutz::sfmt(). Referenced by rutz::assoc_array< rutz::creator_base< base_t > >::throw_for_key(), and throw_for_key(). |
1.4.4