SbList< Type > - Online Linux Manual PageSection : 3
Updated : Mon Jan 25 2021
Source : Version 2.5.0
Note : Coin
NAMESbList< Type > − The SbList class is a template container class for lists.
SYNOPSIS
#include <Inventor/lists/SbList.h>
Public Member FunctionsSbList (const int sizehint=DEFAULTSIZE)
SbList (const SbList< Type > &l)
~SbList ()
void copy (const SbList< Type > &l)
SbList< Type > & operator= (const SbList< Type > &l)
void fit (void)
void append (const Type item)
int find (const Type item) const
void insert (const Type item, const int insertbefore)
void removeItem (const Type item)
void remove (const int index)
void removeFast (const int index)
int getLength (void) const
void truncate (const int length, const int dofit=0)
void push (const Type item)
Type pop (void)
const Type * getArrayPtr (const int start=0) const
Type operator[] (const int index) const
Type & operator[] (const int index)
int operator== (const SbList< Type > &l) const
int operator!= (const SbList< Type > &l) const
Protected Member Functionsvoid expand (const int size)
int getArraySize (void) const
Detailed Description
"template<class Type>
class SbList< Type >" The SbList class is a template container class for lists. SbList is an extension of the Coin library versus the original Open Inventor API. Open Inventor handles most list classes by inheriting the SbPList class, which contains an array of generic void* pointers. By using this template-based class instead, we can share more code and make the list handling code more typesafe. Care has been taken to make sure the list classes which are part of the Open Inventor API to still be compatible with their original interfaces, as derived from the SbPList base class. But if you still bump into any problems when porting your Open Inventor applications, let us know and we'll do our best to sort them out. A feature with this class is that the list object arrays grow dynamically as you append() more items to the list. The actual growing technique used is to double the list size when it becomes too small. There are also other array-related convenience methods; e.g. finding item indices, inserting items at any position, removing items (and shrink the array), copying of arrays, etc. See also SbPList
Constructor & Destructor Documentation
template<class Type > SbList< Type >::SbList (const int sizehint = DEFAULTSIZE) [inline]Default constructor. The sizehint argument hints about how many elements the list will contain, so memory allocation can be done efficiently. Important note: explicitly specifying an sizehint value does not mean that the list will initially contain this number of values. After construction, the list will contain zero items, just as for the default constructor. Here's a good example on how to give yourself hard to find bugs: SbList<SbBool> flags(2); // Assume we need only 2 elements. Note
// that the list is still 0 elements long.
flags[0] = TRUE; // Ouch. List is still 0 elements long.Since this conceptual misunderstanding is so easy to make, you're probably better (or at least safer) off leaving the sizehint argument to its default value by not explicitly specifying it. It improves performance if you know the approximate total size of the list in advance before adding list elements, as the number of reallocations will be minimized.
template<class Type > SbList< Type >::SbList (const SbList< Type > & l) [inline]Copy constructor. Creates a complete copy of the given list. References SbList< Type >::copy().
template<class Type > SbList< Type >::~SbList () [inline]Destructor, frees all internal resources used by the list container.
Member Function Documentation
template<class Type > void SbList< Type >::copy (const SbList< Type > & l) [inline]Make this list a copy of l. References SbList< Type >::expand(). Referenced by SbList< Type >::operator=(), and SbList< Type >::SbList().
template<class Type > SbList< Type > & SbList< Type >::operator= (const SbList< Type > & l) [inline]Make this list a copy of l. References SbList< Type >::copy().
template<class Type > void SbList< Type >::fit (void) [inline]Fit the allocated array exactly around the length of the list, descarding memory spent on unused pre-allocated array cells. You should normally not need or want to call this method, and it is only available for the sake of having the option to optimize memory usage for the unlikely event that you should throw around huge SbList objects within your application. Referenced by SbList< Type >::truncate().
template<class Type > void SbList< Type >::append (const Type item) [inline]Append the item at the end of list, expanding the list array by one. Referenced by SoNodekitCatalog::addEntry(), SoFieldData::addEnumValue(), SoEventCallback::addEventCallback(), SoFieldData::addField(), SoAccumulatedElement::addNodeId(), SoChildList::addPathAuditor(), SbBSPTree::addPoint(), SoDB::addProgressCallback(), SbClip::addVertex(), SbClip::clip(), SoNodekitCatalog::clone(), SoFieldData::copy(), SoBaseKit::copyContents(), SoType::createType(), SoLinearProfile::getTrimCurve(), SoNurbsProfile::getTrimCurve(), SoLinearProfile::getVertices(), SoNurbsProfile::getVertices(), SoOffscreenRenderer::getWriteFiletypeInfo(), SoType::init(), SoEngineOutput::prepareToWrite(), SbList< Type >::push(), SoInteractionKit::readDefaultParts(), SoBaseKit::readInstance(), SoDB::registerHeader(), SoVRMLParent::updateChildList(), and SoAction::usePathCode().
template<class Type > int SbList< Type >::find (const Type item) const [inline]Return index of first occurrence of item in the list, or -1 if item is not present. Referenced by SbList< Type >::removeItem(), SoChildList::removePathAuditor(), and SoDB::removeProgressCallback().
template<class Type > void SbList< Type >::insert (const Type item, const int insertbefore) [inline]Insert item at index insertbefore. insertbefore should not be larger than the current number of items in the list. Referenced by SoSensorManager::insertDelaySensor(), SoSensorManager::insertTimerSensor(), SoInput::openFile(), SoInput::pushFile(), SoInput::setBuffer(), and SoInput::setFilePointer().
template<class Type > void SbList< Type >::removeItem (const Type item) [inline]Removes an item from the list. If there are several items with the same value, removes the item with the lowest index. References SbList< Type >::find(), and SbList< Type >::remove().
template<class Type > void SbList< Type >::remove (const int index) [inline]Remove the item at index, moving all subsequent items downwards one place in the list. Referenced by SoNodekitCatalog::addEntry(), SoInput::closeFile(), SoInput::popFile(), SoEventCallback::removeEventCallback(), SbList< Type >::removeItem(), SoChildList::removePathAuditor(), and SoDB::removeProgressCallback().
template<class Type > void SbList< Type >::removeFast (const int index) [inline]Remove the item at index, moving the last item into its place and truncating the list.
template<class Type > int SbList< Type >::getLength (void) const [inline]Returns number of items in the list. Referenced by SoNodekitCatalog::addEntry(), SoFieldData::addEnumValue(), SoNodekitCatalog::addListItemType(), SbBSPTree::addPoint(), SoInput::checkHeader(), SbClip::clip(), SoNodekitCatalog::clone(), SoInput::closeFile(), SoFieldData::copy(), SoType::createType(), SoBase::destroy(), SoContextHandler::destructingContext(), SoEngineOutput::doneWriting(), SbBSPTree::findClosest(), SoVRMLExtrusion::generatePrimitives(), SoType::getAllDerivedFrom(), SoOutput::getAvailableCompressionMethods(), SoOutput::getCurrentProto(), SoNodekitCatalog::getDefaultType(), SoFieldData::getEnumData(), SoFieldData::getField(), SoFieldData::getIndex(), SoInput::getIVVersion(), SoNodekitCatalog::getListContainerType(), SoNodekitCatalog::getListItemTypes(), SoInput::getLocationString(), SoNodekitCatalog::getName(), SoNodekitCatalog::getNumEntries(), SoFieldData::getNumFields(), SoDB::getNumHeaders(), SoType::getNumTypes(), SbClip::getNumVertices(), SoNodekitCatalog::getParentName(), SoNodekitCatalog::getParentPartNumber(), SoNodekitCatalog::getPartNumber(), SbBSPTree::getPoint(), SoVRMLExtrusion::getPrimitiveCount(), SoNodekitCatalog::getRightSiblingName(), SoNodekitCatalog::getRightSiblingPartNumber(), SoPath::getTail(), SoNodekitCatalog::getType(), SbBSPTree::getUserData(), SoNurbsProfile::getVertices(), SoVRMLExtrusion::GLRender(), SoEventCallback::handleEvent(), SoChildList::insert(), SoSensorManager::insertDelaySensor(), SoSensorManager::insertTimerSensor(), SoNodekitCatalog::isLeaf(), SoNodekitCatalog::isList(), SoNodekitCatalog::isNullByDefault(), SoNodekitCatalog::isPublic(), SoNodekitCatalog::narrowTypes(), SbBSPTree::numPoints(), SoInput::popFile(), SoOutput::popProto(), SoInput::pushFile(), SoFieldData::read(), SoFieldData::readFieldDescriptions(), SoNodekitCatalog::recursiveSearch(), SoChildList::remove(), SoEventCallback::removeEventCallback(), SbBSPTree::removePoint(), SoOutput::reset(), SoChildList::set(), SoInteractionKit::setDefaultOnNonWritingFields(), SoNodekitCatalog::setNullByDefault(), SbBSPTree::setUserData(), SoVRMLParent::updateChildList(), SoAction::usePathCode(), SoPath::write(), SbTesselator::~SbTesselator(), and SoNodekitCatalog::~SoNodekitCatalog().
template<class Type > void SbList< Type >::truncate (const int length, const int fit = 0) [inline]Shorten the list to contain length elements, removing items from index length and onwards. If fit is non-zero, will also shrink the internal size of the allocated array. Note that this is much less efficient than not re-fitting the array size. References SbList< Type >::fit(). Referenced by SbBSPTree::clear(), SoAccumulatedElement::clearNodeIds(), SbClip::clip(), SbBSPTree::findClosest(), SoLinearProfile::getTrimCurve(), SoNurbsProfile::getTrimCurve(), SoLinearProfile::getVertices(), SoNurbsProfile::getVertices(), SoOffscreenRenderer::getWriteFiletypeInfo(), SoEngineOutput::prepareToWrite(), SbClip::reset(), and SoAction::usePathCode().
template<class Type > void SbList< Type >::push (const Type item) [inline]This appends item at the end of the list in the same fashion as append() does. Provided as an abstraction for using the list class as a stack. References SbList< Type >::append().
template<class Type > Type SbList< Type >::pop (void) [inline]Pops off the last element of the list and returns it.
template<class Type > const Type * SbList< Type >::getArrayPtr (const int start = 0) const [inline]Returns pointer to a non-modifiable array of the lists elements. start specifies an index into the array. The caller is not responsible for freeing up the array, as it is just a pointer into the internal array used by the list. Referenced by SoPath::containsPath(), SoContextHandler::destructingContext(), SoEngineOutput::doneWriting(), SoPath::findFork(), SoVRMLExtrusion::generatePrimitives(), SoOutput::getAvailableCompressionMethods(), SbBSPTree::getPointsArrayPtr(), SoLinearProfile::getTrimCurve(), SoNurbsProfile::getTrimCurve(), SoLinearProfile::getVertices(), SoNurbsProfile::getVertices(), SoVRMLExtrusion::GLRender(), SoVRMLParent::updateChildList(), and SoAction::usePathCode().
template<class Type > Type SbList< Type >::operator[] (const int index) const [inline]Returns a copy of item at index.
template<class Type > Type & SbList< Type >::operator[] (const int index) [inline]Returns a reference to item at index.
template<class Type > SbBool SbList< Type >::operator== (const SbList< Type > & l) const [inline]Equality operator. Returns TRUE if this list and l are identical, containing the exact same set of elements.
template<class Type > SbBool SbList< Type >::operator!= (const SbList< Type > & l) const [inline]Inequality operator. Returns TRUE if this list and l are not equal.
template<class Type > void SbList< Type >::expand (const int size) [inline], [protected]Expand the list to contain size items. The new items added at the end have undefined value. Referenced by SbList< Type >::copy().
template<class Type > int SbList< Type >::getArraySize (void) const [inline], [protected]Return number of items there's allocated space for in the array. See also getLength()
AuthorGenerated automatically by Doxygen for Coin from the source code. 0
Johanes Gumabo
Data Size : 54,121 byte
man-SbList.3coin2Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 3 / 199,384
Visitor ID : :
Visitor IP : 18.220.226.147 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.