|
cds
1.4.0
|
Expandable bucket table. More...
#include <cds/intrusive/split_list_base.h>
Data Structures | |
| struct | metrics |
| Bucket table metrics. More... | |
Public Types | |
| typedef GC | gc |
| Garbage collector. | |
| typedef Node | node_type |
| Bucket node type. | |
| typedef std::atomic< node_type * > | table_entry |
| Table entry type. | |
| typedef options::memory_model | memory_model |
| Memory model for atomic operations. | |
|
typedef cds::details::Allocator < segment_type, typename options::allocator > | bucket_table_allocator |
| Bucket table allocator. | |
|
typedef cds::details::Allocator < table_entry, typename options::allocator > | segment_allocator |
| Bucket table segment allocator. | |
Public Member Functions | |
| expandable_bucket_table () | |
| Constructs bucket table for 512K buckets. Load factor is 1. | |
| expandable_bucket_table (size_t nItemCount, size_t nLoadFactor) | |
| Constructs. More... | |
| ~expandable_bucket_table () | |
| Destroy bucket table. | |
| node_type * | bucket (size_t nBucket) const |
Returns head node of the bucket nBucket. | |
| void | bucket (size_t nBucket, node_type *pNode) |
Set head node pNode of bucket nBucket. | |
| size_t | capacity () const |
| Returns the capacity of the bucket table. | |
| size_t | load_factor () const |
| Returns the load factor, i.e. average count of items per bucket. | |
Protected Types | |
|
typedef std::atomic < table_entry * > | segment_type |
| Bucket table segment type. | |
Protected Attributes | |
| const metrics | m_metrics |
| Dynamic bucket table metrics. | |
| segment_type * | m_Segments |
| bucket table - array of segments | |
Expandable bucket table.
This bucket table can dynamically grow its capacity when necessary up to maximum bucket count.
Template parameter:
GC - garbage collector usedNode - node type, must be an instantiation of node templateOptions... - optionsOptions are:
opt::allocator - allocator used to allocate bucket table. Default is CDS_DEFAULT_ALLOCATORopt::memory_model - memory model used. Possible types are opt::v::sequential_consistent, opt::v::relaxed_ordering
|
inline |
Constructs.
| nItemCount | Max expected item count in split-ordered list |
| nLoadFactor | Load factor |