![]() |
http://www.sim.no http://www.coin3d.org |
The additional capability of the SoBaseList class over its parent class, SbPList, is to automatically handle referencing and dereferencing of items as they are added or removed from the lists. More...
#include <Inventor/lists/SoBaseList.h>
Public Member Functions | |
SoBaseList (void) | |
SoBaseList (const int size) | |
SoBaseList (const SoBaseList &l) | |
~SoBaseList () | |
void | append (SoBase *ptr) |
void | insert (SoBase *ptr, const int addbefore) |
void | remove (const int index) |
void | removeItem (SoBase *item) |
void | truncate (const int length) |
void | copy (const SoBaseList &l) |
SoBaseList & | operator= (const SoBaseList &l) |
SoBase * | operator[] (const int i) const |
void | set (const int i, SoBase *const ptr) |
void | addReferences (const SbBool flag) |
SbBool | isReferencing (void) const |
The additional capability of the SoBaseList class over its parent class, SbPList, is to automatically handle referencing and dereferencing of items as they are added or removed from the lists.
SoBaseList::SoBaseList | ( | void | ) |
Default constructor.
SoBaseList::SoBaseList | ( | const int | size | ) |
Constructor with a hint about the maximum number of pointers in the list.
SoBaseList::SoBaseList | ( | const SoBaseList & | l | ) |
Copy constructor.
Shallow copy the items of l into this list, adding to the item reference counts if the reference flag of l is TRUE
.
References SbPList::getLength(), and referencing.
SoBaseList::~SoBaseList | ( | ) |
Destructor. Dereferences items before freeing resources.
References truncate().
void SoBaseList::append | ( | SoBase * | ptr | ) |
Append ptr to list, adding to the reference count of the object (unless addReferences() has been set to FALSE
).
References SoBase::ref().
Referenced by copy(), and SoBase::getNamedBases().
void SoBaseList::insert | ( | SoBase * | ptr, | |
const int | addbefore | |||
) |
Insert ptr in the list at position addbefore, adding to the reference count of the object (unless addReferences() has been set to FALSE
).
References SoBase::ref().
void SoBaseList::remove | ( | const int | index | ) |
Removes item at index from the list, dereferencing the object (unless addReferences() has been set to FALSE
).
Reimplemented from SbPList.
Reimplemented in SoChildList.
References SbPList::getLength().
Referenced by SoSelection::removePath().
void SoBaseList::removeItem | ( | SoBase * | item | ) |
Removes item from the list, dereferencing the object (unless addReferences() has been set to FALSE
).
References SbPList::find().
void SoBaseList::truncate | ( | const int | length | ) |
Makes the list contain only the length first items, removing all items from index length and onwards to the end of the list. Dereferences the objects to be removed (unless addReferences() has been set to FALSE
).
Reimplemented in SoChildList.
References SbPList::getLength().
Referenced by SoAction::apply(), SoSearchAction::beginTraversal(), copy(), SoSearchAction::reset(), and ~SoBaseList().
void SoBaseList::copy | ( | const SoBaseList & | l | ) |
Shallow copy of the item pointers of l list into this one, first removing all items in this list.
References append(), SbPList::getLength(), referencing, and truncate().
Referenced by SoInteractionKit::isPathSurrogateInMySubgraph(), SoPathList::operator=(), SoNodeList::operator=(), SoEngineList::operator=(), and operator=().
SoBaseList & SoBaseList::operator= | ( | const SoBaseList & | l | ) |
SoBase * SoBaseList::operator[] | ( | const int | idx | ) | const |
Returns element at idx.
Will automatically expand the size of the internal array if idx is outside the current bounds of the list. The values of any additional pointers are then set to NULL
.
Reimplemented from SbPList.
Reimplemented in SoEngineList, SoNodeList, and SoPathList.
void SoBaseList::set | ( | const int | i, | |
SoBase *const | ptr | |||
) |
Index operator to set element at i. Does not expand array bounds if i is outside the list.
References SoBase::ref().
Referenced by SoBaseKit::readInstance().
void SoBaseList::addReferences | ( | const SbBool | flag | ) |
Decide whether or not the SoBase items should be automatically referenced and dereferenced as they are added and removed from the list.
Default setting is to do referencing.
References SbPList::getLength(), SoBase::ref(), and SoBase::unref().
SbBool SoBaseList::isReferencing | ( | void | ) | const |
Return whether the SoBase instances are automatically referenced and dereferenced when they are added and removed from the list.
This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.
Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.
Generated on Mon Feb 23 16:33:44 2009 for Coin by Doxygen. 1.5.8