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:
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.
*/
#ifndef CDSUNIT_MAP_TYPE_STD_H
bool insert( const Key& key, const Value& val )
{
scoped_lock al( m_lock );
- return base_class::insert( typename base_class::value_type( key, val ) ).second;
+ return base_class::insert( typename base_class::value_type( key, val )).second;
}
template <typename T, typename Func>
bool insert( const Key& key, const T& val, Func func )
{
scoped_lock al( m_lock );
- std::pair<typename base_class::iterator, bool> pRet = base_class::insert( typename base_class::value_type( key, Value() ) );
+ std::pair<typename base_class::iterator, bool> pRet = base_class::insert( typename base_class::value_type( key, Value()) );
if ( pRet.second ) {
func( pRet.first->second, val );
return true;
std::pair<bool, bool> update( const T& key, Func func, bool /*bAllowInsert*/ = true )
{
scoped_lock al( m_lock );
- std::pair<typename base_class::iterator, bool> pRet = base_class::insert( typename base_class::value_type( key, Value() ) );
+ std::pair<typename base_class::iterator, bool> pRet = base_class::insert( typename base_class::value_type( key, Value()) );
if ( pRet.second ) {
func( true, *pRet.first );
return std::make_pair( true, true );
{
scoped_lock al( m_lock );
typename base_class::iterator it = base_class::find( key );
- if ( it != base_class::end() ) {
- func( (*it) );
+ if ( it != base_class::end()) {
+ func( (*it));
base_class::erase( it );
return true;
}
return false;
}
- std::ostream& dump( std::ostream& stm ) { return stm; }
-
+ empty_stat statistics() const
+ {
+ return empty_stat();
+ }
// for testing
static CDS_CONSTEXPR bool const c_bExtractSupported = false;
bool insert( const Key& key, const T& val, Func func )
{
scoped_lock al( m_lock );
- std::pair<typename base_class::iterator, bool> pRet = base_class::insert( typename base_class::value_type(key, Value() ));
+ std::pair<typename base_class::iterator, bool> pRet = base_class::insert( typename base_class::value_type(key, Value()));
if ( pRet.second ) {
func( pRet.first->second, val );
return true;
std::pair<bool, bool> update( const T& key, Func func, bool /*bAllowInsert*/ = true )
{
scoped_lock al( m_lock );
- std::pair<typename base_class::iterator, bool> pRet = base_class::insert( typename base_class::value_type( key, Value() ));
+ std::pair<typename base_class::iterator, bool> pRet = base_class::insert( typename base_class::value_type( key, Value()));
if ( pRet.second ) {
func( true, *pRet.first );
return std::make_pair( true, true );
{
scoped_lock al( m_lock );
typename base_class::iterator it = base_class::find( key );
- if ( it != base_class::end() ) {
+ if ( it != base_class::end()) {
func( *it );
return base_class::erase( key ) != 0;
}
return false;
}
- std::ostream& dump( std::ostream& stm ) { return stm; }
+ empty_stat statistics() const
+ {
+ return empty_stat();
+ }
// 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 = false;
- };
+ };
struct tag_StdMap;
};
} // namespace map
+
#define CDSSTRESS_StdMap_case( fixture, test_case, std_map_type, key_type, value_type ) \
TEST_F( fixture, std_map_type ) \
{ \