.TH "SbPList" 3 "Tue Dec 26 2023 17:59:22" "Version 4.0.2" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SbPList \- The \fBSbPList\fP class is a container class for void pointers\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherited by \fBSbIntList\fP, \fBSbStringList\fP, \fBSbVec3fList\fP, \fBSoActionMethodList\fP, \fBSoAuditorList\fP\fC [private]\fP, \fBSoBaseList\fP, \fBSoDetailList\fP, \fBSoEngineOutputList\fP, \fBSoFieldList\fP, \fBSoPickedPointList\fP, and \fBSoTypeList\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBSbPList\fP (\fBconst\fP int \fBsizehint\fP=DEFAULTSIZE)" .br .ti -1c .RI "\fBSbPList\fP (\fBconst\fP \fBSbPList\fP &\fBl\fP)" .br .ti -1c .RI "\fB~SbPList\fP ()" .br .ti -1c .RI "\fBvoid\fP \fBcopy\fP (\fBconst\fP \fBSbPList\fP &\fBl\fP)" .br .ti -1c .RI "\fBSbPList\fP & \fBoperator=\fP (\fBconst\fP \fBSbPList\fP &\fBl\fP)" .br .ti -1c .RI "\fBvoid\fP \fBfit\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvoid\fP \fBappend\fP (\fBvoid\fP *\fBitem\fP)" .br .ti -1c .RI "int \fBfind\fP (\fBconst\fP \fBvoid\fP *\fBitem\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBinsert\fP (\fBvoid\fP *\fBitem\fP, \fBconst\fP int \fBinsertbefore\fP)" .br .ti -1c .RI "\fBvoid\fP \fBremoveItem\fP (\fBvoid\fP *\fBitem\fP)" .br .ti -1c .RI "\fBvoid\fP \fBremove\fP (\fBconst\fP int index)" .br .ti -1c .RI "\fBvoid\fP \fBremoveFast\fP (\fBconst\fP int index)" .br .ti -1c .RI "int \fBgetLength\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBtruncate\fP (\fBconst\fP int length, \fBconst\fP int \fBfit\fP=0)" .br .ti -1c .RI "\fBvoid\fP ** \fBgetArrayPtr\fP (\fBconst\fP int start=0) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP *& \fBoperator[]\fP (\fBconst\fP int index) \fBconst\fP" .br .ti -1c .RI "int \fBoperator==\fP (\fBconst\fP \fBSbPList\fP &\fBl\fP) \fBconst\fP" .br .ti -1c .RI "int \fBoperator!=\fP (\fBconst\fP \fBSbPList\fP &\fBl\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP * \fBget\fP (\fBconst\fP int index) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBset\fP (\fBconst\fP int index, \fBvoid\fP *\fBitem\fP)" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "\fBvoid\fP \fBexpand\fP (\fBconst\fP int size)" .br .ti -1c .RI "int \fBgetArraySize\fP (\fBvoid\fP) \fBconst\fP" .br .in -1c .SH "Detailed Description" .PP The \fBSbPList\fP class is a container class for void pointers\&. .SH "Constructor & Destructor Documentation" .PP .SS "SbPList::SbPList (\fBconst\fP int sizehint = \fCDEFAULTSIZE\fP)" This constructor initializes the internal allocated size for the list to \fIsizehint\fP\&. Note that the list will still initially contain zero items\&. .PP Default constructor\&. .SS "SbPList::SbPList (\fBconst\fP \fBSbPList\fP & l)" Copy constructor\&. .SS "SbPList::~SbPList ()" Destructor\&. .SH "Member Function Documentation" .PP .SS "\fBvoid\fP SbPList::copy (\fBconst\fP \fBSbPList\fP & l)" Make this list a copy of \fIl\fP\&. .SS "\fBSbPList\fP & SbPList::operator= (\fBconst\fP \fBSbPList\fP & l)" Assignment operator .SS "\fBvoid\fP SbPList::fit (\fBvoid\fP)" Fit the allocated array exactly around the length of the list, discarding memory spent on unused pre-allocated array cells\&. .PP 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 \fBSbList\fP objects within your application\&. .SS "\fBvoid\fP SbPList::append (\fBvoid\fP * item)\fC [inline]\fP" Append \fIitem\fP to the end of the list\&. .PP Automatically allocates more items internally if needed\&. .SS "int SbPList::find (\fBconst\fP \fBvoid\fP * item) const" Return index of first occurrence of \fIitem\fP in the list, or -1 if \fIitem\fP is not present\&. .SS "\fBvoid\fP SbPList::insert (\fBvoid\fP * item, \fBconst\fP int insertbefore)" Insert \fIitem\fP at index \fIinsertbefore\fP\&. .PP \fIinsertbefore\fP should not be larger than the current number of items in the list\&. .SS "\fBvoid\fP SbPList::removeItem (\fBvoid\fP * item)" Removes an \fIitem\fP from the list\&. If there are several items with the same value, removes the \fIitem\fP with the lowest index\&. .SS "\fBvoid\fP SbPList::remove (\fBconst\fP int index)" Remove the item at \fIindex\fP, moving all subsequent items downwards one place in the list\&. .SS "\fBvoid\fP SbPList::removeFast (\fBconst\fP int index)\fC [inline]\fP" Remove the item at \fIindex\fP, moving the last item into its place and truncating the list\&. .SS "int SbPList::getLength (\fBvoid\fP) const\fC [inline]\fP" Returns number of items in the list\&. .SS "\fBvoid\fP SbPList::truncate (\fBconst\fP int length, \fBconst\fP int fit = \fC0\fP)\fC [inline]\fP" Shorten the list to contain \fIlength\fP elements, removing items from \fIindex\fP \fIlength\fP and onwards\&. .PP If \fIfit\fP 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\&. .SS "\fBvoid\fP ** SbPList::getArrayPtr (\fBconst\fP int start = \fC0\fP) const\fC [inline]\fP" Returns pointer to a non-modifiable array of the lists elements\&. \fIstart\fP specifies an index into the array\&. .PP The caller is \fInot\fP responsible for freeing up the array, as it is just a pointer into the internal array used by the list\&. .SS "\fBvoid\fP *& SbPList::operator[] (\fBconst\fP int index) const\fC [inline]\fP" Returns element at \fIindex\fP\&. .PP Will automatically expand the size of the internal array if \fIindex\fP is outside the current bounds of the list\&. The values of any additional pointers are then set to \fCNULL\fP\&. .SS "int SbPList::operator== (\fBconst\fP \fBSbPList\fP & l) const" Equality operator\&. Returns \fCTRUE\fP if this list and \fIl\fP are identical, containing the exact same ordered set of elements\&. .SS "SbBool SbPList::operator!= (\fBconst\fP \fBSbPList\fP & l) const\fC [inline]\fP" Inequality operator\&. Returns \fCTRUE\fP if this list and \fIl\fP are not equal\&. .SS "\fBvoid\fP * SbPList::get (\fBconst\fP int index) const\fC [inline]\fP" Returns element at \fIindex\fP\&. Does \fInot\fP expand array bounds if \fIindex\fP is outside the list\&. .SS "\fBvoid\fP SbPList::set (\fBconst\fP int index, \fBvoid\fP * item)\fC [inline]\fP" Index operator to set element at \fIindex\fP\&. Does \fInot\fP expand array bounds if \fIindex\fP is outside the list\&. .SS "\fBvoid\fP SbPList::expand (\fBconst\fP int size)\fC [inline]\fP, \fC [protected]\fP" Expand the list to contain \fIsize\fP items\&. The new items added at the end have undefined value\&. .SS "int SbPList::getArraySize (\fBvoid\fP) const\fC [inline]\fP, \fC [protected]\fP" Return number of items there's allocated space for in the array\&. .PP \fBSee also\fP .RS 4 \fBgetLength()\fP .RE .PP .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.