xrtTypedSetInit
初始化、创建、结束或销毁一个拥有类型值的空集合。
| 参数 | 说明 |
|---|---|
| xtypedset* pSet | 集合对象 |
| const xrttype* pItemType | ItemTye 参数 |
示例已编译验证
typedsetinit obj; xrtTypedSetInit(&obj, pSet, pItemType);
xrtTypedSetCreate
XRT_API xtypedset* xrtTypedSetCreate(const xrttype* pItemType);
示例已编译验证
/* XRT_API xtypedset* xrtTypedSetCreate(const xrttype* pItemType); */ xhandle* h = xrtTypedSetCreate();
xrtTypedSetUnit
XRT_API void xrtTypedSetUnit(xtypedset* pSet);
示例已编译验证
xrtTypedSetUnit(obj);
xrtTypedSetDestroy
XRT_API void xrtTypedSetDestroy(xtypedset* pSet);
示例已编译验证
xrtTypedSetDestroy(obj);
xrtTypedSetItemType
返回借用元素类型、当前元素数和再次扩容前的容量。
| 参数 | 说明 |
|---|---|
| const xtypedset* pSet | 集合对象 |
示例已编译验证
/* 返回借用元素类型、当前元素数和再次扩容前的容量。 */ result = xrtTypedSetItemType(pSet);
xrtTypedSetCount
XRT_API size_t xrtTypedSetCount(const xtypedset* pSet);
示例已编译验证
/* XRT_API size_t xrtTypedSetCount(const xtypedset* pSet); */ result = xrtTypedSetCount();
xrtTypedSetCapacity
XRT_API size_t xrtTypedSetCapacity(const xtypedset* pSet);
示例已编译验证
/* XRT_API size_t xrtTypedSetCapacity(const xtypedset* pSet); */ result = xrtTypedSetCapacity();
xrtTypedSetClear
清空、预留或裁剪集合存储。
| 参数 | 说明 |
|---|---|
| xtypedset* pSet | 集合对象 |
示例已编译验证
/* 清空、预留或裁剪集合存储。 */ result = xrtTypedSetClear(pSet);
xrtTypedSetReserve
XRT_API bool xrtTypedSetReserve(xtypedset* pSet, size_t iCapacity);
示例已编译验证
/* XRT_API bool xrtTypedSetReserve(xtypedset* pSet, size_t iCapacity); */ result = xrtTypedSetReserve();
xrtTypedSetTrim
XRT_API bool xrtTypedSetTrim(xtypedset* pSet);
示例已编译验证
/* XRT_API bool xrtTypedSetTrim(xtypedset* pSet); */ result = xrtTypedSetTrim();
xrtTypedSetGetOrAdd
返回已有或失败原子地复制加入的只读规范值。
| 参数 | 说明 |
|---|---|
| xtypedset* pSet | 集合对象 |
| const void* pItem | 元素 |
| bool* pNew | New 参数 |
示例已编译验证
/* 返回已有或失败原子地复制加入的只读规范值。 */ result = xrtTypedSetGetOrAdd(pSet, pItem, pNew);
xrtTypedSetAdd
XRT_API bool xrtTypedSetAdd(xtypedset* pSet, const void* pItem);
示例已编译验证
/* XRT_API bool xrtTypedSetAdd(xtypedset* pSet, const void* pItem); */ result = xrtTypedSetAdd();
xrtTypedSetGet
返回或判断等价规范值;缺失是正常结果。
| 参数 | 说明 |
|---|---|
| const xtypedset* pSet | 集合对象 |
| const void* pItem | 元素 |
示例已编译验证
/* 返回或判断等价规范值;缺失是正常结果。 */ result = xrtTypedSetGet(pSet, pItem);
xrtTypedSetHas
XRT_API bool xrtTypedSetHas( const xtypedset* pSet, const void* pItem );
示例已编译验证
/* XRT_API bool xrtTypedSetHas( const xtypedset* pSet, const void* pItem ); */ result = xrtTypedSetHas();
xrtTypedSetRemove
删除等价值,或把规范值移动到外部已初始化输出后删除。
| 参数 | 说明 |
|---|---|
| xtypedset* pSet | 集合对象 |
| const void* pItem | 元素 |
示例已编译验证
/* 删除等价值,或把规范值移动到外部已初始化输出后删除。 */ result = xrtTypedSetRemove(pSet, pItem);
xrtTypedSetTake
XRT_API bool xrtTypedSetTake( xtypedset* pSet, const void* pItem, ptr pValue );
示例已编译验证
/* XRT_API bool xrtTypedSetTake( xtypedset* pSet, const void* pItem, ptr pValue ); */ result = xrtTypedSetTake();
xrtTypedSetAt
按插入顺序返回指定位置的只读规范值,复杂度为 O(n)。
| 参数 | 说明 |
|---|---|
| const xtypedset* pSet | 集合对象 |
| size_t iIndex | 下标 |
示例已编译验证
/* 按插入顺序返回指定位置的只读规范值,复杂度为 O(n)。 */ result = xrtTypedSetAt(pSet, iIndex);
xrtTypedSetIterBegin
启动按插入顺序或逆序的外置迭代。
| 参数 | 说明 |
|---|---|
| xtypedset* pSet | 集合对象 |
| xtypedsetiter* pIterator | 迭代器 |
示例已编译验证
/* 启动按插入顺序或逆序的外置迭代。 */ result = xrtTypedSetIterBegin(pSet, pIterator);
xrtTypedSetIterRBegin
XRT_API bool xrtTypedSetIterRBegin( xtypedset* pSet, xtypedsetiter* pIterator );
示例已编译验证
/* XRT_API bool xrtTypedSetIterRBegin( xtypedset* pSet, xtypedsetiter* pIterator ); */ result = xrtTypedSetIterRBegin();
xrtTypedSetIterNext
XRT_API const void* xrtTypedSetIterNext(xtypedsetiter* pIterator);
示例已编译验证
/* XRT_API const void* xrtTypedSetIterNext(xtypedsetiter* pIterator); */ result = xrtTypedSetIterNext();
xrtTypedSetIterEnd
XRT_API void xrtTypedSetIterEnd(xtypedsetiter* pIterator);
示例已编译验证
/* XRT_API void xrtTypedSetIterEnd(xtypedsetiter* pIterator); */ result = xrtTypedSetIterEnd();
xrtTypedSetMerge
事务合并同类型集合,并深复制创建独立集合。
| 参数 | 说明 |
|---|---|
| xtypedset* pTarget | 目标 |
| const xtypedset* pSource | 来源 |
示例已编译验证
/* 事务合并同类型集合,并深复制创建独立集合。 */ result = xrtTypedSetMerge(pTarget, pSource);
xrtTypedSetClone
XRT_API xtypedset* xrtTypedSetClone(const xtypedset* pSet);
示例已编译验证
/* XRT_API xtypedset* xrtTypedSetClone(const xtypedset* pSet); */ result = xrtTypedSetClone();
xrtTypedSetUnion
创建两个同类型集合的并、交、差或对称差。
| 参数 | 说明 |
|---|---|
| const xtypedset* pLeft | 左操作数 |
| const xtypedset* pRight | 右操作数 |
示例已编译验证
/* 创建两个同类型集合的并、交、差或对称差。 */ result = xrtTypedSetUnion(pLeft, pRight);
xrtTypedSetIntersection
XRT_API xtypedset* xrtTypedSetIntersection( const xtypedset* pLeft, const xtypedset* pRight );
示例已编译验证
/* XRT_API xtypedset* xrtTypedSetIntersection( const xtypedset* pLeft, const xtypedset* pRight ); */ result = xrtTypedSetIntersection();
xrtTypedSetDifference
XRT_API xtypedset* xrtTypedSetDifference( const xtypedset* pLeft, const xtypedset* pRight );
示例已编译验证
/* XRT_API xtypedset* xrtTypedSetDifference( const xtypedset* pLeft, const xtypedset* pRight ); */ result = xrtTypedSetDifference();
xrtTypedSetSymmetricDifference
XRT_API xtypedset* xrtTypedSetSymmetricDifference( const xtypedset* pLeft, const xtypedset* pRight );
示例已编译验证
/* XRT_API xtypedset* xrtTypedSetSymmetricDifference( const xtypedset* pLeft, const xtypedset* pRight ); */ result = xrtTypedSetSymmetricDifference();
xrtTypedSetIsSubset
判断同类型集合的包含、相离或相等关系。
| 参数 | 说明 |
|---|---|
| const xtypedset* pLeft | 左操作数 |
| const xtypedset* pRight | 右操作数 |
| bool bProper | 严格子集 |
示例已编译验证
/* 判断同类型集合的包含、相离或相等关系。 */ result = xrtTypedSetIsSubset(pLeft, pRight, bProper);
xrtTypedSetIsSuperset
XRT_API bool xrtTypedSetIsSuperset( const xtypedset* pLeft, const xtypedset* pRight, bool bProper );
示例已编译验证
/* XRT_API bool xrtTypedSetIsSuperset( const xtypedset* pLeft, const xtypedset* pRight, bool bProper ); */ result = xrtTypedSetIsSuperset();
xrtTypedSetIsDisjoint
XRT_API bool xrtTypedSetIsDisjoint( const xtypedset* pLeft, const xtypedset* pRight );
示例已编译验证
/* XRT_API bool xrtTypedSetIsDisjoint( const xtypedset* pLeft, const xtypedset* pRight ); */ result = xrtTypedSetIsDisjoint();
xrtTypedSetEquals
XRT_API bool xrtTypedSetEquals( const xtypedset* pLeft, const xtypedset* pRight );
示例已编译验证
/* XRT_API bool xrtTypedSetEquals( const xtypedset* pLeft, const xtypedset* pRight ); */ result = xrtTypedSetEquals();
xrtTypedSetTypeValidate
验证对象集合类型描述,并返回其共享实例操作表。
| 参数 | 说明 |
|---|---|
| const xrttype* pType | 类型 |
示例已编译验证
/* 验证对象集合类型描述,并返回其共享实例操作表。 */ result = xrtTypedSetTypeValidate(pType);
xrtTypedSetInstanceOps
XRT_API const xrtinstanceops* xrtTypedSetInstanceOps(void);
示例已编译验证
/* XRT_API const xrtinstanceops* xrtTypedSetInstanceOps(void); */ result = xrtTypedSetInstanceOps();