SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "map_type.h"
{}
key_thread()
+ : nKey()
+ , nThread()
{}
};
}
struct ensure_func
{
template <typename Q>
- void operator()( bool /*bNew*/, Q const& )
+ void operator()( bool /*bNew*/, Q const& ) const
{}
+
template <typename Q, typename V>
- void operator()( bool /*bNew*/, Q const&, V& )
+ void operator()( bool /*bNew*/, Q const&, V& ) const
{}
// FeldmanHashMap
template <typename Q>
- void operator()( Q&, Q*)
+ void operator()( Q&, Q*) const
{}
};
public:
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "map_type.h"
EXPECT_EQ( w.m_KeyNotExists.nFailed, 0 ) << "thread " << i;
}
+ propout()
+ << std::make_pair( "exist_found", nExistSuccess )
+ << std::make_pair( "exist_not_found", nExistFailed ) // must = 0
+ << std::make_pair( "missing_not_found", nMissingSuccess )
+ << std::make_pair( "missing_found", nMissingFailed ); // must = 0
+
check_before_cleanup( testMap );
testMap.clear();
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "map_type.h"
, nUpdateCall( s.nUpdateCall )
, bInitialized( s.bInitialized.load(atomics::memory_order_relaxed))
, threadId( cds::OS::get_current_thread_id())
+ , m_access()
{}
// boost::container::flat_map requires operator =
nKey = v.nKey;
nData = v.nData;
nUpdateCall = v.nUpdateCall;
+ threadId = v.threadId;
bInitialized.store(v.bInitialized.load(atomics::memory_order_relaxed), atomics::memory_order_relaxed);
return *this;
size_t nFailedItem;
value_container()
- : nSuccessItem(0)
+ : nKeyExpected()
+ , nSuccessItem(0)
, nFailedItem(0)
{}
};
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "map_type.h"
struct update_func
{
- void operator()( bool bNew, std::pair<key_type const, value_type>& item )
+ void operator()( bool bNew, std::pair<key_type const, value_type>& item ) const
{
if ( bNew )
item.second = item.first;
}
+
// for boost::container::flat_map
- void operator()( bool bNew, std::pair<key_type, value_type>& item )
+ void operator()( bool bNew, std::pair<key_type, value_type>& item ) const
{
if ( bNew )
item.second = item.first;
}
// for BronsonAVLTreeMap
- void operator()( bool bNew, key_type key, value_type& val )
+ void operator()( bool bNew, key_type key, value_type& val ) const
{
if ( bNew )
val = key;
}
// for FeldmanHashMap
- void operator()( std::pair<key_type const, value_type>& item, std::pair<key_type const, value_type> * pOld )
+ void operator()( std::pair<key_type const, value_type>& item, std::pair<key_type const, value_type>* pOld ) const
{
if ( !pOld )
item.second = item.first;
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "map_type.h"
struct update_functor {
template <typename Q>
- void operator()( bool /*bNew*/, map_value_type& /*cur*/, Q const& /*val*/ )
+ void operator()( bool /*bNew*/, map_value_type& /*cur*/, Q const& /*val*/ ) const
{}
// FeldmanHashMap
- void operator()( map_value_type& /*cur*/, map_value_type * /*old*/)
+ void operator()( map_value_type& /*cur*/, map_value_type* /*old*/) const
{}
// MichaelMap
- void operator()( bool /*bNew*/, map_value_type& /*cur*/ )
+ void operator()( bool /*bNew*/, map_value_type& /*cur*/ ) const
{}
// BronsonAVLTreeMap
- void operator()( bool /*bNew*/, key_type /*key*/, value_type& /*val*/ )
+ void operator()( bool /*bNew*/, key_type /*key*/, value_type& /*val*/ ) const
{}
};
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "set_type.h"
{}
key_thread()
+ : nKey()
+ , nThread()
+ , pad_( 0 )
{}
};
{
return std::hash<size_t>()(k.nKey);
}
+
size_t operator()( size_t k ) const
{
return std::hash<size_t>()(k);
struct update_functor
{
template <typename Q>
- void operator()( bool /*bNew*/, key_value_pair const&, Q const& )
+ void operator()( bool /*bNew*/, key_value_pair const&, Q const& ) const
{}
- void operator()(key_value_pair& /*cur*/, key_value_pair * /*prev*/)
+ void operator()(key_value_pair& /*cur*/, key_value_pair * /*prev*/) const
{}
};
public:
, nUpdateCall(s.nUpdateCall.load(atomics::memory_order_relaxed))
, bInitialized( s.bInitialized )
, threadId( cds::OS::get_current_thread_id() )
+ , m_access()
{}
// boost::container::flat_map requires operator =
{
nKey = v.nKey;
nData = v.nData;
+ threadId = v.threadId;
nUpdateCall.store( v.nUpdateCall.load(atomics::memory_order_relaxed), atomics::memory_order_relaxed );
bInitialized = v.bInitialized;