Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members  

SoBaseList Class Reference

The SoBaseList class is a container for pointers to SoBase derived objects. More...

#include <Inventor/lists/SoBaseList.h>

Inheritance diagram for SoBaseList::

SbPList SbList< void *> SoEngineList SoNodeList SoPathList SoChildList List of all members.

Public Methods

 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 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)

Detailed Description

The SoBaseList class is a container for pointers to SoBase derived objects.

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.


Constructor & Destructor Documentation

SoBaseList::SoBaseList (  void    ) 
 

Default constructor.

SoBaseList::SoBaseList (  const int    size ) 
 

Constructor with a hint about the maximum number of pointers in the list.

See also:
SbPList::SbPList(const int)

SoBaseList::SoBaseList (  const SoBaseList &    l ) 
 

Copy constructor. Copy the items of l into this list, adding to the item reference counts if the reference flag of l is TRUE.

See also:
SbPList::SbPList(const SbPList &)

SoBaseList::~SoBaseList (    ) 
 

Destructor. Dereferences items before freeing resources.


Member Function Documentation

void SoBaseList::append (  SoBase *    ptr ) 
 

Append ptr to list, adding to the reference count of the object (unless addReferences() has been set to FALSE).

See also:
SbPList::append()

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).

See also:
SbPList::insert()

void SoBaseList::remove (  const int    index ) 
 

Removes item at index from the list, dereferencing the object (unless addReferences() has been set to FALSE).

See also:
SbPList::remove()

Reimplemented from SbList.

Reimplemented in SoChildList.

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).

See also:
SbPList::truncate()

Reimplemented in SoChildList.

void SoBaseList::copy (  const SoBaseList &    l ) 
 

Copy the item pointers of l list into this one, first removing all items in this list.

SoBaseList & SoBaseList::operator= (  const SoBaseList &    l ) 
 

Copy l list into this one, returning a pointer to ourself.

See also:
copy()

SoBase * SoBaseList::operator[] (  const int    i )  const
 

Returns item pointer at index i. Overloaded from parent class to cast from the void pointer actually stored.

Reimplemented from SbPList.

Reimplemented in SoEngineList, SoNodeList, and SoPathList.

void SoBaseList::set (  const int    i,
SoBase *const    ptr
) 
 

Set item pointer at index i to ptr. Overloaded from parent class to provide referencing on the SoBase object.

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.


The documentation for this class was generated from the following files:
Generated on Sat Jan 12 11:40:56 2002 for Coin by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001