Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
typedef typename ordered_list::value_type value_type; ///< type of value stored in the list
typedef typename ordered_list::key_comparator key_comparator; ///< key comparing functor
typedef typename ordered_list::disposer disposer; ///< Node disposer functor
+#ifdef CDS_DOXYGEN_INVOKED
typedef typename ordered_list::stat stat; ///< Internal statistics
+#endif
/// Hash functor for \ref value_type and all its derivatives that you use
typedef typename cds::opt::v::hash_selector< typename traits::hash >::type hash;
typedef typename internal_bucket_type::exempt_ptr exempt_ptr; ///< pointer to extracted node
typedef typename internal_bucket_type::raw_ptr raw_ptr; ///< Return type of \p get() member function and its derivatives
+ //@cond
+ typedef typename bucket_stat::stat stat;
+ //@endcond
+
private:
//@cond
- hash m_HashFunctor; ///< Hash functor
- size_t const m_nHashBitmask;
- internal_bucket_type* m_Buckets; ///< bucket table
- item_counter m_ItemCounter; ///< Item counter
- typename bucket_stat::stat m_Stat; ///< Internal statistics
+ hash m_HashFunctor; ///< Hash functor
+ size_t const m_nHashBitmask;
+ internal_bucket_type* m_Buckets; ///< bucket table
+ item_counter m_ItemCounter; ///< Item counter
+ stat m_Stat; ///< Internal statistics
//@endcond
public:
*/
iterator begin()
{
- return iterator( m_Buckets[0].begin(), m_Buckets, m_Buckets + bucket_count() );
+ return iterator( m_Buckets[0].begin(), m_Buckets, m_Buckets + bucket_count());
}
/// Returns an iterator that addresses the location succeeding the last element in a set
*/
iterator end()
{
- return iterator( m_Buckets[bucket_count() - 1].end(), m_Buckets + bucket_count() - 1, m_Buckets + bucket_count() );
+ return iterator( m_Buckets[bucket_count() - 1].end(), m_Buckets + bucket_count() - 1, m_Buckets + bucket_count());
}
/// Returns a forward const iterator addressing the first element in a set
/// Returns a forward const iterator addressing the first element in a set
const_iterator cbegin() const
{
- return const_iterator( m_Buckets[0].cbegin(), m_Buckets, m_Buckets + bucket_count() );
+ return const_iterator( m_Buckets[0].cbegin(), m_Buckets, m_Buckets + bucket_count());
}
/// Returns an const iterator that addresses the location succeeding the last element in a set
/// Returns an const iterator that addresses the location succeeding the last element in a set
const_iterator cend() const
{
- return const_iterator( m_Buckets[bucket_count() - 1].cend(), m_Buckets + bucket_count() - 1, m_Buckets + bucket_count() );
+ return const_iterator( m_Buckets[bucket_count() - 1].cend(), m_Buckets + bucket_count() - 1, m_Buckets + bucket_count());
}
//@}
size_t nMaxItemCount, ///< estimation of max item count in the hash set
size_t nLoadFactor ///< load factor: average size of the bucket
) : m_nHashBitmask( michael_set::details::init_hash_bitmask( nMaxItemCount, nLoadFactor ))
- , m_Buckets( bucket_table_allocator().allocate( bucket_count() ) )
+ , m_Buckets( bucket_table_allocator().allocate( bucket_count()) )
{
for ( auto it = m_Buckets, itEnd = m_Buckets + bucket_count(); it != itEnd; ++it )
construct_bucket<bucket_stat>( it );
for ( auto it = m_Buckets, itEnd = m_Buckets + bucket_count(); it != itEnd; ++it )
it->~internal_bucket_type();
- bucket_table_allocator().deallocate( m_Buckets, bucket_count() );
+ bucket_table_allocator().deallocate( m_Buckets, bucket_count());
}
/// Inserts new node
template <typename Q>
exempt_ptr extract( Q const& key )
{
- exempt_ptr p( bucket( key ).extract( key ) );
+ exempt_ptr p( bucket( key ).extract( key ));
if ( p )
--m_ItemCounter;
return p;
template <typename Q, typename Less>
exempt_ptr extract_with( Q const& key, Less pred )
{
- exempt_ptr p( bucket( key ).extract_with( key, pred ) );
+ exempt_ptr p( bucket( key ).extract_with( key, pred ));
if ( p )
--m_ItemCounter;
return p;