20 bool Reserve(
int num);
23 bool Add(
void *data,
int index);
24 void Set(
void *data,
int index);
25 void *Get(
int index)
const;
26 void *operator [] (
int index)
const {
return Get(index); }
27 void *RemoveFast(
int index);
28 void *Remove(
int index);
30 void Swap(
int index1,
int index2);
31 int Find(
void *data)
const;
32 int GetNumItems()
const {
return m_data ? m_data->num : 0; }
33 int GetCapacity()
const {
return m_data ? m_data->capacity : 0; }
51 bool Reserve(
int num) {
return m_list.Reserve(num); }
59 bool Add(T *data) {
return m_list.Add(data); }
62 bool Add(T *data,
int index) {
return m_list.Add(data, index); }
65 void Set(T *data,
int index) { m_list.Set(data, index); }
68 T *
Get(
int index)
const {
return (T *) m_list.Get(index); }
71 T *
operator [] (
int index)
const {
return (T *) m_list.Get(index); }
76 T *
RemoveFast(
int index) {
return (T *) m_list.RemoveFast(index); }
79 T *
Remove(
int index) {
return (T *) m_list.Remove(index); }
84 void DeleteFast(
int index) {
delete (T *) m_list.RemoveFast(index); }
87 void Delete(
int index) {
delete (T *) m_list.Remove(index); }
101 void Swap(
int index1,
int index2) { m_list.Swap(index1, index2); }
104 int Find(T *data)
const {
return m_list.Find(data); }
int GetCapacity() const
Get the capacity of the list number of items it can hold without allocating more memory) ...
Definition: tb_list.h:110
TBList is a list (array) of pointers to any kind of objects.
Definition: tb_list.h:15
bool Add(T *data)
Add data at the end of the list.
Definition: tb_list.h:59
void RemoveAll()
Remove all items without deleding them.
Definition: tb_list.h:90
T * RemoveFast(int index)
Remove the item at position index from the list and returns the pointer.
Definition: tb_list.h:76
int GetNumItems() const
Get the number of items in the list.
Definition: tb_list.h:107
bool Reserve(int num)
Make sure there is space for at least num items in the list.
Definition: tb_list.h:51
bool GrowIfNeeded()
Make sure there is space for at least one more item in the list.
Definition: tb_list.h:56
void Delete(int index)
Deletes the item at position index after removing it from the list.
Definition: tb_list.h:87
T * Get(int index) const
Returns the content at position index.
Definition: tb_list.h:68
T * Remove(int index)
Remove the item at position index from the list and returns the pointer.
Definition: tb_list.h:79
TBListAutoDeleteOf is a list (array) of pointers to the specified object type.
Definition: tb_list.h:118
bool Add(T *data, int index)
Add data at the given index in the list.
Definition: tb_list.h:62
int Find(T *data) const
Search for the item with the given data and return the found index, or -1 if not found.
Definition: tb_list.h:104
void Swap(int index1, int index2)
Swap the items at index1 and index2.
Definition: tb_list.h:101
void Set(T *data, int index)
Replace the item at the index with the new data.
Definition: tb_list.h:65
void DeleteAll()
Remove and delete all items from the list.
Definition: tb_list.h:93
TBListOf is a list (array) of pointers to the specified object type.
Definition: tb_list.h:47
void DeleteFast(int index)
Deletes the item at position index after removing it from the list.
Definition: tb_list.h:84
T * operator[](int index) const
Returns the content at position index.
Definition: tb_list.h:71