xrtTypedListInit
初始化、创建、结束或销毁一个拥有类型值的空稀疏列表。
| 参数 | 说明 |
|---|---|
| xtypedlist* pList | 列表对象 |
| const xrttype* pItemType | ItemTye 参数 |
示例已编译验证
typedlistinit obj; xrtTypedListInit(&obj, pList, pItemType);
xrtTypedListCreate
XRT_API xtypedlist* xrtTypedListCreate(const xrttype* pItemType);
示例已编译验证
/* XRT_API xtypedlist* xrtTypedListCreate(const xrttype* pItemType); */ xhandle* h = xrtTypedListCreate();
xrtTypedListUnit
XRT_API void xrtTypedListUnit(xtypedlist* pList);
示例已编译验证
xrtTypedListUnit(obj);
xrtTypedListDestroy
XRT_API void xrtTypedListDestroy(xtypedlist* pList);
示例已编译验证
xrtTypedListDestroy(obj);
xrtTypedListItemType
返回借用元素类型和当前键值数量。
| 参数 | 说明 |
|---|---|
| const xtypedlist* pList | 列表对象 |
示例已编译验证
/* 返回借用元素类型和当前键值数量。 */ result = xrtTypedListItemType(pList);
xrtTypedListCount
XRT_API size_t xrtTypedListCount(const xtypedlist* pList);
示例已编译验证
/* XRT_API size_t xrtTypedListCount(const xtypedlist* pList); */ result = xrtTypedListCount();
xrtTypedListClear
清空全部值,或释放空闲节点池页。
| 参数 | 说明 |
|---|---|
| xtypedlist* pList | 列表对象 |
示例已编译验证
/* 清空全部值,或释放空闲节点池页。 */ result = xrtTypedListClear(pList);
xrtTypedListTrim
XRT_API size_t xrtTypedListTrim(xtypedlist* pList, size_t iRetainEmpty);
示例已编译验证
/* XRT_API size_t xrtTypedListTrim(xtypedlist* pList, size_t iRetainEmpty); */ result = xrtTypedListTrim();
xrtTypedListSet
复制设置指定键,或在最大键后追加并返回实际键。
| 参数 | 说明 |
|---|---|
| xtypedlist* pList | 列表对象 |
| int64 iKey | 键 |
| const void* pItem | 元素 |
示例已编译验证
/* 复制设置指定键,或在最大键后追加并返回实际键。 */ result = xrtTypedListSet(pList, iKey, pItem);
xrtTypedListAppend
XRT_API bool xrtTypedListAppend( xtypedlist* pList, const void* pItem, int64* pKey );
示例已编译验证
/* XRT_API bool xrtTypedListAppend( xtypedlist* pList, const void* pItem, int64* pKey ); */ result = xrtTypedListAppend();
xrtTypedListGet
返回指定键的借用值槽;缺失键是正常结果。
| 参数 | 说明 |
|---|---|
| xtypedlist* pList | 列表对象 |
| int64 iKey | 键 |
示例已编译验证
/* 返回指定键的借用值槽;缺失键是正常结果。 */ result = xrtTypedListGet(pList, iKey);
xrtTypedListConstGet
XRT_API const void* xrtTypedListConstGet( const xtypedlist* pList, int64 iKey );
示例已编译验证
/* XRT_API const void* xrtTypedListConstGet( const xtypedlist* pList, int64 iKey ); */ result = xrtTypedListConstGet();
xrtTypedListHas
XRT_API bool xrtTypedListHas(const xtypedlist* pList, int64 iKey);
示例已编译验证
/* XRT_API bool xrtTypedListHas(const xtypedlist* pList, int64 iKey); */ result = xrtTypedListHas();
xrtTypedListAt
按键顺序返回指定位置的借用值槽和可选实际键。
| 参数 | 说明 |
|---|---|
| xtypedlist* pList | 列表对象 |
| size_t iIndex | 下标 |
| int64* pKey | 键 |
示例已编译验证
/* 按键顺序返回指定位置的借用值槽和可选实际键。 */ result = xrtTypedListAt(pList, iIndex, pKey);
xrtTypedListConstAt
XRT_API const void* xrtTypedListConstAt( const xtypedlist* pList, size_t iIndex, int64* pKey );
示例已编译验证
/* XRT_API const void* xrtTypedListConstAt( const xtypedlist* pList, size_t iIndex, int64* pKey ); */ result = xrtTypedListConstAt();
xrtTypedListRemove
删除指定键,或把值移动到外部已初始化输出后删除。
| 参数 | 说明 |
|---|---|
| xtypedlist* pList | 列表对象 |
| int64 iKey | 键 |
示例已编译验证
/* 删除指定键,或把值移动到外部已初始化输出后删除。 */ result = xrtTypedListRemove(pList, iKey);
xrtTypedListTake
XRT_API bool xrtTypedListTake( xtypedlist* pList, int64 iKey, ptr pValue );
示例已编译验证
/* XRT_API bool xrtTypedListTake( xtypedlist* pList, int64 iKey, ptr pValue ); */ result = xrtTypedListTake();
xrtTypedListFind
查找第一个相等值或判断是否存在;未找到不设置错误。
| 参数 | 说明 |
|---|---|
| const xtypedlist* pList | 列表对象 |
| const void* pItem | 元素 |
| int64* pKey | 键 |
示例已编译验证
/* 查找第一个相等值或判断是否存在;未找到不设置错误。 */ result = xrtTypedListFind(pList, pItem, pKey);
xrtTypedListContains
XRT_API bool xrtTypedListContains( const xtypedlist* pList, const void* pItem );
示例已编译验证
/* XRT_API bool xrtTypedListContains( const xtypedlist* pList, const void* pItem ); */ result = xrtTypedListContains();
xrtTypedListMerge
失败原子地合并同类型列表、深复制列表或比较键值内容。
| 参数 | 说明 |
|---|---|
| xtypedlist* pTarget | 目标 |
| const xtypedlist* pSource | 来源 |
| bool bReplace | 是否替换 |
示例已编译验证
/* 失败原子地合并同类型列表、深复制列表或比较键值内容。 */ result = xrtTypedListMerge(pTarget, pSource, bReplace);
xrtTypedListClone
XRT_API xtypedlist* xrtTypedListClone(const xtypedlist* pList);
示例已编译验证
/* XRT_API xtypedlist* xrtTypedListClone(const xtypedlist* pList); */ result = xrtTypedListClone();
xrtTypedListEquals
XRT_API bool xrtTypedListEquals( const xtypedlist* pLeft, const xtypedlist* pRight );
示例已编译验证
/* XRT_API bool xrtTypedListEquals( const xtypedlist* pLeft, const xtypedlist* pRight ); */ result = xrtTypedListEquals();
xrtTypedListIterBegin
启动完整或有界的正反迭代。
| 参数 | 说明 |
|---|---|
| xtypedlist* pList | 列表对象 |
| xtypedlistiter* pIterator | 迭代器 |
示例已编译验证
/* 启动完整或有界的正反迭代。 */ result = xrtTypedListIterBegin(pList, pIterator);
xrtTypedListIterRBegin
XRT_API bool xrtTypedListIterRBegin( xtypedlist* pList, xtypedlistiter* pIterator );
示例已编译验证
/* XRT_API bool xrtTypedListIterRBegin( xtypedlist* pList, xtypedlistiter* pIterator ); */ result = xrtTypedListIterRBegin();
xrtTypedListIterFrom
XRT_API bool xrtTypedListIterFrom( xtypedlist* pList, int64 iKey, xtypedlistiter* pIterator );
示例已编译验证
/* XRT_API bool xrtTypedListIterFrom( xtypedlist* pList, int64 iKey, xtypedlistiter* pIterator ); */ result = xrtTypedListIterFrom();
xrtTypedListIterRFrom
XRT_API bool xrtTypedListIterRFrom( xtypedlist* pList, int64 iKey, xtypedlistiter* pIterator );
示例已编译验证
/* XRT_API bool xrtTypedListIterRFrom( xtypedlist* pList, int64 iKey, xtypedlistiter* pIterator ); */ result = xrtTypedListIterRFrom();
xrtTypedListIterNext
XRT_API ptr xrtTypedListIterNext( xtypedlistiter* pIterator, int64* pKey );
示例已编译验证
/* XRT_API ptr xrtTypedListIterNext( xtypedlistiter* pIterator, int64* pKey ); */ result = xrtTypedListIterNext();
xrtTypedListIterEnd
XRT_API void xrtTypedListIterEnd(xtypedlistiter* pIterator);
示例已编译验证
/* XRT_API void xrtTypedListIterEnd(xtypedlistiter* pIterator); */ result = xrtTypedListIterEnd();
xrtTypedListTypeValidate
验证对象列表类型描述,并返回其共享实例操作表。
| 参数 | 说明 |
|---|---|
| const xrttype* pType | 类型 |
示例已编译验证
/* 验证对象列表类型描述,并返回其共享实例操作表。 */ result = xrtTypedListTypeValidate(pType);
xrtTypedListInstanceOps
XRT_API const xrtinstanceops* xrtTypedListInstanceOps(void);
示例已编译验证
/* XRT_API const xrtinstanceops* xrtTypedListInstanceOps(void); */ result = xrtTypedListInstanceOps();