00001 /* 00002 * SafeHashSet.hpp 00003 * 00004 * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. 00005 * 00006 * Oracle is a registered trademarks of Oracle Corporation and/or its 00007 * affiliates. 00008 * 00009 * This software is the confidential and proprietary information of Oracle 00010 * Corporation. You shall not disclose such confidential and proprietary 00011 * information and shall use it only in accordance with the terms of the 00012 * license agreement you entered into with Oracle. 00013 * 00014 * This notice may not be removed or altered. 00015 */ 00016 #ifndef COH_SAFE_HASH_SET_HPP 00017 #define COH_SAFE_HASH_SET_HPP 00018 00019 #include "coherence/lang.ns" 00020 00021 #include "coherence/util/MappedSet.hpp" 00022 00023 COH_OPEN_NAMESPACE2(coherence,util) 00024 00025 /** 00026 * A thread-safe Set implementation which is backed by a SafeHashMap. 00027 * 00028 * @author lh 2012.08.23 00029 * @since Coherence 12.1.2 00030 */ 00031 class COH_EXPORT SafeHashSet 00032 : public cloneable_spec<SafeHashSet, 00033 extends<MappedSet> > 00034 { 00035 friend class factory<SafeHashSet>; 00036 00037 // ----- constructors --------------------------------------------------- 00038 00039 protected: 00040 /** 00041 * Default constructor. 00042 */ 00043 SafeHashSet(); 00044 00045 /** 00046 * Construct a thread-safe hash set using the specified settings. 00047 * 00048 * @param cInitialBuckets the initial number of hash buckets, 00049 * 0 < n 00050 * @param flLoadFactor the acceptable load factor before resizing 00051 * occurs, 0 < n, such that a load factor 00052 * of 1.0 causes resizing when the number of 00053 * entries exceeds the number of buckets 00054 * @param flGrowthRate the rate of bucket growth when a resize 00055 * occurs, 0 < n, such that a growth rate 00056 * of 1.0 will double the number of buckets: 00057 * bucketcount = bucketcount * (1 + growthrate) 00058 */ 00059 SafeHashSet(size32_t cInitialBuckets, float32_t flLoadFactor, 00060 float32_t flGrowthRate); 00061 00062 /** 00063 * Copy constructor. 00064 */ 00065 SafeHashSet(const SafeHashSet& that); 00066 }; 00067 00068 COH_CLOSE_NAMESPACE2 00069 00070 #endif // COH_SAFE_HASH_SET