![]() |
Home | Libraries | People | FAQ | More |
Boost.Intrusive offers a wide range of intrusive
containers:
Boost.Intrusive 提供了大量的介入式容器:
std::list
like intrusive linked list. The size overhead is quite small for user classes
(usually the size of two pointers). Many operations have constant time complexity.std::list
的介入式鏈表。對於用戶類的空間開銷非常小(通常只有兩個指針的大小)。多數操作具有線性的時間複雜度。
std::set/std::multiset
like intrusive associative containers based on red-black trees. The size
overhead is moderate for user classes (usually the size of three pointers).
Many operations have logarithmic time complexity.std::set/std::multiset 的介入式關聯容器,基於紅黑樹。對於用戶類的空間開銷適中(通常為三個指針的大小)。多數操作具有對數時間複雜度。
std::set/std::multiset like intrusive associative containers
based on AVL trees. The size overhead is moderate for user classes (usually
the size of three pointers). Many operations have logarithmic time complexity.std::set/std::multiset 的介入式關聯容器,基於 AVL 樹。對於用戶類的空間開銷適中(通常為三個指針的大小)。多數操作具有對數時間複雜度。
std::set/std::multiset like intrusive associative containers
based on splay trees. Splay trees have no constant operations, but they have
some interesting caching properties. The size overhead is moderate for user
classes (usually the size of three pointers). Many operations have logarithmic
time complexity.std::set/std::multiset 的介入式關聯容器,基於 splay 樹。splay 樹不具有常量性的操作,不過它有一些有趣的緩存特性。對於用戶類的空間開銷適中(通常為三個指針的大小)。多數操作具有對數時間複雜度。
std::set/std::multiset like intrusive associative containers
based on scapegoat trees. Scapegoat can be configured with the desired balance
factor to achieve the desired rebalancing frequency/search time compromise.
The size overhead is moderate for user classes (usually the size of three
pointers). Many operations have logarithmic time complexity.std::set/std::multiset 的介入式關聯容器,基於 scapegoat 樹。scapegoat 樹可以按所期望的平衡因子來配置,以達到所希望的重新平衡頻度和查找時間之間的折衷。對於用戶類的空間開銷適中(通常為三個指針的大小)。多數操作具有對數時間複雜度。
Boost.Intrusive also offers semi-intrusive
containers:
Boost.Intrusive 還提供了半介入式容器:
std::tr1::unordered_set/std::tr1::unordered_multiset
like intrusive unordered associative containers. The size overhead is moderate
for user classes (an average of two pointers per element). Many operations
have amortized constant time complexity.std::tr1::unordered_set/std::tr1::unordered_multiset 的介入式無序關聯容器。對於用戶類的空間開銷適中(平均為每個元素兩個指針)。多數操作具有分期常量時間複雜度。
Most of these intrusive containers can be configured with constant or linear
time size:
這些介入式容器中的多數可以被配置為帶有常量時間複雜度或線性時間複雜度的 size 函數:
size() function doesn't have constant time complexity.
On the other hand, the container is smaller, and some operations, like splice()
taking a range of iterators in linked lists, have constant time complexity
instead of linear complexity.size() 函數不具有常量時間複雜度。另一方面,容器可以更小,而且某些操作,如接受一個在鏈表中的迭代器區間的 splice(),則具有常量時間複雜度而不是線性複雜度。
size()
function has constant time complexity. On the other hand, increases the size
of the container, and some operations, like splice() taking a range of iterators, have linear
time complexity in linked lists.size() 函數具有常量時間複雜度。另一方面,這增加了容器的大小,而且某些操作,如接受一個在鏈表中的迭代器區間的 splice(),則具有線性複雜度。
To make user classes compatible with these intrusive containers Boost.Intrusive
offers two types of hooks for each container type:
為了讓用戶類兼容於這些介入式容器,Boost.Intrusive 為每種容器類型提供了兩類鉤子:
Apart from that, Boost.Intrusive offers additional
features:
除此以外,Boost.Intrusive 還提供了以下特性:
offset_ptr.
Boost.Intrusive can be configured to use
this smart pointer to allow shared memory intrusive containers.offset_ptr。
Boost.Intrusive 可以被配置為使用此智能指針,就可以使用共享內存介入式容器。