nub::object Class Reference

#include <nub/object.h>

Inheritance diagram for nub::object:
Inheritance graph
[legend]
Collaboration diagram for nub::object:
Collaboration graph
[legend]

List of all members.

Public Member Functions

nub::uid id () const throw ()
rutz::fstring real_typename () const
 Returns the typename of the full object.
virtual rutz::fstring obj_typename () const
 Returns the (apparent) typename of the full object.
rutz::fstring unique_name () const
 Returns a short string describing the object by its typename and id.

Protected Member Functions

 object ()
 Default constructor.
virtual ~object () GVX_DTOR_NOTHROW
 Virtual destructor.

Detailed Description

nub::object is a base class for objects that are to be exposed to a scripting language. Associates with each object a unique integer identifier. nub::object's are reference counted for automatic memory management, and are generally passed around via nub::ref's or nub::soft_ref's, which automatically manage the reference count.

Definition at line 64 of file object.h.


Constructor & Destructor Documentation

nub::object::object (  )  [protected]

Default constructor.

Can't have an empty throw() spec here, because ref_counted's constructor might throw (because it has to allocate memory for a nub::ref_counts object).

Definition at line 52 of file object.cc.

nub::object::~object (  )  [protected, virtual]

Virtual destructor.

Definition at line 57 of file object.cc.


Member Function Documentation

nub::uid nub::object::id (  )  const throw ()

Returns the unique id for this object. The unique id will always be strictly positive; zero is always an invalid unique id.

Definition at line 62 of file object.cc.

rutz::fstring nub::object::obj_typename (  )  const [virtual]

Returns the (apparent) typename of the full object.

The default implementation just returns real_typename(). However, certain kinds of objects -- e.g., proxy objects -- might usefully choose to have obj_typename() return something besides the real_typename(), in order to masquerade as a different type of object.

Definition at line 73 of file object.cc.

References real_typename().

Referenced by ModelComponent::start(), ModelComponent::stop(), and unique_name().

rutz::fstring nub::object::real_typename (  )  const

Returns the typename of the full object.

The result is a demangled version of typeid(*this).name(), which should very closely resemble the way the object was declared in source code.

Definition at line 67 of file object.cc.

References rutz::demangled_name().

Referenced by obj_typename().

rutz::fstring nub::object::unique_name (  )  const

Returns a short string describing the object by its typename and id.

Definition at line 79 of file object.cc.

References obj_typename(), and rutz::sfmt().

Referenced by nub::logging::add_obj_scope(), and nub::logging::remove_obj_scope().


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:44:40 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3