Coin  4.0.3
Coin3D core library
Loading...
Searching...
No Matches
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 SoEngineList SoNodeList SoPathList SoChildList

Public Member Functions

 SoBaseList (const int size)
 
 SoBaseList (const SoBaseList &l)
 
 SoBaseList (void)
 
 ~SoBaseList ()
 
void addReferences (const SbBool flag)
 
void append (SoBase *ptr)
 
void copy (const SoBaseList &l)
 
void insert (SoBase *ptr, const int addbefore)
 
SbBool isReferencing (void) const
 
SoBaseListoperator= (const SoBaseList &l)
 
SoBaseoperator[] (const int i) const
 
void remove (const int index)
 
void removeItem (SoBase *item)
 
void set (const int i, SoBase *const ptr)
 
void truncate (const int length)
 
- Public Member Functions inherited from SbPList
 SbPList (const int sizehint=DEFAULTSIZE)
 
 SbPList (const SbPList &l)
 
 ~SbPList ()
 
void append (void *item)
 
void copy (const SbPList &l)
 
int find (const void *item) const
 
void fit (void)
 
voidget (const int index) const
 
void ** getArrayPtr (const int start=0) const
 
int getLength (void) const
 
void insert (void *item, const int insertbefore)
 
int operator!= (const SbPList &l) const
 
SbPListoperator= (const SbPList &l)
 
int operator== (const SbPList &l) const
 
void *& operator[] (const int index) const
 
void remove (const int index)
 
void removeFast (const int index)
 
void removeItem (void *item)
 
void set (const int index, void *item)
 
void truncate (const int length, const int fit=0)
 

Additional Inherited Members

- Protected Member Functions inherited from SbPList
void expand (const int size)
 
int getArraySize (void) const
 

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() [1/3]

SoBaseList::SoBaseList ( void )

Default constructor.

◆ SoBaseList() [2/3]

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() [3/3]

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.

See also
SbPList::SbPList(const SbPList &)

◆ ~SoBaseList()

SoBaseList::~SoBaseList ( )

Destructor. Dereferences items before freeing resources.

Member Function Documentation

◆ addReferences()

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.

◆ append()

void SoBaseList::append ( SoBase * ptr)

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

Overloaded from parent to support reference counting on the SoBase object.

See also
SbPList::append()

◆ copy()

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.

◆ insert()

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

Overloaded from parent to support reference counting on the SoBase object.

See also
SbPList::insert()

◆ isReferencing()

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.

See also
addReferences()
Since
Coin 2.0

◆ operator=()

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

Shallow copy of the SoBase pointers from l into this one, returning a pointer to ourself.

See also
copy()

◆ operator[]()

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

Returns element at index.

Will automatically expand the size of the internal array if index is outside the current bounds of the list. The values of any additional pointers are then set to NULL.

Overloaded from parent to return an SoBase pointer.

See also
SbPList::operator[]()

◆ remove()

void SoBaseList::remove ( const int index)

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

Overloaded from parent to support reference counting on the SoBase object.

See also
SbPList::remove()

◆ removeItem()

void SoBaseList::removeItem ( SoBase * item)

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

Overloaded from parent to support reference counting on the SoBase object.

See also
SbPList::removeItem()

◆ set()

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

Index operator to set element at index. Does not expand array bounds if index is outside the list.

Overloaded from parent to support reference counting on the SoBase object.

See also
SbPList::set(const int idx, void * item)

◆ truncate()

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

Overloaded from parent to support reference counting on the SoBase object.

See also
SbPList::truncate()

The documentation for this class was generated from the following files: