void increaseCount()
| 原型 | void increaseCount() |
| 描述 | 对象个数增加1 |
| 参数 | 无 |
| 返回值 | 无 |
void decreaseCount()
| 原型 | void decreaseCount() |
| 描述 | 对象个数减少1 |
| 参数 | 无 |
| 返回值 |
void add(XMemPool * mem, const T & item)
| 原型 | void add(XMemPool * mem, const T & item) |
| 描述 | 向数组中添加一个对象 |
| 参数 | [i]XMemPool * mem: 内存池 [i] const T & item: 添加的对象 |
| 返回值 | 无 |
void remove(XMemPool * mem, const T & item)
| 原型 | void remove(XMemPool * mem, const T & item) |
| 描述 | 在数组中删除给定对象 |
| 参数 | [i]XMemPool * mem: 内存池 [i] const T & item: 删除的对象 |
| 返回值 | 无 |
void remove(XMemPool * mem, int i)
| 原型 | void remove(XMemPool * mem, int i) |
| 描述 | 删除数组中第i个元素 |
| 参数 | [i]XMemPool * mem: 内存池 [i] int i: 元素索引 |
| 返回值 | 无 |
void removeAll(XMemPool * mem)
| 原型 | void removeAll(XMemPool * mem) |
| 描述 | 删除数组所有对象 |
| 参数 | [i]XMemPool * mem: 内存池 |
| 返回值 | 无 |
int find(const T & item) const
| 原型 | int find(const T & item) const |
| 描述 | 获取元素在数组中的索引序号 |
| 参数 | [i]const T & item: 对象元素 |
| 返回值 | 索引号 |
T & at(int index) const
| 原型 | T & at(int index) const |
| 描述 | 获取第index个元素的对象引用 |
| 参数 | [i]int index: 元素索引号 |
| 返回值 | 对象引用 |
T & operator [] (int index) const
| 原型 | T & operator [] (int index) const |
| 描述 | 获取第index个元素的对象引用 |
| 参数 | [i]int index: 元素索引号 |
| 返回值 | 对象引用 |
int count() const
| 原型 | int count() const |
| 描述 | 获取元素的个数 |
| 参数 | 无 |
| 返回值 | 元素的个数 |
void clear(XMemPool * mem)
| 原型 | void clear(XMemPool * mem) |
| 描述 | 删除数组所有对象,重置数组为最小容量 |
| 参数 | [i]XMemPool * mem: 内存池 |
| 返回值 | 无 |