1#ifndef COIN_LISTS_SBPLIST_H
2#define COIN_LISTS_SBPLIST_H
36#include <Inventor/SbBasic.h>
41 enum { DEFAULTSIZE = 4 };
44 SbPList(
const int sizehint = DEFAULTSIZE);
53 int find(
const void * item)
const;
54 void insert(
void * item,
const int insertbefore);
56 void remove(
const int index);
66 void *
get(
const int index)
const;
67 void set(
const int index,
void * item);
71 void expand(
const int size);
75 void expandlist(
const int size)
const;
76 void grow(
const int size = -1);
81 void * builtinbuffer[DEFAULTSIZE];
89 if (this->numitems == this->itembuffersize) this->grow();
90 this->itembuffer[this->numitems++] = item;
96#ifdef COIN_EXTRA_DEBUG
97 assert(index >= 0 && index < this->numitems);
99 this->itembuffer[index] = this->itembuffer[--this->numitems];
105 return this->numitems;
111#ifdef COIN_EXTRA_DEBUG
112 assert(length <= this->numitems);
114 this->numitems = length;
115 if (dofit) this->
fit();
121#ifdef COIN_EXTRA_DEBUG
122 assert(start >= 0 && start < this->numitems);
124 return &this->itembuffer[start];
130#ifdef COIN_EXTRA_DEBUG
133 if (index >= this->
getLength()) this->expandlist(index + 1);
134 return this->itembuffer[index];
140 return !(*
this == l);
146 return this->itembuffer[index];
152 this->itembuffer[index] = item;
159 this->numitems = size;
165 return this->itembuffersize;
void ** getArrayPtr(const int start=0) const
Definition lists/SbPList.h:119
void set(const int index, void *item)
Definition lists/SbPList.h:150
void expand(const int size)
Definition lists/SbPList.h:156
void * get(const int index) const
Definition lists/SbPList.h:144
void removeItem(void *item)
Definition SbPList.cpp:253
int operator!=(const SbPList &l) const
Definition lists/SbPList.h:138
void append(void *item)
Definition lists/SbPList.h:87
void remove(const int index)
Definition SbPList.cpp:269
int getLength(void) const
Definition lists/SbPList.h:103
void fit(void)
Definition SbPList.cpp:199
void removeFast(const int index)
Definition lists/SbPList.h:94
void *& operator[](const int index) const
Definition lists/SbPList.h:128
int getArraySize(void) const
Definition lists/SbPList.h:163
SbPList(const int sizehint=DEFAULTSIZE)
Definition SbPList.cpp:144
void truncate(const int length, const int fit=0)
Definition lists/SbPList.h:109
int operator==(const SbPList &l) const
Definition SbPList.cpp:284
SbPList & operator=(const SbPList &l)
Definition SbPList.cpp:183
void insert(void *item, const int insertbefore)
Definition SbPList.cpp:236
int find(const void *item) const
Definition SbPList.cpp:222
void copy(const SbPList &l)
Definition SbPList.cpp:171