
#include <nub/objdb.h>
Collaboration diagram for nub::objectdb:

Definition at line 81 of file objdb.h.
Public Types | |
|
typedef rutz::fwd_iter< object *const > | iterator |
Public Member Functions | |
| virtual | ~objectdb () |
| Virtual destructor. | |
| iterator | objects () const |
| int | count () const throw () |
| Returns the number of valid objects in the database. | |
| bool | is_valid_uid (nub::uid id) const throw () |
| Returns true if 'id' is a valid uid. | |
| void | remove (nub::uid id) |
| Releases the object specified by id, but only if it is unshared. | |
| void | release (nub::uid id) |
| Removes reference to the object with uid id. | |
| void | purge () |
| Releases all unshared objects held in the database. | |
| void | clear () |
Calls purge() repeatedly until no more items can be removed. | |
| void | clear_on_exit () |
| WARNING: should only be called during program exit. | |
| nub::object * | get_checked_obj (nub::uid id) throw (nub::invalid_uid_error) |
Return the nub::object* with the uid given by id. | |
| void | insert_obj (nub::object *obj) |
| Insert a strong reference to obj into the database. | |
| void | insert_obj_weak (nub::object *obj) |
| Insert a weak reference to obj into the database. | |
Static Public Member Functions | |
| static objectdb & | instance () |
| Returns the singleton instance of objectdb. | |
Protected Member Functions | |
| objectdb () | |
| Default constructor makes an empty list. | |
Classes | |
| class | casting_iterator |
| A filtering iterator class; only exposes objects matching a given type. More... | |
| class | impl |
|
|
Default constructor makes an empty list.
Definition at line 310 of file objdb.cc. References GVX_TRACE. |
|
|
Virtual destructor.
Definition at line 316 of file objdb.cc. References GVX_TRACE. |
|
|
Calls This will get rid of items that were only referenced by other items in the list. Definition at line 354 of file objdb.cc. References GVX_TRACE, and nub::objectdb::impl::purge(). |
|
|
WARNING: should only be called during program exit. Does a full clear of all objects held by the objectdb. This breaks the usual semantics of objectdb, since it removes both shared and unshared objects. Definition at line 362 of file objdb.cc. References nub::objectdb::impl::clear_all(), and GVX_TRACE. |
|
|
Returns the number of valid objects in the database.
Definition at line 322 of file objdb.cc. References nub::objectdb::impl::count(), and GVX_TRACE. |
|
|
Return the
Checks first if id is a valid uid, and throws an Definition at line 368 of file objdb.cc. References GVX_TRACE. Referenced by nub::detail::get_checked_item(). |
|
|
Insert a strong reference to obj into the database.
Definition at line 374 of file objdb.cc. References GVX_TRACE, and nub::objectdb::impl::insert_obj(). Referenced by nub::detail::insert_item(). |
|
|
Insert a weak reference to obj into the database.
Definition at line 380 of file objdb.cc. References GVX_TRACE, and nub::objectdb::impl::insert_obj(). Referenced by nub::detail::insert_item(). |
|
|
Returns the singleton instance of objectdb.
Definition at line 292 of file objdb.cc. Referenced by count_all(), dbClear(), dbClearOnExit(), dbPurge(), dbRelease(), find_all(), nub::detail::get_checked_item(), nub::detail::insert_item(), nub::detail::is_valid_uid(), objDelete(), and remove_all(). |
|
|
Returns true if 'id' is a valid uid.
Definition at line 329 of file objdb.cc. References GVX_TRACE. Referenced by nub::detail::is_valid_uid(). |
|
|
Releases all unshared objects held in the database. Since the objects are unshared, they will be destroyed in the process. Definition at line 347 of file objdb.cc. References dbg_eval_nl, GVX_TRACE, and nub::objectdb::impl::purge(). |
|
|
Removes reference to the object with uid id.
Definition at line 341 of file objdb.cc. References GVX_TRACE, and nub::objectdb::impl::release(). |
|
|
Releases the object specified by id, but only if it is unshared. This causes the object to be destroyed since it was unshared. If the object is shared, this operation throws an exception. Definition at line 335 of file objdb.cc. References GVX_TRACE, and nub::objectdb::impl::remove(). Referenced by remove_all(). |
1.4.4