Foxit PDF SDK
CFX_SegmentedArray< ElementType > 模板类 参考
类 CFX_SegmentedArray< ElementType > 继承关系图:
CFX_BaseSegmentedArray

Public 成员函数

 CFX_SegmentedArray (int segment_units, int index_size=8, IFX_Allocator *pAllocator=0)
 使用指定的段单元数进行构造。 更多...
 
void Add (ElementType data)
 添加一个元素。 更多...
 
ElementType & operator [] (int index)
 下标([])运算符重载。此函数返回由从零开始的索引指定的元素的引用。 更多...
 
- Public 成员函数 继承自 CFX_BaseSegmentedArray
 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 属性 继承自 CFX_BaseSegmentedArray
IFX_Allocatorm_pAllocator
 特殊分配器指针。NULL表示使用默认分配器。
 

详细描述

template<class ElementType>
class CFX_SegmentedArray< ElementType >

表示分段分配的可增长数组模板的类。

构造及析构函数说明

◆ CFX_SegmentedArray()

template<class ElementType >
CFX_SegmentedArray< ElementType >::CFX_SegmentedArray ( int  segment_units,
int  index_size = 8,
IFX_Allocator pAllocator = 0 
)
inline

使用指定的段单元数进行构造。

参数
[in]segment_units每段中的单元数。
[in]index_size数组中的段数。默认值:8。
[in]pAllocator分配器。默认值:NULL

成员函数说明

◆ Add()

template<class ElementType >
void CFX_SegmentedArray< ElementType >::Add ( ElementType  data)
inline

添加一个元素。

参数
[in]data输入元素。
返回
无。

◆ operator []()

template<class ElementType >
ElementType& CFX_SegmentedArray< ElementType >::operator [] ( int  index)
inline

下标([])运算符重载。此函数返回由从零开始的索引指定的元素的引用。

参数
[in]index指定数组中从零开始的索引。
返回
指定元素的引用。