|
Foxit PDF SDK
|
Public 成员函数 | |
| CFX_BaseSegmentedArray (int unit_size=1, int segment_units=512, int index_size=8, IFX_Allocator *pAllocator=0) | |
| 使用指定的单元大小、段单元数和索引级别数进行构造。 更多... | |
| ~CFX_BaseSegmentedArray () | |
| 析构函数。 | |
| void * | Add () |
| 添加一个元素。 更多... | |
| void | Delete (int index, int count=1) |
| 删除一定数量的元素。 更多... | |
| void * | GetAt (int index) const |
| 获取指向元素数据的无类型指针。 更多... | |
| int | GetSegmentSize () const |
| 获取每段中元素的数量。 更多... | |
| int | GetSize () const |
| 获取数组中元素的数量。 更多... | |
| int | GetUnitSize () const |
| 获取每个元素的字节数。 更多... | |
| void * | Iterate (FX_BOOL(*callback)(void *param, void *pData), void *param) const |
| 遍历所有单元,对每个单元执行回调函数。 更多... | |
| void | RemoveAll () |
| 移除数组中的所有元素。 更多... | |
| void | SetUnitSize (int unit_size, int segment_units, int index_size=8) |
| 更改单元大小和段单元数。只能在数组为空时调用。 更多... | |
Public 属性 | |
| IFX_Allocator * | m_pAllocator |
| 特殊分配器指针。NULL表示使用默认分配器。 | |
表示分段分配的可增长数组的类。
| CFX_BaseSegmentedArray::CFX_BaseSegmentedArray | ( | int | unit_size = 1, |
| int | segment_units = 512, |
||
| int | index_size = 8, |
||
| IFX_Allocator * | pAllocator = 0 |
||
| ) |
使用指定的单元大小、段单元数和索引级别数进行构造。
| [in] | unit_size | 指定的单元大小。 |
| [in] | segment_units | 每段中的单元数,必须小于32768。 |
| [in] | index_size | 数组中段的数量(索引级别),必须大于1且小于256。 |
| [in] | pAllocator | 此类中使用的分配器。传入NULL使用默认分配器。 |
| void* CFX_BaseSegmentedArray::Add | ( | ) |
添加一个元素。
| void CFX_BaseSegmentedArray::Delete | ( | int | index, |
| int | count = 1 |
||
| ) |
删除一定数量的元素。
| [in] | index | 指定数组中要删除的起始元素的从零开始的索引。 |
| [in] | count | 指定要删除的元素数量。 |
| void* CFX_BaseSegmentedArray::GetAt | ( | int | index | ) | const |
获取指向元素数据的无类型指针。
| [in] | index | 指定元素的从零开始的索引。 |
|
inline |
获取每段中元素的数量。
|
inline |
获取数组中元素的数量。
|
inline |
获取每个元素的字节数。
| void* CFX_BaseSegmentedArray::Iterate | ( | FX_BOOL(*)(void *param, void *pData) | callback, |
| void * | param | ||
| ) | const |
遍历所有单元,对每个单元执行回调函数。
| [in] | callback | 回调函数。 |
| [in] | param | 参数。 |
| void CFX_BaseSegmentedArray::RemoveAll | ( | ) |
移除数组中的所有元素。
| void CFX_BaseSegmentedArray::SetUnitSize | ( | int | unit_size, |
| int | segment_units, | ||
| int | index_size = 8 |
||
| ) |
更改单元大小和段单元数。只能在数组为空时调用。
| [in] | unit_size | 新的单元大小。 |
| [in] | segment_units | 每段中新的单元数。 |
| [in] | index_size | 新的索引级别数。 |