namespace set2 {
- struct std_implementation_tag;
+ struct tag_StdSet;
template <typename Value, typename Hash, typename Less, typename EqualTo, typename Lock,
class Alloc = typename CDS_DEFAULT_ALLOCATOR::template rebind<Value>::other
public:
typedef typename base_class::value_type value_type;
- typedef std_implementation_tag implementation_tag;
- StdHashSet( size_t /*nSetSize*/, size_t /*nLoadFactor*/ )
+ template <class Config>
+ StdHashSet( Config const& )
{}
template <typename Key>
- bool find( const Key& key )
+ bool contains( const Key& key )
{
scoped_lock al( m_lock );
return base_class::find( value_type(key) ) != base_class::end();
}
std::ostream& dump( std::ostream& stm ) { return stm; }
+
+ // for testing
+ static CDS_CONSTEXPR bool const c_bExtractSupported = false;
+ static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false;
+ static CDS_CONSTEXPR bool const c_bEraseExactKey = true;
};
template <typename Value, typename Less, typename Lock,
typedef std::set<Value, Less, Alloc> base_class;
public:
typedef typename base_class::key_type value_type;
- typedef std_implementation_tag implementation_tag;
- StdSet( size_t /*nMapSize*/, size_t /*nLoadFactor*/ )
+ template <class Config>
+ StdSet( Config const& )
{}
template <typename Key>
- bool find( const Key& key )
+ bool contains( const Key& key )
{
value_type v( key );
scoped_lock al( m_lock );
}
std::ostream& dump( std::ostream& stm ) { return stm; }
+
+ // for testing
+ static CDS_CONSTEXPR bool const c_bExtractSupported = false;
+ static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false;
};
template <typename Key, typename Val>
- struct set_type< std_implementation_tag, Key, Val >: public set_type_base< Key, Val >
+ struct set_type< tag_StdSet, Key, Val >: public set_type_base< Key, Val >
{
typedef set_type_base< Key, Val > base_class;
- using base_class::key_val;
- using base_class::compare;
- using base_class::less;
- using base_class::hash;
+ typedef typename base_class::key_val key_val;
+ typedef typename base_class::less less;
+ typedef typename base_class::hash hash;
+ typedef typename base_class::equal_to equal_to;
typedef StdSet< key_val, less, cds::sync::spin > StdSet_Spin;
+ typedef StdSet< key_val, less, std::mutex > StdSet_Mutex;
typedef StdSet< key_val, less, lock::NoLock> StdSet_NoLock;
typedef StdHashSet< key_val, hash, less, equal_to, cds::sync::spin > StdHashSet_Spin;
+ typedef StdHashSet< key_val, hash, less, equal_to, std::mutex > StdHashSet_Mutex;
typedef StdHashSet< key_val, hash, less, equal_to, lock::NoLock > StdHashSet_NoLock;
};