#ifndef __CDS_CONTAINER_MICHAEL_MAP_RCU_H
#define __CDS_CONTAINER_MICHAEL_MAP_RCU_H
-#include <cds/container/michael_map_base.h>
+#include <cds/container/details/michael_map_base.h>
#include <cds/details/allocator.h>
namespace cds { namespace container {
typedef typename bucket_type::rcu_lock rcu_lock ; ///< RCU scoped lock
typedef typename bucket_type::exempt_ptr exempt_ptr ; ///< pointer to extracted node
/// Group of \p extract_xxx functions require external locking if underlying ordered list requires that
- static CDS_CONSTEXPR_CONST bool c_bExtractLockExternal = bucket_type::c_bExtractLockExternal;
+ static CDS_CONSTEXPR const bool c_bExtractLockExternal = bucket_type::c_bExtractLockExternal;
protected:
item_counter m_ItemCounter ; ///< Item counter
User-defined functor \p func should guarantee that during changing item's value no any other changes
could be made on this map's item by concurrent threads.
- The user-defined functor can be passed by reference using <tt>boost::ref</tt>
+ The user-defined functor can be passed by reference using \p std::ref
and it is called only if inserting is successful.
The key_type should be constructible from value of type \p K.
however, \p func must guarantee that during changing no any other modifications
could be made on this item by concurrent threads.
- You may pass \p func argument by reference using <tt>boost::ref</tt>.
+ You may pass \p func argument by reference using \p std::ref
The function applies RCU lock internally.
return bRet;
}
-# ifdef CDS_EMPLACE_SUPPORT
/// For key \p key inserts data of type \ref mapped_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
\p key_type should be constructible from type \p K
Returns \p true if inserting successful, \p false otherwise.
-
- The function applies RCU lock internally.
-
- @note This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename K, typename... Args>
bool emplace( K&& key, Args&&... args )
++m_ItemCounter;
return bRet;
}
-# endif
/// Deletes \p key from the map
/** \anchor cds_nonintrusive_MichaelMap_rcu_erase_val
\endcode
where \p item is the item found.
- You may pass \p f argument by reference using <tt>boost::ref</tt> or cds::ref.
+ You may pass \p f argument by reference using \p std::ref.
The functor may change \p item.second. Note that the functor is only guarantee
that \p item cannot be disposed during functor is executing.
/// Finds \p key and return the item found
/** \anchor cds_nonintrusive_MichaelHashMap_rcu_get
The function searches the item with key equal to \p key and returns the pointer to item found.
- If \p key is not found it returns \p NULL.
+ If \p key is not found it returns \p nullptr.
Note the compare functor should accept a parameter of type \p K that can be not the same as \p key_type.