#include <nub/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 |
Definition at line 81 of file objdb.h.
void nub::objectdb::remove | ( | nub::uid | id | ) |
void nub::objectdb::purge | ( | ) |
void nub::objectdb::clear | ( | ) |
void nub::objectdb::clear_on_exit | ( | ) |
nub::object * nub::objectdb::get_checked_obj | ( | nub::uid | id | ) | throw (nub::invalid_uid_error) |
Return the nub::object*
with the uid given by id.
Checks first if id is a valid uid, and throws an nub::invalid_uid_error
if it is not.