00001 /** \dir src/nub 00002 00003 \brief ref-counted base object class, plus an id<->object database 00004 00005 src/nub provides a base class, nub::object, with intrusive 00006 reference-counting. Objects deriving from nub::object can be stored 00007 in the nub::objectdb, which allows objects to be retrieved given 00008 their unique integer id (nub::uid). This, in turn, provides a basis 00009 for using these integer ids as object handles in a script-language 00010 wrapper of c++ classes and objects. 00011 00012 There are two basic smart pointer classes that can be used with 00013 nub::object; these are nub::ref and nub::soft_ref. The first, 00014 nub::ref, provides a strong guarantee that its pointee will never 00015 be null (this is verified upon construction of the nub::ref, after 00016 which the guarantee can never be lost). The second, nub::soft_ref, 00017 is more flexible in two ways: (1) it can have a null pointee, 00018 allowing for the representation of "no object here" (though it 00019 still verifies that its pointee is non-null upon dereferencing, and 00020 throws an exception if the pointee is null), and (2) it can act as 00021 a weak pointer, that is, one that doesn't prevent its pointee from 00022 being destroyed -- in this case if its pointee is destroyed, the 00023 the nub::soft_ref silently becomes null (but does not "dangle" like 00024 an ordinary pointer would). 00025 00026 */ 00027 00028 /////////////////////////////////////////////////////////////////////// 00029 // 00030 // Copyright (c) 1998-2005 00031 // Rob Peters <rjpeters at usc dot edu> 00032 // 00033 // created: Wed Jul 6 14:15:41 PDT 2005 00034 // commit: $Id: README.dxy 4830 2005-07-06 21:50:21Z rjpeters $ 00035 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/nub/README.dxy $ 00036 // 00037 // -------------------------------------------------------------------- 00038 // 00039 // This file is part of GroovX. 00040 // [http://ilab.usc.edu/rjpeters/groovx/] 00041 // 00042 // GroovX is free software; you can redistribute it and/or modify it 00043 // under the terms of the GNU General Public License as published by 00044 // the Free Software Foundation; either version 2 of the License, or 00045 // (at your option) any later version. 00046 // 00047 // GroovX is distributed in the hope that it will be useful, but 00048 // WITHOUT ANY WARRANTY; without even the implied warranty of 00049 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00050 // General Public License for more details. 00051 // 00052 // You should have received a copy of the GNU General Public License 00053 // along with GroovX; if not, write to the Free Software Foundation, 00054 // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 00055 // 00056 ///////////////////////////////////////////////////////////////////////