typename equal_to_wrapper< typename original_type_traits::equal_to >::type
>::type equal_to;
- typedef typename std::conditional< original_type_traits::sort,
- cds::details::compare_wrapper< node_type, key_comparator, key_field_accessor >,
+ typedef typename std::conditional<
+ original_type_traits::sort
+ || !std::is_same< typename original_type_traits::compare, cds::opt::none >::value
+ || !std::is_same< typename original_type_traits::less, cds::opt::none >::value,
+ cds::details::compare_wrapper<
+ node_type,
+ typename opt::details::make_comparator< value_type, original_type_traits >::type,
+ key_field_accessor
+ >,
cds::opt::none
>::type compare;
typename equal_to_wrapper< typename original_type_traits::equal_to >::type
>::type equal_to;
- typedef typename std::conditional< original_type_traits::sort,
- typedef cds::details::compare_wrapper< node_type, key_comparator, value_accessor >,
+ typedef typename std::conditional<
+ original_type_traits::sort
+ || !std::is_same<typename original_type_traits::compare, cds::opt::none>::value
+ || !std::is_same<typename original_type_traits::less, cds::opt::none>::value,
+ cds::details::compare_wrapper<
+ node_type,
+ typename opt::details::make_comparator< value_type, original_type_traits >::type,
+ value_accessor
+ >,
cds::opt::none
>::type compare;
};
{408FE9BC-44F0-4E6A-89FA-D6F952584239} = {408FE9BC-44F0-4E6A-89FA-D6F952584239}\r
EndProjectSection\r
EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hdr-test-ordered-list", "hdr-test-ordered-list.vcxproj", "{EFCBBADE-2CF4-4E2B-ADB2-98C8D139E805}"\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hdr-test-list", "hdr-test-list.vcxproj", "{EFCBBADE-2CF4-4E2B-ADB2-98C8D139E805}"\r
ProjectSection(ProjectDependencies) = postProject\r
{61179F2F-07E1-490D-B64D-D85A90B6EF81} = {61179F2F-07E1-490D-B64D-D85A90B6EF81}\r
{408FE9BC-44F0-4E6A-89FA-D6F952584239} = {408FE9BC-44F0-4E6A-89FA-D6F952584239}\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+ <ItemGroup Label="ProjectConfigurations">\r
+ <ProjectConfiguration Include="DebugVLD|Win32">\r
+ <Configuration>DebugVLD</Configuration>\r
+ <Platform>Win32</Platform>\r
+ </ProjectConfiguration>\r
+ <ProjectConfiguration Include="DebugVLD|x64">\r
+ <Configuration>DebugVLD</Configuration>\r
+ <Platform>x64</Platform>\r
+ </ProjectConfiguration>\r
+ <ProjectConfiguration Include="Debug|Win32">\r
+ <Configuration>Debug</Configuration>\r
+ <Platform>Win32</Platform>\r
+ </ProjectConfiguration>\r
+ <ProjectConfiguration Include="Debug|x64">\r
+ <Configuration>Debug</Configuration>\r
+ <Platform>x64</Platform>\r
+ </ProjectConfiguration>\r
+ <ProjectConfiguration Include="ICL-Debug|Win32">\r
+ <Configuration>ICL-Debug</Configuration>\r
+ <Platform>Win32</Platform>\r
+ </ProjectConfiguration>\r
+ <ProjectConfiguration Include="ICL-Debug|x64">\r
+ <Configuration>ICL-Debug</Configuration>\r
+ <Platform>x64</Platform>\r
+ </ProjectConfiguration>\r
+ <ProjectConfiguration Include="ICL-Release|Win32">\r
+ <Configuration>ICL-Release</Configuration>\r
+ <Platform>Win32</Platform>\r
+ </ProjectConfiguration>\r
+ <ProjectConfiguration Include="ICL-Release|x64">\r
+ <Configuration>ICL-Release</Configuration>\r
+ <Platform>x64</Platform>\r
+ </ProjectConfiguration>\r
+ <ProjectConfiguration Include="Release|Win32">\r
+ <Configuration>Release</Configuration>\r
+ <Platform>Win32</Platform>\r
+ </ProjectConfiguration>\r
+ <ProjectConfiguration Include="Release|x64">\r
+ <Configuration>Release</Configuration>\r
+ <Platform>x64</Platform>\r
+ </ProjectConfiguration>\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ClInclude Include="..\..\..\tests\test-hdr\list\hdr_intrusive_lazy.h" />\r
+ <ClInclude Include="..\..\..\tests\test-hdr\list\hdr_intrusive_michael.h" />\r
+ <ClInclude Include="..\..\..\tests\test-hdr\list\hdr_lazy.h" />\r
+ <ClInclude Include="..\..\..\tests\test-hdr\list\hdr_lazy_kv.h" />\r
+ <ClInclude Include="..\..\..\tests\test-hdr\list\hdr_michael.h" />\r
+ <ClInclude Include="..\..\..\tests\test-hdr\list\hdr_michael_kv.h" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_lazy_dhp.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_lazy_hp.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_lazy_nogc.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_lazy_nogc_unord.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_lazy_rcu_gpb.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_lazy_rcu_gpi.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_lazy_rcu_gpt.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_lazy_rcu_shb.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_lazy_rcu_sht.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_michael_dhp.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_michael_hp.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_michael_list_rcu_gpb.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_michael_list_rcu_gpi.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_michael_list_rcu_gpt.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_michael_list_rcu_shb.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_michael_list_rcu_sht.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_michael_nogc.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_dhp.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_hp.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_kv_dhp.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_kv_hp.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_kv_nogc.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_kv_nogc_unord.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_kv_rcu_gpb.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_kv_rcu_gpi.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_kv_rcu_gpt.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_kv_rcu_shb.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_kv_rcu_sht.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_nogc.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_nogc_unord.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_rcu_gpb.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_rcu_gpi.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_rcu_gpt.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_rcu_shb.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_rcu_sht.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_dhp.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_hp.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_kv_dhp.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_kv_hp.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_kv_nogc.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_kv_rcu_gpb.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_kv_rcu_gpi.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_kv_rcu_gpt.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_kv_rcu_shb.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_kv_rcu_sht.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_nogc.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_rcu_gpb.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_rcu_gpi.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_rcu_gpt.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_rcu_shb.cpp" />\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_rcu_sht.cpp" />\r
+ </ItemGroup>\r
+ <PropertyGroup Label="Globals">\r
+ <ProjectGuid>{EFCBBADE-2CF4-4E2B-ADB2-98C8D139E805}</ProjectGuid>\r
+ <RootNamespace>hdrtestordlist</RootNamespace>\r
+ <Keyword>Win32Proj</Keyword>\r
+ <VCTargetsPath Condition="'$(VCTargetsPath11)' != '' and '$(VSVersion)' == '' and $(VisualStudioVersion) == ''">$(VCTargetsPath11)</VCTargetsPath>\r
+ <ProjectName>hdr-test-list</ProjectName>\r
+ </PropertyGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'" Label="Configuration">\r
+ <ConfigurationType>Application</ConfigurationType>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ <PlatformToolset>v120</PlatformToolset>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+ <ConfigurationType>Application</ConfigurationType>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ <WholeProgramOptimization>true</WholeProgramOptimization>\r
+ <PlatformToolset>v120</PlatformToolset>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'" Label="Configuration">\r
+ <ConfigurationType>Application</ConfigurationType>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ <WholeProgramOptimization>true</WholeProgramOptimization>\r
+ <PlatformToolset>Intel C++ Compiler XE 13.0</PlatformToolset>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+ <ConfigurationType>Application</ConfigurationType>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ <PlatformToolset>v120</PlatformToolset>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'" Label="Configuration">\r
+ <ConfigurationType>Application</ConfigurationType>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ <PlatformToolset>Intel C++ Compiler XE 13.0</PlatformToolset>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'" Label="Configuration">\r
+ <ConfigurationType>Application</ConfigurationType>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ <PlatformToolset>v120</PlatformToolset>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+ <ConfigurationType>Application</ConfigurationType>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ <WholeProgramOptimization>true</WholeProgramOptimization>\r
+ <PlatformToolset>v120</PlatformToolset>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'" Label="Configuration">\r
+ <ConfigurationType>Application</ConfigurationType>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ <WholeProgramOptimization>true</WholeProgramOptimization>\r
+ <PlatformToolset>Intel C++ Compiler XE 13.0</PlatformToolset>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+ <ConfigurationType>Application</ConfigurationType>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ <PlatformToolset>v120</PlatformToolset>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'" Label="Configuration">\r
+ <ConfigurationType>Application</ConfigurationType>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ <PlatformToolset>Intel C++ Compiler XE 13.0</PlatformToolset>\r
+ </PropertyGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+ <ImportGroup Label="ExtensionSettings">\r
+ </ImportGroup>\r
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'" Label="PropertySheets">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'" Label="PropertySheets">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'" Label="PropertySheets">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'" Label="PropertySheets">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'" Label="PropertySheets">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'" Label="PropertySheets">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <PropertyGroup Label="UserMacros" />\r
+ <PropertyGroup>\r
+ <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>\r
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)..\..\..\bin\vc12\$(Platform)\</OutDir>\r
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'">$(SolutionDir)..\..\..\bin\vc12-icl\$(Platform)\</OutDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)..\..\..\obj\vc12\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'">$(SolutionDir)..\..\..\obj\vc12-icl\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>\r
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'">false</LinkIncremental>\r
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)..\..\..\bin\vc12\$(Platform)\</OutDir>\r
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'">$(SolutionDir)..\..\..\bin\vc12-icl\$(Platform)\</OutDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)..\..\..\obj\vc12\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'">$(SolutionDir)..\..\..\obj\vc12-icl\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>\r
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'">false</LinkIncremental>\r
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)..\..\..\bin\vc12\$(Platform)\</OutDir>\r
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'">$(SolutionDir)..\..\..\bin\vc12-icl\$(Platform)\</OutDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)..\..\..\obj\vc12\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'">$(SolutionDir)..\..\..\obj\vc12-icl\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'">false</LinkIncremental>\r
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)..\..\..\bin\vc12\$(Platform)\</OutDir>\r
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'">$(SolutionDir)..\..\..\bin\vc12-icl\$(Platform)\</OutDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)..\..\..\obj\vc12\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'">$(SolutionDir)..\..\..\obj\vc12-icl\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'">false</LinkIncremental>\r
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">$(SolutionDir)..\..\..\bin\vc12\$(Platform)\</OutDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">$(SolutionDir)..\..\..\obj\vc12\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">false</LinkIncremental>\r
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">$(SolutionDir)..\..\..\bin\vc12\$(Platform)\</OutDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">$(SolutionDir)..\..\..\obj\vc12\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">false</LinkIncremental>\r
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'" />\r
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'" />\r
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'" />\r
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'" />\r
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />\r
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'" />\r
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />\r
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'" />\r
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />\r
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'" />\r
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />\r
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'" />\r
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />\r
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'" />\r
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />\r
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'" />\r
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />\r
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'" />\r
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />\r
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'" />\r
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName)_d</TargetName>\r
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'">$(ProjectName)_d</TargetName>\r
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName)_d</TargetName>\r
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'">$(ProjectName)_d</TargetName>\r
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">$(ProjectName)_d</TargetName>\r
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">$(ProjectName)_d</TargetName>\r
+ </PropertyGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+ <ClCompile>\r
+ <AdditionalOptions>/bigobj /Zc:inline %(AdditionalOptions)</AdditionalOptions>\r
+ <Optimization>Disabled</Optimization>\r
+ <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ <MinimalRebuild>true</MinimalRebuild>\r
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
+ <PrecompiledHeader>\r
+ </PrecompiledHeader>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
+ <CallingConvention>Cdecl</CallingConvention>\r
+ <DisableSpecificWarnings>4520</DisableSpecificWarnings>\r
+ </ClCompile>\r
+ <Link>\r
+ <AdditionalDependencies>unit-prerequisites_d.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+ <OutputFile>$(TargetPath)</OutputFile>\r
+ <AdditionalLibraryDirectories>$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+ <GenerateDebugInformation>true</GenerateDebugInformation>\r
+ <SubSystem>Console</SubSystem>\r
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
+ <DataExecutionPrevention>\r
+ </DataExecutionPrevention>\r
+ <TargetMachine>MachineX86</TargetMachine>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'">\r
+ <ClCompile>\r
+ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>\r
+ <Optimization>Disabled</Optimization>\r
+ <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ <MinimalRebuild>true</MinimalRebuild>\r
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
+ <PrecompiledHeader>\r
+ </PrecompiledHeader>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
+ <CallingConvention>Cdecl</CallingConvention>\r
+ <Cpp0xSupport>true</Cpp0xSupport>\r
+ </ClCompile>\r
+ <Link>\r
+ <AdditionalDependencies>unit-prerequisites_d.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+ <OutputFile>$(TargetPath)</OutputFile>\r
+ <AdditionalLibraryDirectories>$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+ <GenerateDebugInformation>true</GenerateDebugInformation>\r
+ <SubSystem>Console</SubSystem>\r
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
+ <DataExecutionPrevention>\r
+ </DataExecutionPrevention>\r
+ <TargetMachine>MachineX86</TargetMachine>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+ <Midl>\r
+ <TargetEnvironment>X64</TargetEnvironment>\r
+ </Midl>\r
+ <ClCompile>\r
+ <AdditionalOptions>/bigobj /Zc:inline %(AdditionalOptions)</AdditionalOptions>\r
+ <Optimization>Disabled</Optimization>\r
+ <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ <MinimalRebuild>true</MinimalRebuild>\r
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
+ <PrecompiledHeader>\r
+ </PrecompiledHeader>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+ <CallingConvention>Cdecl</CallingConvention>\r
+ <DisableSpecificWarnings>4520</DisableSpecificWarnings>\r
+ </ClCompile>\r
+ <Link>\r
+ <AdditionalDependencies>unit-prerequisites_d.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+ <OutputFile>$(TargetPath)</OutputFile>\r
+ <AdditionalLibraryDirectories>$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+ <GenerateDebugInformation>true</GenerateDebugInformation>\r
+ <SubSystem>Console</SubSystem>\r
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
+ <DataExecutionPrevention>\r
+ </DataExecutionPrevention>\r
+ <TargetMachine>MachineX64</TargetMachine>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'">\r
+ <Midl>\r
+ <TargetEnvironment>X64</TargetEnvironment>\r
+ </Midl>\r
+ <ClCompile>\r
+ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>\r
+ <Optimization>Disabled</Optimization>\r
+ <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ <MinimalRebuild>true</MinimalRebuild>\r
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
+ <PrecompiledHeader>\r
+ </PrecompiledHeader>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+ <CallingConvention>Cdecl</CallingConvention>\r
+ <Cpp0xSupport>true</Cpp0xSupport>\r
+ </ClCompile>\r
+ <Link>\r
+ <AdditionalDependencies>unit-prerequisites_d.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+ <OutputFile>$(TargetPath)</OutputFile>\r
+ <AdditionalLibraryDirectories>$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+ <GenerateDebugInformation>true</GenerateDebugInformation>\r
+ <SubSystem>Console</SubSystem>\r
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
+ <DataExecutionPrevention>\r
+ </DataExecutionPrevention>\r
+ <TargetMachine>MachineX64</TargetMachine>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+ <ClCompile>\r
+ <AdditionalOptions>/bigobj /Zc:inline %(AdditionalOptions)</AdditionalOptions>\r
+ <Optimization>Full</Optimization>\r
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+ <IntrinsicFunctions>true</IntrinsicFunctions>\r
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
+ <OmitFramePointers>false</OmitFramePointers>\r
+ <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ <StringPooling>true</StringPooling>\r
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
+ <PrecompiledHeader>\r
+ </PrecompiledHeader>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+ <CallingConvention>Cdecl</CallingConvention>\r
+ <EnablePREfast>false</EnablePREfast>\r
+ <DisableSpecificWarnings>4520</DisableSpecificWarnings>\r
+ </ClCompile>\r
+ <Link>\r
+ <AdditionalDependencies>unit-prerequisites.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+ <OutputFile>$(TargetPath)</OutputFile>\r
+ <AdditionalLibraryDirectories>$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+ <GenerateDebugInformation>true</GenerateDebugInformation>\r
+ <SubSystem>Console</SubSystem>\r
+ <OptimizeReferences>true</OptimizeReferences>\r
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
+ <DataExecutionPrevention>\r
+ </DataExecutionPrevention>\r
+ <TargetMachine>MachineX86</TargetMachine>\r
+ <Profile>true</Profile>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'">\r
+ <ClCompile>\r
+ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>\r
+ <Optimization>Full</Optimization>\r
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+ <IntrinsicFunctions>true</IntrinsicFunctions>\r
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
+ <OmitFramePointers>false</OmitFramePointers>\r
+ <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ <StringPooling>true</StringPooling>\r
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
+ <PrecompiledHeader>\r
+ </PrecompiledHeader>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+ <CallingConvention>Cdecl</CallingConvention>\r
+ <EnablePREfast>false</EnablePREfast>\r
+ <Cpp0xSupport>true</Cpp0xSupport>\r
+ </ClCompile>\r
+ <Link>\r
+ <AdditionalDependencies>unit-prerequisites.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+ <OutputFile>$(TargetPath)</OutputFile>\r
+ <AdditionalLibraryDirectories>$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+ <GenerateDebugInformation>true</GenerateDebugInformation>\r
+ <SubSystem>Console</SubSystem>\r
+ <OptimizeReferences>true</OptimizeReferences>\r
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
+ <DataExecutionPrevention>\r
+ </DataExecutionPrevention>\r
+ <TargetMachine>MachineX86</TargetMachine>\r
+ <Profile>true</Profile>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+ <Midl>\r
+ <TargetEnvironment>X64</TargetEnvironment>\r
+ </Midl>\r
+ <ClCompile>\r
+ <AdditionalOptions>/bigobj /Zc:inline %(AdditionalOptions)</AdditionalOptions>\r
+ <Optimization>Full</Optimization>\r
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+ <IntrinsicFunctions>true</IntrinsicFunctions>\r
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
+ <OmitFramePointers>false</OmitFramePointers>\r
+ <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ <StringPooling>true</StringPooling>\r
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
+ <PrecompiledHeader>\r
+ </PrecompiledHeader>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+ <CallingConvention>Cdecl</CallingConvention>\r
+ <EnablePREfast>false</EnablePREfast>\r
+ <DisableSpecificWarnings>4520</DisableSpecificWarnings>\r
+ </ClCompile>\r
+ <Link>\r
+ <AdditionalDependencies>unit-prerequisites.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+ <OutputFile>$(TargetPath)</OutputFile>\r
+ <AdditionalLibraryDirectories>$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+ <GenerateDebugInformation>true</GenerateDebugInformation>\r
+ <SubSystem>Console</SubSystem>\r
+ <OptimizeReferences>true</OptimizeReferences>\r
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>\r
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
+ <DataExecutionPrevention>\r
+ </DataExecutionPrevention>\r
+ <TargetMachine>MachineX64</TargetMachine>\r
+ <Profile>true</Profile>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'">\r
+ <Midl>\r
+ <TargetEnvironment>X64</TargetEnvironment>\r
+ </Midl>\r
+ <ClCompile>\r
+ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>\r
+ <Optimization>Full</Optimization>\r
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+ <IntrinsicFunctions>true</IntrinsicFunctions>\r
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
+ <OmitFramePointers>false</OmitFramePointers>\r
+ <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ <StringPooling>true</StringPooling>\r
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
+ <PrecompiledHeader>\r
+ </PrecompiledHeader>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+ <CallingConvention>Cdecl</CallingConvention>\r
+ <EnablePREfast>false</EnablePREfast>\r
+ <Cpp0xSupport>true</Cpp0xSupport>\r
+ <UseProcessorExtensions>HOST</UseProcessorExtensions>\r
+ </ClCompile>\r
+ <Link>\r
+ <AdditionalDependencies>unit-prerequisites.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+ <OutputFile>$(TargetPath)</OutputFile>\r
+ <AdditionalLibraryDirectories>$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+ <GenerateDebugInformation>true</GenerateDebugInformation>\r
+ <SubSystem>Console</SubSystem>\r
+ <OptimizeReferences>true</OptimizeReferences>\r
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>\r
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
+ <DataExecutionPrevention>\r
+ </DataExecutionPrevention>\r
+ <TargetMachine>MachineX64</TargetMachine>\r
+ <Profile>true</Profile>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">\r
+ <ClCompile>\r
+ <AdditionalOptions>/bigobj /Zc:inline %(AdditionalOptions)</AdditionalOptions>\r
+ <Optimization>Disabled</Optimization>\r
+ <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <PreprocessorDefinitions>CDS_USE_VLD;WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ <MinimalRebuild>true</MinimalRebuild>\r
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
+ <PrecompiledHeader>\r
+ </PrecompiledHeader>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
+ <CallingConvention>Cdecl</CallingConvention>\r
+ <DisableSpecificWarnings>4520</DisableSpecificWarnings>\r
+ </ClCompile>\r
+ <Link>\r
+ <AdditionalDependencies>unit-prerequisites_d.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+ <OutputFile>$(TargetPath)</OutputFile>\r
+ <AdditionalLibraryDirectories>$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+ <GenerateDebugInformation>true</GenerateDebugInformation>\r
+ <SubSystem>Console</SubSystem>\r
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
+ <DataExecutionPrevention>\r
+ </DataExecutionPrevention>\r
+ <TargetMachine>MachineX86</TargetMachine>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">\r
+ <Midl>\r
+ <TargetEnvironment>X64</TargetEnvironment>\r
+ </Midl>\r
+ <ClCompile>\r
+ <AdditionalOptions>/bigobj /Zc:inline %(AdditionalOptions)</AdditionalOptions>\r
+ <Optimization>Disabled</Optimization>\r
+ <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <PreprocessorDefinitions>CDS_USE_VLD;WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ <MinimalRebuild>true</MinimalRebuild>\r
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
+ <PrecompiledHeader>\r
+ </PrecompiledHeader>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+ <CallingConvention>Cdecl</CallingConvention>\r
+ <DisableSpecificWarnings>4520</DisableSpecificWarnings>\r
+ </ClCompile>\r
+ <Link>\r
+ <AdditionalDependencies>unit-prerequisites_d.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+ <OutputFile>$(TargetPath)</OutputFile>\r
+ <AdditionalLibraryDirectories>$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+ <GenerateDebugInformation>true</GenerateDebugInformation>\r
+ <SubSystem>Console</SubSystem>\r
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
+ <DataExecutionPrevention>\r
+ </DataExecutionPrevention>\r
+ <TargetMachine>MachineX64</TargetMachine>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+ <ImportGroup Label="ExtensionTargets">\r
+ </ImportGroup>\r
+</Project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+ <ItemGroup>\r
+ <Filter Include="intrusive">\r
+ <UniqueIdentifier>{fff45fc3-9c35-4f00-94ac-a2403b1caed6}</UniqueIdentifier>\r
+ </Filter>\r
+ <Filter Include="container">\r
+ <UniqueIdentifier>{b0d8933f-3fbc-49c2-ad77-89bd74461395}</UniqueIdentifier>\r
+ </Filter>\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ClInclude Include="..\..\..\tests\test-hdr\list\hdr_intrusive_lazy.h">\r
+ <Filter>intrusive</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="..\..\..\tests\test-hdr\list\hdr_intrusive_michael.h">\r
+ <Filter>intrusive</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="..\..\..\tests\test-hdr\list\hdr_lazy.h">\r
+ <Filter>container</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="..\..\..\tests\test-hdr\list\hdr_lazy_kv.h">\r
+ <Filter>container</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="..\..\..\tests\test-hdr\list\hdr_michael.h">\r
+ <Filter>container</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="..\..\..\tests\test-hdr\list\hdr_michael_kv.h">\r
+ <Filter>container</Filter>\r
+ </ClInclude>\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_lazy_dhp.cpp">\r
+ <Filter>intrusive</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_lazy_hp.cpp">\r
+ <Filter>intrusive</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_lazy_nogc.cpp">\r
+ <Filter>intrusive</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_lazy_rcu_gpb.cpp">\r
+ <Filter>intrusive</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_lazy_rcu_gpi.cpp">\r
+ <Filter>intrusive</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_lazy_rcu_gpt.cpp">\r
+ <Filter>intrusive</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_lazy_rcu_shb.cpp">\r
+ <Filter>intrusive</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_lazy_rcu_sht.cpp">\r
+ <Filter>intrusive</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_michael_dhp.cpp">\r
+ <Filter>intrusive</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_michael_hp.cpp">\r
+ <Filter>intrusive</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_michael_list_rcu_gpb.cpp">\r
+ <Filter>intrusive</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_michael_list_rcu_gpi.cpp">\r
+ <Filter>intrusive</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_michael_list_rcu_gpt.cpp">\r
+ <Filter>intrusive</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_michael_list_rcu_shb.cpp">\r
+ <Filter>intrusive</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_michael_list_rcu_sht.cpp">\r
+ <Filter>intrusive</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_michael_nogc.cpp">\r
+ <Filter>intrusive</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_dhp.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_hp.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_kv_dhp.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_kv_hp.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_kv_nogc.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_kv_rcu_gpb.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_kv_rcu_gpi.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_kv_rcu_gpt.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_kv_rcu_shb.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_kv_rcu_sht.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_nogc.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_rcu_gpb.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_rcu_gpi.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_rcu_gpt.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_rcu_shb.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_rcu_sht.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_dhp.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_hp.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_kv_dhp.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_kv_hp.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_kv_nogc.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_kv_rcu_gpb.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_kv_rcu_gpi.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_kv_rcu_gpt.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_kv_rcu_shb.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_kv_rcu_sht.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_nogc.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_rcu_gpb.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_rcu_gpi.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_rcu_gpt.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_rcu_shb.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_michael_rcu_sht.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_intrusive_lazy_nogc_unord.cpp">\r
+ <Filter>intrusive</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_nogc_unord.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="..\..\..\tests\test-hdr\list\hdr_lazy_kv_nogc_unord.cpp">\r
+ <Filter>container</Filter>\r
+ </ClCompile>\r
+ </ItemGroup>\r
+</Project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <ItemGroup Label="ProjectConfigurations">\r
- <ProjectConfiguration Include="DebugVLD|Win32">\r
- <Configuration>DebugVLD</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="DebugVLD|x64">\r
- <Configuration>DebugVLD</Configuration>\r
- <Platform>x64</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Debug|Win32">\r
- <Configuration>Debug</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Debug|x64">\r
- <Configuration>Debug</Configuration>\r
- <Platform>x64</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="ICL-Debug|Win32">\r
- <Configuration>ICL-Debug</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="ICL-Debug|x64">\r
- <Configuration>ICL-Debug</Configuration>\r
- <Platform>x64</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="ICL-Release|Win32">\r
- <Configuration>ICL-Release</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="ICL-Release|x64">\r
- <Configuration>ICL-Release</Configuration>\r
- <Platform>x64</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Release|Win32">\r
- <Configuration>Release</Configuration>\r
- <Platform>Win32</Platform>\r
- </ProjectConfiguration>\r
- <ProjectConfiguration Include="Release|x64">\r
- <Configuration>Release</Configuration>\r
- <Platform>x64</Platform>\r
- </ProjectConfiguration>\r
- </ItemGroup>\r
- <PropertyGroup Label="Globals">\r
- <ProjectGuid>{EFCBBADE-2CF4-4E2B-ADB2-98C8D139E805}</ProjectGuid>\r
- <RootNamespace>hdrtestordlist</RootNamespace>\r
- <Keyword>Win32Proj</Keyword>\r
- <VCTargetsPath Condition="'$(VCTargetsPath11)' != '' and '$(VSVersion)' == '' and $(VisualStudioVersion) == ''">$(VCTargetsPath11)</VCTargetsPath>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v120</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <WholeProgramOptimization>true</WholeProgramOptimization>\r
- <PlatformToolset>v120</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <WholeProgramOptimization>true</WholeProgramOptimization>\r
- <PlatformToolset>Intel C++ Compiler XE 13.0</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v120</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>Intel C++ Compiler XE 13.0</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v120</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <WholeProgramOptimization>true</WholeProgramOptimization>\r
- <PlatformToolset>v120</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <WholeProgramOptimization>true</WholeProgramOptimization>\r
- <PlatformToolset>Intel C++ Compiler XE 13.0</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v120</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>Intel C++ Compiler XE 13.0</PlatformToolset>\r
- </PropertyGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
- <ImportGroup Label="ExtensionSettings">\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'" Label="PropertySheets">\r
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
- </ImportGroup>\r
- <PropertyGroup Label="UserMacros" />\r
- <PropertyGroup>\r
- <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)..\..\..\bin\vc12\$(Platform)\</OutDir>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'">$(SolutionDir)..\..\..\bin\vc12-icl\$(Platform)\</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)..\..\..\obj\vc12\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'">$(SolutionDir)..\..\..\obj\vc12-icl\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'">false</LinkIncremental>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)..\..\..\bin\vc12\$(Platform)\</OutDir>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'">$(SolutionDir)..\..\..\bin\vc12-icl\$(Platform)\</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)..\..\..\obj\vc12\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'">$(SolutionDir)..\..\..\obj\vc12-icl\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'">false</LinkIncremental>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)..\..\..\bin\vc12\$(Platform)\</OutDir>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'">$(SolutionDir)..\..\..\bin\vc12-icl\$(Platform)\</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)..\..\..\obj\vc12\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'">$(SolutionDir)..\..\..\obj\vc12-icl\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'">false</LinkIncremental>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)..\..\..\bin\vc12\$(Platform)\</OutDir>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'">$(SolutionDir)..\..\..\bin\vc12-icl\$(Platform)\</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)..\..\..\obj\vc12\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'">$(SolutionDir)..\..\..\obj\vc12-icl\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'">false</LinkIncremental>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">$(SolutionDir)..\..\..\bin\vc12\$(Platform)\</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">$(SolutionDir)..\..\..\obj\vc12\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">false</LinkIncremental>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">$(SolutionDir)..\..\..\bin\vc12\$(Platform)\</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">$(SolutionDir)..\..\..\obj\vc12\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">false</LinkIncremental>\r
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'" />\r
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'" />\r
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'" />\r
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'" />\r
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />\r
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'" />\r
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />\r
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'" />\r
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />\r
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'" />\r
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />\r
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'" />\r
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />\r
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'" />\r
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />\r
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'" />\r
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />\r
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'" />\r
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />\r
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'" />\r
- <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName)_d</TargetName>\r
- <TargetName Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'">$(ProjectName)_d</TargetName>\r
- <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName)_d</TargetName>\r
- <TargetName Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'">$(ProjectName)_d</TargetName>\r
- <TargetName Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">$(ProjectName)_d</TargetName>\r
- <TargetName Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">$(ProjectName)_d</TargetName>\r
- </PropertyGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
- <ClCompile>\r
- <AdditionalOptions>/bigobj /Zc:inline %(AdditionalOptions)</AdditionalOptions>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MinimalRebuild>true</MinimalRebuild>\r
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeader>\r
- </PrecompiledHeader>\r
- <WarningLevel>Level3</WarningLevel>\r
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
- <CallingConvention>Cdecl</CallingConvention>\r
- <DisableSpecificWarnings>4520</DisableSpecificWarnings>\r
- </ClCompile>\r
- <Link>\r
- <AdditionalDependencies>unit-prerequisites_d.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(TargetPath)</OutputFile>\r
- <AdditionalLibraryDirectories>$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <SubSystem>Console</SubSystem>\r
- <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
- <DataExecutionPrevention>\r
- </DataExecutionPrevention>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|Win32'">\r
- <ClCompile>\r
- <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MinimalRebuild>true</MinimalRebuild>\r
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeader>\r
- </PrecompiledHeader>\r
- <WarningLevel>Level3</WarningLevel>\r
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
- <CallingConvention>Cdecl</CallingConvention>\r
- <Cpp0xSupport>true</Cpp0xSupport>\r
- </ClCompile>\r
- <Link>\r
- <AdditionalDependencies>unit-prerequisites_d.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(TargetPath)</OutputFile>\r
- <AdditionalLibraryDirectories>$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <SubSystem>Console</SubSystem>\r
- <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
- <DataExecutionPrevention>\r
- </DataExecutionPrevention>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
- <Midl>\r
- <TargetEnvironment>X64</TargetEnvironment>\r
- </Midl>\r
- <ClCompile>\r
- <AdditionalOptions>/bigobj /Zc:inline %(AdditionalOptions)</AdditionalOptions>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MinimalRebuild>true</MinimalRebuild>\r
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeader>\r
- </PrecompiledHeader>\r
- <WarningLevel>Level3</WarningLevel>\r
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
- <CallingConvention>Cdecl</CallingConvention>\r
- <DisableSpecificWarnings>4520</DisableSpecificWarnings>\r
- </ClCompile>\r
- <Link>\r
- <AdditionalDependencies>unit-prerequisites_d.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(TargetPath)</OutputFile>\r
- <AdditionalLibraryDirectories>$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <SubSystem>Console</SubSystem>\r
- <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
- <DataExecutionPrevention>\r
- </DataExecutionPrevention>\r
- <TargetMachine>MachineX64</TargetMachine>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Debug|x64'">\r
- <Midl>\r
- <TargetEnvironment>X64</TargetEnvironment>\r
- </Midl>\r
- <ClCompile>\r
- <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MinimalRebuild>true</MinimalRebuild>\r
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeader>\r
- </PrecompiledHeader>\r
- <WarningLevel>Level3</WarningLevel>\r
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
- <CallingConvention>Cdecl</CallingConvention>\r
- <Cpp0xSupport>true</Cpp0xSupport>\r
- </ClCompile>\r
- <Link>\r
- <AdditionalDependencies>unit-prerequisites_d.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(TargetPath)</OutputFile>\r
- <AdditionalLibraryDirectories>$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <SubSystem>Console</SubSystem>\r
- <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
- <DataExecutionPrevention>\r
- </DataExecutionPrevention>\r
- <TargetMachine>MachineX64</TargetMachine>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
- <ClCompile>\r
- <AdditionalOptions>/bigobj /Zc:inline %(AdditionalOptions)</AdditionalOptions>\r
- <Optimization>Full</Optimization>\r
- <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
- <IntrinsicFunctions>true</IntrinsicFunctions>\r
- <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
- <OmitFramePointers>false</OmitFramePointers>\r
- <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <StringPooling>true</StringPooling>\r
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
- <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
- <PrecompiledHeader>\r
- </PrecompiledHeader>\r
- <WarningLevel>Level3</WarningLevel>\r
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
- <CallingConvention>Cdecl</CallingConvention>\r
- <EnablePREfast>false</EnablePREfast>\r
- <DisableSpecificWarnings>4520</DisableSpecificWarnings>\r
- </ClCompile>\r
- <Link>\r
- <AdditionalDependencies>unit-prerequisites.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(TargetPath)</OutputFile>\r
- <AdditionalLibraryDirectories>$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <SubSystem>Console</SubSystem>\r
- <OptimizeReferences>true</OptimizeReferences>\r
- <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
- <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
- <DataExecutionPrevention>\r
- </DataExecutionPrevention>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- <Profile>true</Profile>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|Win32'">\r
- <ClCompile>\r
- <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>\r
- <Optimization>Full</Optimization>\r
- <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
- <IntrinsicFunctions>true</IntrinsicFunctions>\r
- <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
- <OmitFramePointers>false</OmitFramePointers>\r
- <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <StringPooling>true</StringPooling>\r
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
- <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
- <PrecompiledHeader>\r
- </PrecompiledHeader>\r
- <WarningLevel>Level3</WarningLevel>\r
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
- <CallingConvention>Cdecl</CallingConvention>\r
- <EnablePREfast>false</EnablePREfast>\r
- <Cpp0xSupport>true</Cpp0xSupport>\r
- </ClCompile>\r
- <Link>\r
- <AdditionalDependencies>unit-prerequisites.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(TargetPath)</OutputFile>\r
- <AdditionalLibraryDirectories>$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <SubSystem>Console</SubSystem>\r
- <OptimizeReferences>true</OptimizeReferences>\r
- <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
- <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
- <DataExecutionPrevention>\r
- </DataExecutionPrevention>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- <Profile>true</Profile>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
- <Midl>\r
- <TargetEnvironment>X64</TargetEnvironment>\r
- </Midl>\r
- <ClCompile>\r
- <AdditionalOptions>/bigobj /Zc:inline %(AdditionalOptions)</AdditionalOptions>\r
- <Optimization>Full</Optimization>\r
- <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
- <IntrinsicFunctions>true</IntrinsicFunctions>\r
- <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
- <OmitFramePointers>false</OmitFramePointers>\r
- <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <StringPooling>true</StringPooling>\r
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
- <PrecompiledHeader>\r
- </PrecompiledHeader>\r
- <WarningLevel>Level3</WarningLevel>\r
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
- <CallingConvention>Cdecl</CallingConvention>\r
- <EnablePREfast>false</EnablePREfast>\r
- <DisableSpecificWarnings>4520</DisableSpecificWarnings>\r
- </ClCompile>\r
- <Link>\r
- <AdditionalDependencies>unit-prerequisites.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(TargetPath)</OutputFile>\r
- <AdditionalLibraryDirectories>$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <SubSystem>Console</SubSystem>\r
- <OptimizeReferences>true</OptimizeReferences>\r
- <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
- <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>\r
- <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
- <DataExecutionPrevention>\r
- </DataExecutionPrevention>\r
- <TargetMachine>MachineX64</TargetMachine>\r
- <Profile>true</Profile>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ICL-Release|x64'">\r
- <Midl>\r
- <TargetEnvironment>X64</TargetEnvironment>\r
- </Midl>\r
- <ClCompile>\r
- <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>\r
- <Optimization>Full</Optimization>\r
- <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
- <IntrinsicFunctions>true</IntrinsicFunctions>\r
- <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
- <OmitFramePointers>false</OmitFramePointers>\r
- <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0501;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <StringPooling>true</StringPooling>\r
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
- <PrecompiledHeader>\r
- </PrecompiledHeader>\r
- <WarningLevel>Level3</WarningLevel>\r
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
- <CallingConvention>Cdecl</CallingConvention>\r
- <EnablePREfast>false</EnablePREfast>\r
- <Cpp0xSupport>true</Cpp0xSupport>\r
- <UseProcessorExtensions>HOST</UseProcessorExtensions>\r
- </ClCompile>\r
- <Link>\r
- <AdditionalDependencies>unit-prerequisites.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(TargetPath)</OutputFile>\r
- <AdditionalLibraryDirectories>$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <SubSystem>Console</SubSystem>\r
- <OptimizeReferences>true</OptimizeReferences>\r
- <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
- <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>\r
- <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
- <DataExecutionPrevention>\r
- </DataExecutionPrevention>\r
- <TargetMachine>MachineX64</TargetMachine>\r
- <Profile>true</Profile>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">\r
- <ClCompile>\r
- <AdditionalOptions>/bigobj /Zc:inline %(AdditionalOptions)</AdditionalOptions>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>CDS_USE_VLD;WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MinimalRebuild>true</MinimalRebuild>\r
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeader>\r
- </PrecompiledHeader>\r
- <WarningLevel>Level3</WarningLevel>\r
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
- <CallingConvention>Cdecl</CallingConvention>\r
- <DisableSpecificWarnings>4520</DisableSpecificWarnings>\r
- </ClCompile>\r
- <Link>\r
- <AdditionalDependencies>unit-prerequisites_d.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(TargetPath)</OutputFile>\r
- <AdditionalLibraryDirectories>$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <SubSystem>Console</SubSystem>\r
- <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
- <DataExecutionPrevention>\r
- </DataExecutionPrevention>\r
- <TargetMachine>MachineX86</TargetMachine>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">\r
- <Midl>\r
- <TargetEnvironment>X64</TargetEnvironment>\r
- </Midl>\r
- <ClCompile>\r
- <AdditionalOptions>/bigobj /Zc:inline %(AdditionalOptions)</AdditionalOptions>\r
- <Optimization>Disabled</Optimization>\r
- <AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(SolutionDir)..\..\..\tests\test-hdr;$(SolutionDir)..\..\..\tests;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
- <PreprocessorDefinitions>CDS_USE_VLD;WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;_SCL_SECURE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
- <MinimalRebuild>true</MinimalRebuild>\r
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
- <PrecompiledHeader>\r
- </PrecompiledHeader>\r
- <WarningLevel>Level3</WarningLevel>\r
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
- <CallingConvention>Cdecl</CallingConvention>\r
- <DisableSpecificWarnings>4520</DisableSpecificWarnings>\r
- </ClCompile>\r
- <Link>\r
- <AdditionalDependencies>unit-prerequisites_d.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
- <OutputFile>$(TargetPath)</OutputFile>\r
- <AdditionalLibraryDirectories>$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
- <GenerateDebugInformation>true</GenerateDebugInformation>\r
- <SubSystem>Console</SubSystem>\r
- <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
- <DataExecutionPrevention>\r
- </DataExecutionPrevention>\r
- <TargetMachine>MachineX64</TargetMachine>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemGroup>\r
- <ClInclude Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_lazy.h" />\r
- <ClInclude Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_michael.h" />\r
- <ClInclude Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy.h" />\r
- <ClInclude Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_kv.h" />\r
- <ClInclude Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael.h" />\r
- <ClInclude Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_kv.h" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_lazy_dhp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_lazy_hp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_lazy_nogc.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_lazy_rcu_gpb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_lazy_rcu_gpi.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_lazy_rcu_gpt.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_lazy_rcu_shb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_lazy_rcu_sht.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_michael_dhp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_michael_hp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_michael_list_rcu_gpb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_michael_list_rcu_gpi.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_michael_list_rcu_gpt.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_michael_list_rcu_shb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_michael_list_rcu_sht.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_michael_nogc.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_dhp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_hp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_kv_dhp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_kv_hp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_kv_nogc.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_kv_rcu_gpb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_kv_rcu_gpi.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_kv_rcu_gpt.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_kv_rcu_shb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_kv_rcu_sht.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_nogc.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_rcu_gpb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_rcu_gpi.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_rcu_gpt.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_rcu_shb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_rcu_sht.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_dhp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_hp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_kv_dhp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_kv_hp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_kv_nogc.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_kv_rcu_gpb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_kv_rcu_gpi.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_kv_rcu_gpt.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_kv_rcu_shb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_kv_rcu_sht.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_nogc.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_rcu_gpb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_rcu_gpi.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_rcu_gpt.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_rcu_shb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_rcu_sht.cpp" />\r
- </ItemGroup>\r
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
- <ImportGroup Label="ExtensionTargets">\r
- </ImportGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <ItemGroup>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_lazy_hp.cpp">\r
- <Filter>intrusive</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_lazy_nogc.cpp">\r
- <Filter>intrusive</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_lazy_rcu_gpb.cpp">\r
- <Filter>intrusive</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_lazy_rcu_gpi.cpp">\r
- <Filter>intrusive</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_lazy_rcu_gpt.cpp">\r
- <Filter>intrusive</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_michael_hp.cpp">\r
- <Filter>intrusive</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_michael_list_rcu_gpb.cpp">\r
- <Filter>intrusive</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_michael_list_rcu_gpi.cpp">\r
- <Filter>intrusive</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_michael_list_rcu_gpt.cpp">\r
- <Filter>intrusive</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_michael_nogc.cpp">\r
- <Filter>intrusive</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_hp.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_kv_hp.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_kv_nogc.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_nogc.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_rcu_gpb.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_rcu_gpi.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_rcu_gpt.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_hp.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_kv_hp.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_kv_nogc.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_nogc.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_rcu_gpb.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_rcu_gpi.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_rcu_gpt.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_kv_rcu_gpb.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_kv_rcu_gpi.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_kv_rcu_gpt.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_kv_rcu_gpb.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_kv_rcu_gpi.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_kv_rcu_gpt.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_lazy_rcu_shb.cpp">\r
- <Filter>intrusive</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_lazy_rcu_sht.cpp">\r
- <Filter>intrusive</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_michael_list_rcu_shb.cpp">\r
- <Filter>intrusive</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_michael_list_rcu_sht.cpp">\r
- <Filter>intrusive</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_kv_rcu_shb.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_kv_rcu_sht.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_rcu_shb.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_rcu_sht.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_kv_rcu_shb.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_kv_rcu_sht.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_rcu_shb.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_rcu_sht.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_lazy_dhp.cpp">\r
- <Filter>intrusive</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_dhp.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_kv_dhp.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_michael_dhp.cpp">\r
- <Filter>intrusive</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_dhp.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_kv_dhp.cpp">\r
- <Filter>container</Filter>\r
- </ClCompile>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ClInclude Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_lazy.h">\r
- <Filter>intrusive</Filter>\r
- </ClInclude>\r
- <ClInclude Include="..\..\..\tests\test-hdr\ordered_list\hdr_intrusive_michael.h">\r
- <Filter>intrusive</Filter>\r
- </ClInclude>\r
- <ClInclude Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy.h">\r
- <Filter>container</Filter>\r
- </ClInclude>\r
- <ClInclude Include="..\..\..\tests\test-hdr\ordered_list\hdr_lazy_kv.h">\r
- <Filter>container</Filter>\r
- </ClInclude>\r
- <ClInclude Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael.h">\r
- <Filter>container</Filter>\r
- </ClInclude>\r
- <ClInclude Include="..\..\..\tests\test-hdr\ordered_list\hdr_michael_kv.h">\r
- <Filter>container</Filter>\r
- </ClInclude>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Filter Include="intrusive">\r
- <UniqueIdentifier>{fff45fc3-9c35-4f00-94ac-a2403b1caed6}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="container">\r
- <UniqueIdentifier>{b0d8933f-3fbc-49c2-ad77-89bd74461395}</UniqueIdentifier>\r
- </Filter>\r
- </ItemGroup>\r
-</Project>
\ No newline at end of file
CDS_TESTHDR_DEQUE := \
tests/test-hdr/deque/hdr_fcdeque.cpp
-CDS_TESTHDR_ORDLIST := \
- tests/test-hdr/ordered_list/hdr_lazy_dhp.cpp \
- tests/test-hdr/ordered_list/hdr_lazy_hp.cpp \
- tests/test-hdr/ordered_list/hdr_lazy_nogc.cpp \
- tests/test-hdr/ordered_list/hdr_lazy_rcu_gpi.cpp \
- tests/test-hdr/ordered_list/hdr_lazy_rcu_gpb.cpp \
- tests/test-hdr/ordered_list/hdr_lazy_rcu_gpt.cpp \
- tests/test-hdr/ordered_list/hdr_lazy_rcu_shb.cpp \
- tests/test-hdr/ordered_list/hdr_lazy_rcu_sht.cpp \
- tests/test-hdr/ordered_list/hdr_lazy_kv_dhp.cpp \
- tests/test-hdr/ordered_list/hdr_lazy_kv_hp.cpp \
- tests/test-hdr/ordered_list/hdr_lazy_kv_nogc.cpp \
- tests/test-hdr/ordered_list/hdr_lazy_kv_rcu_gpb.cpp \
- tests/test-hdr/ordered_list/hdr_lazy_kv_rcu_gpi.cpp \
- tests/test-hdr/ordered_list/hdr_lazy_kv_rcu_gpt.cpp \
- tests/test-hdr/ordered_list/hdr_lazy_kv_rcu_shb.cpp \
- tests/test-hdr/ordered_list/hdr_lazy_kv_rcu_sht.cpp \
- tests/test-hdr/ordered_list/hdr_michael_dhp.cpp \
- tests/test-hdr/ordered_list/hdr_michael_hp.cpp \
- tests/test-hdr/ordered_list/hdr_michael_nogc.cpp \
- tests/test-hdr/ordered_list/hdr_michael_rcu_gpi.cpp \
- tests/test-hdr/ordered_list/hdr_michael_rcu_gpb.cpp \
- tests/test-hdr/ordered_list/hdr_michael_rcu_gpt.cpp \
- tests/test-hdr/ordered_list/hdr_michael_rcu_shb.cpp \
- tests/test-hdr/ordered_list/hdr_michael_rcu_sht.cpp \
- tests/test-hdr/ordered_list/hdr_michael_kv_dhp.cpp \
- tests/test-hdr/ordered_list/hdr_michael_kv_hp.cpp \
- tests/test-hdr/ordered_list/hdr_michael_kv_nogc.cpp \
- tests/test-hdr/ordered_list/hdr_michael_kv_rcu_gpi.cpp \
- tests/test-hdr/ordered_list/hdr_michael_kv_rcu_gpb.cpp \
- tests/test-hdr/ordered_list/hdr_michael_kv_rcu_gpt.cpp \
- tests/test-hdr/ordered_list/hdr_michael_kv_rcu_shb.cpp \
- tests/test-hdr/ordered_list/hdr_michael_kv_rcu_sht.cpp
+CDS_TESTHDR_LIST := \
+ tests/test-hdr/list/hdr_lazy_dhp.cpp \
+ tests/test-hdr/list/hdr_lazy_hp.cpp \
+ tests/test-hdr/list/hdr_lazy_nogc.cpp \
+ tests/test-hdr/list/hdr_lazy_nogc_unord.cpp \
+ tests/test-hdr/list/hdr_lazy_rcu_gpi.cpp \
+ tests/test-hdr/list/hdr_lazy_rcu_gpb.cpp \
+ tests/test-hdr/list/hdr_lazy_rcu_gpt.cpp \
+ tests/test-hdr/list/hdr_lazy_rcu_shb.cpp \
+ tests/test-hdr/list/hdr_lazy_rcu_sht.cpp \
+ tests/test-hdr/list/hdr_lazy_kv_dhp.cpp \
+ tests/test-hdr/list/hdr_lazy_kv_hp.cpp \
+ tests/test-hdr/list/hdr_lazy_kv_nogc.cpp \
+ tests/test-hdr/list/hdr_lazy_kv_rcu_gpb.cpp \
+ tests/test-hdr/list/hdr_lazy_kv_rcu_gpi.cpp \
+ tests/test-hdr/list/hdr_lazy_kv_rcu_gpt.cpp \
+ tests/test-hdr/list/hdr_lazy_kv_rcu_shb.cpp \
+ tests/test-hdr/list/hdr_lazy_kv_rcu_sht.cpp \
+ tests/test-hdr/list/hdr_michael_dhp.cpp \
+ tests/test-hdr/list/hdr_michael_hp.cpp \
+ tests/test-hdr/list/hdr_michael_nogc.cpp \
+ tests/test-hdr/list/hdr_michael_rcu_gpi.cpp \
+ tests/test-hdr/list/hdr_michael_rcu_gpb.cpp \
+ tests/test-hdr/list/hdr_michael_rcu_gpt.cpp \
+ tests/test-hdr/list/hdr_michael_rcu_shb.cpp \
+ tests/test-hdr/list/hdr_michael_rcu_sht.cpp \
+ tests/test-hdr/list/hdr_michael_kv_dhp.cpp \
+ tests/test-hdr/list/hdr_michael_kv_hp.cpp \
+ tests/test-hdr/list/hdr_michael_kv_nogc.cpp \
+ tests/test-hdr/list/hdr_michael_kv_rcu_gpi.cpp \
+ tests/test-hdr/list/hdr_michael_kv_rcu_gpb.cpp \
+ tests/test-hdr/list/hdr_michael_kv_rcu_gpt.cpp \
+ tests/test-hdr/list/hdr_michael_kv_rcu_shb.cpp \
+ tests/test-hdr/list/hdr_michael_kv_rcu_sht.cpp
CDS_TESTHDR_UNORDLIST := \
- tests/test-hdr/unordered_list/hdr_lazy_nogc.cpp \
tests/test-hdr/unordered_list/hdr_lazy_kv_nogc.cpp
CDS_TESTHDR_PQUEUE := \
$(CDS_TESTHDR_STACK) \
$(CDS_TESTHDR_MAP) \
$(CDS_TESTHDR_DEQUE) \
- $(CDS_TESTHDR_ORDLIST) \
- $(CDS_TESTHDR_UNORDLIST) \
+ $(CDS_TESTHDR_LIST) \
$(CDS_TESTHDR_SET) \
$(CDS_TESTHDR_TREE) \
$(CDS_TESTHDR_MISC)
tests/test-hdr/set/hdr_intrusive_splitlist_set_rcu_shb_lazy.cpp \
tests/test-hdr/set/hdr_intrusive_splitlist_set_rcu_sht_lazy.cpp
-CDS_TESTHDR_OFFSETOF_ORDLIST := \
- tests/test-hdr/ordered_list/hdr_intrusive_lazy_dhp.cpp \
- tests/test-hdr/ordered_list/hdr_intrusive_lazy_hp.cpp \
- tests/test-hdr/ordered_list/hdr_intrusive_lazy_nogc.cpp \
- tests/test-hdr/ordered_list/hdr_intrusive_lazy_rcu_gpb.cpp \
- tests/test-hdr/ordered_list/hdr_intrusive_lazy_rcu_gpi.cpp \
- tests/test-hdr/ordered_list/hdr_intrusive_lazy_rcu_gpt.cpp \
- tests/test-hdr/ordered_list/hdr_intrusive_lazy_rcu_shb.cpp \
- tests/test-hdr/ordered_list/hdr_intrusive_lazy_rcu_sht.cpp \
- tests/test-hdr/ordered_list/hdr_intrusive_michael_dhp.cpp \
- tests/test-hdr/ordered_list/hdr_intrusive_michael_hp.cpp \
- tests/test-hdr/ordered_list/hdr_intrusive_michael_nogc.cpp \
- tests/test-hdr/ordered_list/hdr_intrusive_michael_list_rcu_gpb.cpp \
- tests/test-hdr/ordered_list/hdr_intrusive_michael_list_rcu_gpi.cpp \
- tests/test-hdr/ordered_list/hdr_intrusive_michael_list_rcu_gpt.cpp \
- tests/test-hdr/ordered_list/hdr_intrusive_michael_list_rcu_shb.cpp \
- tests/test-hdr/ordered_list/hdr_intrusive_michael_list_rcu_sht.cpp
-
-CDS_TESTHDR_OFFSETOF_UNORDLIST := \
- tests/test-hdr/unordered_list/hdr_intrusive_lazy_nogc.cpp
+CDS_TESTHDR_OFFSETOF_LIST := \
+ tests/test-hdr/list/hdr_intrusive_lazy_dhp.cpp \
+ tests/test-hdr/list/hdr_intrusive_lazy_hp.cpp \
+ tests/test-hdr/list/hdr_intrusive_lazy_nogc.cpp \
+ tests/test-hdr/list/hdr_intrusive_lazy_nogc_unord.cpp \
+ tests/test-hdr/list/hdr_intrusive_lazy_rcu_gpb.cpp \
+ tests/test-hdr/list/hdr_intrusive_lazy_rcu_gpi.cpp \
+ tests/test-hdr/list/hdr_intrusive_lazy_rcu_gpt.cpp \
+ tests/test-hdr/list/hdr_intrusive_lazy_rcu_shb.cpp \
+ tests/test-hdr/list/hdr_intrusive_lazy_rcu_sht.cpp \
+ tests/test-hdr/list/hdr_intrusive_michael_dhp.cpp \
+ tests/test-hdr/list/hdr_intrusive_michael_hp.cpp \
+ tests/test-hdr/list/hdr_intrusive_michael_nogc.cpp \
+ tests/test-hdr/list/hdr_intrusive_michael_list_rcu_gpb.cpp \
+ tests/test-hdr/list/hdr_intrusive_michael_list_rcu_gpi.cpp \
+ tests/test-hdr/list/hdr_intrusive_michael_list_rcu_gpt.cpp \
+ tests/test-hdr/list/hdr_intrusive_michael_list_rcu_shb.cpp \
+ tests/test-hdr/list/hdr_intrusive_michael_list_rcu_sht.cpp
CDS_TESTHDR_OFFSETOF_QUEUE := \
tests/test-hdr/queue/hdr_intrusive_basketqueue_hp.cpp \
$(CDS_TESTHDR_OFFSETOF_DEQUE) \
$(CDS_TESTHDR_OFFSETOF_MAP) \
$(CDS_TESTHDR_OFFSETOF_SET) \
- $(CDS_TESTHDR_OFFSETOF_ORDLIST) \
- $(CDS_TESTHDR_OFFSETOF_UNORDLIST) \
+ $(CDS_TESTHDR_OFFSETOF_LIST) \
$(CDS_TESTHDR_OFFSETOF_TREE)
--- /dev/null
+//$$CDS-header$$
+
+#ifndef CDSTEST_HDR_INTRUSIVE_LAZY_H
+#define CDSTEST_HDR_INTRUSIVE_LAZY_H
+
+#include "cppunit/cppunit_proxy.h"
+#include <cds/intrusive/details/lazy_list_base.h>
+
+namespace ordlist {
+ namespace ci = cds::intrusive;
+ namespace co = cds::opt;
+
+ class IntrusiveLazyListHeaderTest: public CppUnitMini::TestCase
+ {
+ public:
+
+ struct stat {
+ int nDisposeCount;
+ int nEnsureExistsCall;
+ int nEnsureNewCall;
+ int nFindCall;
+ int nEraseCall;
+
+ stat()
+ : nDisposeCount(0)
+ , nEnsureExistsCall(0)
+ , nEnsureNewCall(0)
+ , nFindCall(0)
+ , nEraseCall(0)
+ {}
+
+ stat( const stat& s )
+ {
+ *this = s;
+ }
+
+ stat& operator =(const stat& s)
+ {
+ memcpy( this, &s, sizeof(s));
+ return *this;
+ }
+ };
+
+ template <typename GC>
+ struct base_int_item: public ci::lazy_list::node< GC >
+ {
+ int nKey;
+ int nVal;
+
+ mutable stat s;
+
+ base_int_item()
+ {}
+
+ base_int_item(int key, int val)
+ : nKey( key )
+ , nVal(val)
+ , s()
+ {}
+
+ base_int_item(const base_int_item& v )
+ : nKey( v.nKey )
+ , nVal( v.nVal )
+ , s()
+ {}
+
+ const int& key() const
+ {
+ return nKey;
+ }
+ };
+
+ template <typename GC>
+ struct member_int_item
+ {
+ int nKey;
+ int nVal;
+
+ ci::lazy_list::node< GC > hMember;
+
+ mutable stat s;
+
+ member_int_item()
+ {}
+
+ member_int_item(int key, int val)
+ : nKey( key )
+ , nVal(val)
+ , s()
+ {}
+
+ member_int_item(const member_int_item& v )
+ : nKey( v.nKey )
+ , nVal( v.nVal )
+ , s()
+ {}
+
+ const int& key() const
+ {
+ return nKey;
+ }
+ };
+
+ template <typename T>
+ struct less
+ {
+ bool operator ()(const T& v1, const T& v2 ) const
+ {
+ return v1.key() < v2.key();
+ }
+
+ template <typename Q>
+ bool operator ()(const T& v1, const Q& v2 ) const
+ {
+ return v1.key() < v2;
+ }
+
+ template <typename Q>
+ bool operator ()(const Q& v1, const T& v2 ) const
+ {
+ return v1 < v2.key();
+ }
+ };
+
+ template <typename T>
+ struct cmp {
+ int operator ()(const T& v1, const T& v2 ) const
+ {
+ if ( v1.key() < v2.key() )
+ return -1;
+ return v1.key() > v2.key() ? 1 : 0;
+ }
+
+ template <typename Q>
+ int operator ()(const T& v1, const Q& v2 ) const
+ {
+ if ( v1.key() < v2 )
+ return -1;
+ return v1.key() > v2 ? 1 : 0;
+ }
+
+ template <typename Q>
+ int operator ()(const Q& v1, const T& v2 ) const
+ {
+ if ( v1 < v2.key() )
+ return -1;
+ return v1 > v2.key() ? 1 : 0;
+ }
+ };
+
+ template <typename T>
+ struct equal_to {
+ bool operator ()(const T& v1, const T& v2 ) const
+ {
+ return v1.key() == v2.key();
+ }
+
+ template <typename Q>
+ bool operator ()(const T& v1, const Q& v2 ) const
+ {
+ return v1.key() == v2;
+ }
+
+ template <typename Q>
+ bool operator ()(const Q& v1, const T& v2 ) const
+ {
+ return v1 == v2.key();
+ }
+ };
+
+ struct other_item {
+ int nKey;
+
+ other_item( int n )
+ : nKey(n)
+ {}
+ };
+
+ struct other_less {
+ template <typename T, typename Q>
+ bool operator()( T const& i1, Q const& i2) const
+ {
+ return i1.nKey < i2.nKey;
+ }
+ };
+
+ struct other_equal {
+ template <typename T, typename Q>
+ bool operator()( T const& i1, Q const& i2) const
+ {
+ return i1.nKey == i2.nKey;
+ }
+ };
+
+ struct faked_disposer
+ {
+ template <typename T>
+ void operator ()( T * p )
+ {
+ ++p->s.nDisposeCount;
+ }
+ };
+
+ struct ensure_functor
+ {
+ template <typename T>
+ void operator ()(bool bNew, T& item, T& /*val*/ )
+ {
+ if ( bNew )
+ ++item.s.nEnsureNewCall;
+ else
+ ++item.s.nEnsureExistsCall;
+ }
+ };
+
+ struct find_functor
+ {
+ template <typename T, typename Q>
+ void operator ()( T& item, Q& /*val*/ )
+ {
+ ++item.s.nFindCall;
+ }
+ };
+
+ struct erase_functor
+ {
+ template <typename T>
+ void operator()( T const& item )
+ {
+ item.s.nEraseCall++;
+ }
+ };
+
+ template <class OrdList>
+ void test_int_common()
+ {
+ typedef typename OrdList::value_type value_type;
+
+ value_type v1( 10, 50 );
+ value_type v2( 5, 25 );
+ value_type v3( 20, 100 );
+ {
+ OrdList l;
+ CPPUNIT_ASSERT( l.empty() );
+
+ CPPUNIT_ASSERT( l.insert( v1 )) ; // true
+ CPPUNIT_ASSERT( l.find( v1.key() ));
+
+ CPPUNIT_ASSERT( v1.s.nFindCall == 0 );
+ CPPUNIT_ASSERT( l.find( v1.key(), find_functor() ));
+ CPPUNIT_ASSERT( v1.s.nFindCall == 1 );
+
+ CPPUNIT_ASSERT( !l.find_with( v2.key(), less<value_type>() ));
+ CPPUNIT_ASSERT( !l.find( v3.key(), find_functor() ));
+ CPPUNIT_ASSERT( !l.empty() );
+
+ //CPPUNIT_ASSERT( !l.insert( v1 )) ; // assertion "is_empty" is raised
+
+ {
+ value_type v( v1 );
+ CPPUNIT_ASSERT( !l.insert( v )) ; // false
+ }
+
+ std::pair<bool, bool> ret = l.ensure( v2, ensure_functor() );
+ CPPUNIT_ASSERT( ret.first );
+ CPPUNIT_ASSERT( ret.second );
+ CPPUNIT_ASSERT( v2.s.nEnsureNewCall == 1 );
+ CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == 0 );
+
+ //CPPUNIT_ASSERT( !l.insert( v2 )) ; // assertion "is_empty"
+
+ CPPUNIT_ASSERT( l.find( v1.key() )) ; // true
+
+ CPPUNIT_ASSERT( v1.s.nFindCall == 1 );
+ CPPUNIT_ASSERT( l.find( v1.key(), find_functor() ));
+ CPPUNIT_ASSERT( v1.s.nFindCall == 2 );
+
+ CPPUNIT_ASSERT( l.find( v2.key() ));
+
+ CPPUNIT_ASSERT( v2.s.nFindCall == 0 );
+ CPPUNIT_ASSERT( l.find_with( v2.key(), less<value_type>(), find_functor() ));
+ CPPUNIT_ASSERT( v2.s.nFindCall == 1 );
+
+ CPPUNIT_ASSERT( !l.find( v3.key() ));
+
+ {
+ CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == 0 );
+ CPPUNIT_ASSERT( v2.s.nEnsureNewCall == 1 );
+
+ value_type v( v2 );
+ ret = l.ensure( v, ensure_functor() );
+
+ CPPUNIT_ASSERT( ret.first );
+ CPPUNIT_ASSERT( !ret.second );
+ CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == 1 );
+ CPPUNIT_ASSERT( v2.s.nEnsureNewCall == 1 );
+ CPPUNIT_ASSERT( v.s.nEnsureExistsCall == 0 );
+ CPPUNIT_ASSERT( v.s.nEnsureNewCall == 0 );
+ }
+
+ CPPUNIT_ASSERT( !l.empty() );
+
+ CPPUNIT_ASSERT( l.insert( v3 )) ; // true
+ CPPUNIT_ASSERT( l.find( v3.key() ));
+
+ CPPUNIT_ASSERT( v3.s.nFindCall == 0 );
+ CPPUNIT_ASSERT( l.find( v3.key(), find_functor() ));
+ CPPUNIT_ASSERT( v3.s.nFindCall == 1 );
+
+ CPPUNIT_ASSERT( l.unlink( v2 ) );
+ CPPUNIT_ASSERT( l.find( v1.key() )) ; // true
+ CPPUNIT_ASSERT( !l.find( v2.key() )) ; // true
+ CPPUNIT_ASSERT( l.find( v3.key() )) ; // true
+ CPPUNIT_ASSERT( !l.empty() );
+ CPPUNIT_ASSERT( !l.unlink( v2 ) );
+
+ {
+ // v1 key is in the list but v NODE is not in the list
+ value_type v( v1 );
+ CPPUNIT_ASSERT( !l.unlink( v ) );
+ }
+
+ CPPUNIT_ASSERT( l.unlink( v1 ) );
+ CPPUNIT_ASSERT( !l.unlink( v1 ) );
+ CPPUNIT_ASSERT( !l.find( v1.key() ));
+ CPPUNIT_ASSERT( !l.find( v2.key() ));
+ CPPUNIT_ASSERT( l.find( v3.key() ));
+ CPPUNIT_ASSERT( !l.empty() );
+ CPPUNIT_ASSERT( !l.unlink( v1 ) );
+ CPPUNIT_ASSERT( !l.unlink( v2 ) );
+
+ CPPUNIT_ASSERT( l.unlink( v3 ) );
+ CPPUNIT_ASSERT( !l.find( v1.key() ));
+ CPPUNIT_ASSERT( !l.find_with( v2.key(), less<value_type>() ));
+ CPPUNIT_ASSERT( !l.find( v3.key() ));
+ CPPUNIT_ASSERT( l.empty() );
+ CPPUNIT_ASSERT( !l.unlink( v1 ) );
+ CPPUNIT_ASSERT( !l.unlink( v2 ) );
+ CPPUNIT_ASSERT( !l.unlink( v3 ) );
+
+ // Apply retired pointer to clean links
+ OrdList::gc::force_dispose();
+
+ stat s( v3.s );
+ ret = l.ensure( v3, ensure_functor() );
+ CPPUNIT_ASSERT( ret.first );
+ CPPUNIT_ASSERT( ret.second );
+ CPPUNIT_ASSERT( v3.s.nEnsureNewCall == s.nEnsureNewCall + 1);
+ CPPUNIT_ASSERT( v3.s.nEnsureExistsCall == s.nEnsureExistsCall );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ s = v2.s;
+ ret = l.ensure( v2, ensure_functor() );
+ CPPUNIT_ASSERT( ret.first );
+ CPPUNIT_ASSERT( ret.second );
+ CPPUNIT_ASSERT( v2.s.nEnsureNewCall == s.nEnsureNewCall + 1);
+ CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == s.nEnsureExistsCall );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ s = v1.s;
+ ret = l.ensure( v1, ensure_functor() );
+ CPPUNIT_ASSERT( ret.first );
+ CPPUNIT_ASSERT( ret.second );
+ CPPUNIT_ASSERT( v1.s.nEnsureNewCall == s.nEnsureNewCall + 1);
+ CPPUNIT_ASSERT( v1.s.nEnsureExistsCall == s.nEnsureExistsCall );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ // Erase test
+ CPPUNIT_ASSERT( l.erase( v1.key()) );
+ //CPPUNIT_ASSERT( v1.s.nDisposeCount == 0 );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ CPPUNIT_ASSERT( v2.s.nEraseCall == 0 );
+ CPPUNIT_ASSERT( l.erase_with( v2.key(), less<value_type>(), erase_functor()) );
+ CPPUNIT_ASSERT( v2.s.nEraseCall == 1 );
+ CPPUNIT_ASSERT( !l.erase_with( v2.key(), less<value_type>()));
+ CPPUNIT_ASSERT( v2.s.nEraseCall == 1 );
+ //CPPUNIT_ASSERT( v2.s.nDisposeCount == 0 );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ CPPUNIT_ASSERT( !l.erase( v2 ));
+ CPPUNIT_ASSERT( !l.erase( v1 ));
+ //CPPUNIT_ASSERT( v2.s.nDisposeCount == 0 );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ CPPUNIT_ASSERT( v3.s.nEraseCall == 0 );
+ CPPUNIT_ASSERT( l.erase( v3, erase_functor() ));
+ CPPUNIT_ASSERT( v3.s.nEraseCall == 1 );
+ //CPPUNIT_ASSERT( v3.s.nDisposeCount == 0 );
+ CPPUNIT_ASSERT( l.empty() );
+
+ // Apply retired pointer to clean links
+ OrdList::gc::force_dispose();
+
+ // Unlink test
+ CPPUNIT_ASSERT( l.insert( v1 ));
+ CPPUNIT_ASSERT( l.insert( v3 ));
+ CPPUNIT_ASSERT( !l.empty() );
+ CPPUNIT_ASSERT( !l.unlink( v2 ));
+ CPPUNIT_ASSERT( l.unlink( v1 ));
+ CPPUNIT_ASSERT( !l.unlink( v1 ));
+ CPPUNIT_ASSERT( l.unlink( v3 ));
+ CPPUNIT_ASSERT( !l.unlink( v3 ));
+ CPPUNIT_ASSERT( l.empty() );
+
+ // Apply retired pointer
+ OrdList::gc::force_dispose();
+ CPPUNIT_ASSERT( v1.s.nDisposeCount == 3 );
+ CPPUNIT_ASSERT( v2.s.nDisposeCount == 2 );
+ CPPUNIT_ASSERT( v3.s.nDisposeCount == 3 );
+
+ // Destructor test (call disposer)
+ CPPUNIT_ASSERT( l.insert( v1 ));
+ CPPUNIT_ASSERT( l.insert( v3 ));
+ CPPUNIT_ASSERT( l.insert( v2 ));
+
+ // Iterator test
+ {
+ typename OrdList::iterator it = l.begin();
+ typename OrdList::const_iterator cit = l.cbegin();
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it != l.cend() );
+ CPPUNIT_ASSERT( cit != l.end() );
+ CPPUNIT_ASSERT( cit != l.cend() );
+ CPPUNIT_ASSERT( cit == it );
+
+ CPPUNIT_ASSERT( it->nKey == v2.nKey );
+ CPPUNIT_ASSERT( it->nVal == v2.nVal );
+ CPPUNIT_ASSERT( ++it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == v1.nKey );
+ CPPUNIT_ASSERT( it->nVal == v1.nVal );
+ CPPUNIT_ASSERT( ++it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == v3.nKey );
+ CPPUNIT_ASSERT( it->nVal == v3.nVal );
+ CPPUNIT_ASSERT( ++it == l.end() );
+ }
+
+ {
+ OrdList const & lref = l;
+ typename OrdList::const_iterator it = lref.begin();
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == v2.nKey );
+ CPPUNIT_ASSERT( it->nVal == v2.nVal );
+ CPPUNIT_ASSERT( ++it != lref.end() );
+ CPPUNIT_ASSERT( it->nKey == v1.nKey );
+ CPPUNIT_ASSERT( it->nVal == v1.nVal );
+ CPPUNIT_ASSERT( ++it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == v3.nKey );
+ CPPUNIT_ASSERT( it->nVal == v3.nVal );
+ CPPUNIT_ASSERT( ++it == l.end() );
+ }
+ }
+
+ // Apply retired pointer
+ OrdList::gc::force_dispose();
+
+ CPPUNIT_ASSERT( v1.s.nDisposeCount == 4 );
+ CPPUNIT_ASSERT( v2.s.nDisposeCount == 3 );
+ CPPUNIT_ASSERT( v3.s.nDisposeCount == 4 );
+ }
+
+ template <class OrdList>
+ void test_int()
+ {
+ test_int_common<OrdList>();
+
+ OrdList l;
+ typename OrdList::guarded_ptr gp;
+
+ static int const nLimit = 20;
+ typename OrdList::value_type arrItem[nLimit];
+
+ {
+ int a[nLimit];
+ for (int i = 0; i < nLimit; ++i)
+ a[i]=i;
+ std::random_shuffle( a, a + nLimit );
+
+ for (int i = 0; i < nLimit; ++i) {
+ arrItem[i].nKey = a[i];
+ arrItem[i].nVal = a[i] * 2;
+ }
+
+ // extract/get
+ for ( int i = 0; i < nLimit; ++i )
+ CPPUNIT_ASSERT( l.insert( arrItem[i] ) );
+
+ for ( int i=0; i < nLimit; ++i ) {
+ gp = l.get( arrItem[i].nKey );
+ CPPUNIT_ASSERT( gp );
+ CPPUNIT_ASSERT( !gp.empty());
+ CPPUNIT_ASSERT( gp->nKey == arrItem[i].nKey );
+ CPPUNIT_ASSERT( gp->nVal == arrItem[i].nVal );
+
+ gp = l.extract( arrItem[i].nKey );
+ CPPUNIT_ASSERT( gp );
+ CPPUNIT_ASSERT( !gp.empty());
+ CPPUNIT_ASSERT( gp->nKey == arrItem[i].nKey );
+ CPPUNIT_ASSERT( gp->nVal == arrItem[i].nVal );
+
+ gp = l.get( arrItem[i].nKey );
+ CPPUNIT_ASSERT( !gp );
+ CPPUNIT_ASSERT( gp.empty());
+ CPPUNIT_ASSERT( !l.extract( arrItem[i].nKey ));
+ CPPUNIT_ASSERT( gp.empty());
+ }
+ CPPUNIT_ASSERT( l.empty() );
+ CPPUNIT_ASSERT( !l.get( nLimit/2 ));
+ CPPUNIT_ASSERT( !l.extract( nLimit/2 ));
+
+ // Apply retired pointer
+ OrdList::gc::force_dispose();
+
+ // extract_with/get_with
+ for ( int i = 0; i < nLimit; ++i )
+ CPPUNIT_ASSERT( l.insert( arrItem[i] ) );
+
+ for ( int i=0; i < nLimit; ++i ) {
+ other_item itm( arrItem[i].nKey );
+ gp = l.get_with( itm, other_less() );
+ CPPUNIT_ASSERT( gp );
+ CPPUNIT_ASSERT( !gp.empty());
+ CPPUNIT_ASSERT( gp->nKey == arrItem[i].nKey );
+ CPPUNIT_ASSERT( gp->nVal == arrItem[i].nVal );
+
+ gp = l.extract_with( itm, other_less() );
+ CPPUNIT_ASSERT( gp );
+ CPPUNIT_ASSERT( !gp.empty());
+ CPPUNIT_ASSERT( gp->nKey == arrItem[i].nKey );
+ CPPUNIT_ASSERT( gp->nVal == arrItem[i].nVal );
+
+ gp = l.get_with( itm, other_less() );
+ CPPUNIT_ASSERT( !gp );
+ CPPUNIT_ASSERT( gp.empty());
+ CPPUNIT_ASSERT( !l.extract_with( itm, other_less() ));
+ CPPUNIT_ASSERT( gp.empty());
+ }
+ CPPUNIT_ASSERT( l.empty() );
+ CPPUNIT_ASSERT( !l.get_with( other_item(nLimit/2), other_less() ));
+ CPPUNIT_ASSERT( gp.empty());
+ CPPUNIT_ASSERT( !l.extract_with( other_item(nLimit/2), other_less() ));
+ CPPUNIT_ASSERT( gp.empty());
+
+ // Apply retired pointer
+ OrdList::gc::force_dispose();
+
+ for ( int i=0; i < nLimit; i++ ) {
+ CPPUNIT_ASSERT( arrItem[i].s.nDisposeCount == 2 );
+ }
+ }
+ }
+
+ template <class OrdList>
+ void test_rcu_int()
+ {
+ test_int_common<OrdList>();
+
+ OrdList l;
+ static int const nLimit = 20;
+ typename OrdList::value_type arrItem[nLimit];
+
+ typedef typename OrdList::rcu_lock rcu_lock;
+ typedef typename OrdList::value_type value_type;
+ typedef typename OrdList::gc rcu_type;
+
+ {
+ int a[nLimit];
+ for (int i = 0; i < nLimit; ++i)
+ a[i]=i;
+ std::random_shuffle( a, a + nLimit );
+
+ for (int i = 0; i < nLimit; ++i) {
+ arrItem[i].nKey = a[i];
+ arrItem[i].nVal = a[i] * 2;
+ }
+
+ typename OrdList::exempt_ptr ep;
+
+ // extract/get
+ for ( int i = 0; i < nLimit; ++i )
+ CPPUNIT_ASSERT( l.insert( arrItem[i] ) );
+
+ for ( int i = 0; i < nLimit; ++i ) {
+ {
+ rcu_lock lock;
+ value_type * pGet = l.get( a[i] );
+ CPPUNIT_ASSERT( pGet != nullptr );
+ CPPUNIT_CHECK( pGet->nKey == a[i] );
+ CPPUNIT_CHECK( pGet->nVal == a[i] * 2 );
+
+ ep = l.extract( a[i] );
+ CPPUNIT_ASSERT( ep );
+ CPPUNIT_ASSERT( !ep.empty() );
+ CPPUNIT_CHECK( ep->nKey == a[i] );
+ CPPUNIT_CHECK( (*ep).nVal == a[i] * 2 );
+ }
+ ep.release();
+ {
+ rcu_lock lock;
+ CPPUNIT_CHECK( l.get( a[i] ) == nullptr );
+ CPPUNIT_CHECK( !l.extract( a[i] ) );
+ CPPUNIT_CHECK( ep.empty() );
+ }
+ }
+ CPPUNIT_ASSERT( l.empty() );
+
+ {
+ rcu_lock lock;
+ CPPUNIT_CHECK( l.get( a[0] ) == nullptr );
+ ep = l.extract( a[0] );
+ CPPUNIT_CHECK( !ep );
+ CPPUNIT_CHECK( ep.empty() );
+ }
+ // Apply retired pointer
+ OrdList::gc::force_dispose();
+
+ // extract_with/get_with
+ for ( int i = 0; i < nLimit; ++i ) {
+ CPPUNIT_ASSERT( l.insert( arrItem[i] ) );
+ }
+
+ for ( int i = 0; i < nLimit; ++i ) {
+ other_item itm( a[i] );
+ {
+ rcu_lock lock;
+ value_type * pGet = l.get_with( itm, other_less() );
+ CPPUNIT_ASSERT( pGet != nullptr );
+ CPPUNIT_CHECK( pGet->nKey == a[i] );
+ CPPUNIT_CHECK( pGet->nVal == a[i] * 2 );
+
+ ep = l.extract_with( itm, other_less() );
+ CPPUNIT_ASSERT( ep );
+ CPPUNIT_ASSERT( !ep.empty() );
+ CPPUNIT_CHECK( ep->nKey == a[i] );
+ CPPUNIT_CHECK( ep->nVal == a[i] * 2 );
+ }
+ ep.release();
+ {
+ rcu_lock lock;
+ CPPUNIT_CHECK( l.get_with( itm, other_less() ) == nullptr );
+ ep = l.extract_with( itm, other_less() );
+ CPPUNIT_CHECK( !ep );
+ CPPUNIT_CHECK( ep.empty() );
+ }
+ }
+ CPPUNIT_ASSERT( l.empty() );
+
+ {
+ rcu_lock lock;
+ CPPUNIT_CHECK( l.get_with( other_item( 0 ), other_less() ) == nullptr );
+ CPPUNIT_CHECK( !l.extract_with( other_item(0), other_less() ));
+ CPPUNIT_CHECK( ep.empty() );
+ }
+ // Apply retired pointer
+ OrdList::gc::force_dispose();
+ }
+ }
+
+ template <class OrdList>
+ void test_nogc_int()
+ {
+ typedef typename OrdList::value_type value_type;
+
+ {
+ value_type v1( 10, 50 );
+ value_type v2( 5, 25 );
+ value_type v3( 20, 100 );
+ {
+ OrdList l;
+ CPPUNIT_ASSERT( l.empty() );
+
+ CPPUNIT_ASSERT( l.insert( v1 )) ; // true
+ CPPUNIT_ASSERT( l.find( v1.key() ) == &v1 );
+
+ CPPUNIT_ASSERT( v1.s.nFindCall == 0 );
+ CPPUNIT_ASSERT( l.find( v1.key(), find_functor() ));
+ CPPUNIT_ASSERT( v1.s.nFindCall == 1 );
+
+ CPPUNIT_ASSERT( l.find_with( v2.key(), less<value_type>() ) == nullptr );
+ CPPUNIT_ASSERT( l.find( v3.key() ) == nullptr );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ //CPPUNIT_ASSERT( !l.insert( v1 )) ; // assertion "is_empty" is raised
+
+ {
+ value_type v( v1 );
+ CPPUNIT_ASSERT( !l.insert( v )) ; // false
+ }
+
+ std::pair<bool, bool> ret = l.ensure( v2, ensure_functor() );
+ CPPUNIT_ASSERT( ret.first );
+ CPPUNIT_ASSERT( ret.second );
+ CPPUNIT_ASSERT( v2.s.nEnsureNewCall == 1 );
+ CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == 0 );
+
+ //CPPUNIT_ASSERT( !l.insert( v2 )) ; // assertion "is_empty"
+
+ CPPUNIT_ASSERT( l.find( v1.key() ) == &v1 ) ; // true
+
+ CPPUNIT_ASSERT( v1.s.nFindCall == 1 );
+ CPPUNIT_ASSERT( l.find( v1.key(), find_functor() ));
+ CPPUNIT_ASSERT( v1.s.nFindCall == 2 );
+
+ CPPUNIT_ASSERT( l.find_with( v2.key(), less<value_type>() ) == &v2 );
+
+ CPPUNIT_ASSERT( v2.s.nFindCall == 0 );
+ CPPUNIT_ASSERT( l.find_with( v2.key(), less<value_type>(), find_functor() ));
+ CPPUNIT_ASSERT( v2.s.nFindCall == 1 );
+
+ CPPUNIT_ASSERT( !l.find( v3.key() ));
+
+ {
+ value_type v( v2 );
+ ret = l.ensure( v, ensure_functor() );
+
+ CPPUNIT_ASSERT( ret.first );
+ CPPUNIT_ASSERT( !ret.second );
+ CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == 1 );
+ CPPUNIT_ASSERT( v.s.nEnsureExistsCall == 0 && v.s.nEnsureNewCall == 0 );
+ }
+
+ CPPUNIT_ASSERT( !l.empty() );
+
+ CPPUNIT_ASSERT( l.insert( v3 )) ; // true
+ CPPUNIT_ASSERT( l.find( v3.key() ) == &v3 );
+
+ CPPUNIT_ASSERT( v3.s.nFindCall == 0 );
+ CPPUNIT_ASSERT( l.find( v3.key(), find_functor() ));
+ CPPUNIT_ASSERT( v3.s.nFindCall == 1 );
+
+ {
+ typename OrdList::iterator it = l.begin();
+ typename OrdList::const_iterator cit = l.cbegin();
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it != l.cend() );
+ CPPUNIT_ASSERT( cit != l.end() );
+ CPPUNIT_ASSERT( cit != l.cend() );
+ CPPUNIT_ASSERT( cit == it );
+
+ CPPUNIT_ASSERT( it->nKey == v2.nKey );
+ CPPUNIT_ASSERT( it->nVal == v2.nVal );
+ CPPUNIT_ASSERT( ++it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == v1.nKey );
+ CPPUNIT_ASSERT( it->nVal == v1.nVal );
+ CPPUNIT_ASSERT( it++ != l.end() );
+ CPPUNIT_ASSERT( it->nKey == v3.nKey );
+ CPPUNIT_ASSERT( it->nVal == v3.nVal );
+ CPPUNIT_ASSERT( it++ != l.end() );
+ CPPUNIT_ASSERT( it == l.end() );
+ }
+
+ {
+ OrdList const & lref = l;
+ typename OrdList::const_iterator it = lref.begin();
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == v2.nKey );
+ CPPUNIT_ASSERT( it->nVal == v2.nVal );
+ CPPUNIT_ASSERT( ++it != lref.end() );
+ CPPUNIT_ASSERT( it->nKey == v1.nKey );
+ CPPUNIT_ASSERT( it->nVal == v1.nVal );
+ CPPUNIT_ASSERT( it++ != l.end() );
+ CPPUNIT_ASSERT( it->nKey == v3.nKey );
+ CPPUNIT_ASSERT( it->nVal == v3.nVal );
+ CPPUNIT_ASSERT( it++ != lref.end() );
+ CPPUNIT_ASSERT( it == l.end() );
+ }
+ }
+
+ // Disposer called on list destruction
+ CPPUNIT_ASSERT( v1.s.nDisposeCount == 1 );
+ CPPUNIT_ASSERT( v2.s.nDisposeCount == 1 );
+ CPPUNIT_ASSERT( v3.s.nDisposeCount == 1 );
+ }
+ }
+
+ template <class UnordList>
+ void test_nogc_int_unordered()
+ {
+ typedef typename UnordList::value_type value_type;
+ {
+ value_type v1( 10, 50 );
+ value_type v2( 5, 25 );
+ value_type v3( 20, 100 );
+ {
+ UnordList l;
+ CPPUNIT_ASSERT( l.empty() );
+
+ CPPUNIT_ASSERT( l.insert( v1 )); // true
+ CPPUNIT_ASSERT( l.find( v1.key() ) == &v1 );
+
+ CPPUNIT_ASSERT( v1.s.nFindCall == 0 );
+ CPPUNIT_ASSERT( l.find( v1.key(), find_functor() ));
+ CPPUNIT_ASSERT( v1.s.nFindCall == 1 );
+
+ CPPUNIT_ASSERT( l.find_with( v2.key(), equal_to<value_type>() ) == nullptr );
+ CPPUNIT_ASSERT( l.find( v3.key() ) == nullptr );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ //CPPUNIT_ASSERT( !l.insert( v1 )) ; // assertion "is_empty" is raised
+
+ {
+ value_type v( v1 );
+ CPPUNIT_ASSERT( !l.insert( v )) ; // false
+ }
+
+ std::pair<bool, bool> ret = l.ensure( v2, ensure_functor() );
+ CPPUNIT_ASSERT( ret.first );
+ CPPUNIT_ASSERT( ret.second );
+ CPPUNIT_ASSERT( v2.s.nEnsureNewCall == 1 );
+ CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == 0 );
+
+ //CPPUNIT_ASSERT( !l.insert( v2 )) ; // assertion "is_empty"
+
+ CPPUNIT_ASSERT( l.find( v1.key() ) == &v1 ) ; // true
+
+ CPPUNIT_ASSERT( v1.s.nFindCall == 1 );
+ CPPUNIT_ASSERT( l.find( v1.key(), find_functor() ));
+ CPPUNIT_ASSERT( v1.s.nFindCall == 2 );
+
+ CPPUNIT_ASSERT( l.find_with( v2.key(), equal_to<value_type>() ) == &v2 );
+
+ CPPUNIT_ASSERT( v2.s.nFindCall == 0 );
+ CPPUNIT_ASSERT( l.find_with( v2.key(), equal_to<value_type>(), find_functor() ));
+ CPPUNIT_ASSERT( v2.s.nFindCall == 1 );
+
+ CPPUNIT_ASSERT( !l.find( v3.key() ));
+
+ {
+ value_type v( v2 );
+ ret = l.ensure( v, ensure_functor() );
+
+ CPPUNIT_ASSERT( ret.first );
+ CPPUNIT_ASSERT( !ret.second );
+ CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == 1 );
+ CPPUNIT_ASSERT( v.s.nEnsureExistsCall == 0 && v.s.nEnsureNewCall == 0 );
+ }
+
+ CPPUNIT_ASSERT( !l.empty() );
+
+ CPPUNIT_ASSERT( l.insert( v3 )) ; // true
+ CPPUNIT_ASSERT( l.find( v3.key() ) == &v3 );
+
+ CPPUNIT_ASSERT( v3.s.nFindCall == 0 );
+ CPPUNIT_ASSERT( l.find( v3.key(), find_functor() ));
+ CPPUNIT_ASSERT( v3.s.nFindCall == 1 );
+
+ {
+ typename UnordList::iterator it = l.begin();
+ typename UnordList::const_iterator cit = l.cbegin();
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it != l.cend() );
+ CPPUNIT_ASSERT( cit != l.end() );
+ CPPUNIT_ASSERT( cit != l.cend() );
+ CPPUNIT_ASSERT( cit == it );
+
+ CPPUNIT_ASSERT( it->nKey == v1.nKey );
+ CPPUNIT_ASSERT( it->nVal == v1.nVal );
+ CPPUNIT_ASSERT( ++it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == v2.nKey );
+ CPPUNIT_ASSERT( it->nVal == v2.nVal );
+ CPPUNIT_ASSERT( it++ != l.end() );
+ CPPUNIT_ASSERT( it->nKey == v3.nKey );
+ CPPUNIT_ASSERT( it->nVal == v3.nVal );
+ CPPUNIT_ASSERT( it++ != l.end() );
+ CPPUNIT_ASSERT( it == l.end() );
+ }
+
+ {
+ UnordList const & lref = l;
+ typename UnordList::const_iterator it = lref.begin();
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == v1.nKey );
+ CPPUNIT_ASSERT( it->nVal == v1.nVal );
+ CPPUNIT_ASSERT( ++it != lref.end() );
+ CPPUNIT_ASSERT( it->nKey == v2.nKey );
+ CPPUNIT_ASSERT( it->nVal == v2.nVal );
+ CPPUNIT_ASSERT( it++ != l.end() );
+ CPPUNIT_ASSERT( it->nKey == v3.nKey );
+ CPPUNIT_ASSERT( it->nVal == v3.nVal );
+ CPPUNIT_ASSERT( it++ != lref.end() );
+ CPPUNIT_ASSERT( it == l.end() );
+ }
+ }
+
+ // Disposer called on list destruction
+ CPPUNIT_ASSERT( v1.s.nDisposeCount == 1 );
+ CPPUNIT_ASSERT( v2.s.nDisposeCount == 1 );
+ CPPUNIT_ASSERT( v3.s.nDisposeCount == 1 );
+ }
+ }
+
+
+ void HP_base_cmp();
+ void HP_base_less();
+ void HP_base_cmpmix();
+ void HP_base_ic();
+ void HP_member_cmp();
+ void HP_member_less();
+ void HP_member_cmpmix();
+ void HP_member_ic();
+
+ void DHP_base_cmp();
+ void DHP_base_less();
+ void DHP_base_cmpmix();
+ void DHP_base_ic();
+ void DHP_member_cmp();
+ void DHP_member_less();
+ void DHP_member_cmpmix();
+ void DHP_member_ic();
+
+ void RCU_GPI_base_cmp();
+ void RCU_GPI_base_less();
+ void RCU_GPI_base_cmpmix();
+ void RCU_GPI_base_ic();
+ void RCU_GPI_member_cmp();
+ void RCU_GPI_member_less();
+ void RCU_GPI_member_cmpmix();
+ void RCU_GPI_member_ic();
+
+ void RCU_GPB_base_cmp();
+ void RCU_GPB_base_less();
+ void RCU_GPB_base_cmpmix();
+ void RCU_GPB_base_ic();
+ void RCU_GPB_member_cmp();
+ void RCU_GPB_member_less();
+ void RCU_GPB_member_cmpmix();
+ void RCU_GPB_member_ic();
+
+ void RCU_GPT_base_cmp();
+ void RCU_GPT_base_less();
+ void RCU_GPT_base_cmpmix();
+ void RCU_GPT_base_ic();
+ void RCU_GPT_member_cmp();
+ void RCU_GPT_member_less();
+ void RCU_GPT_member_cmpmix();
+ void RCU_GPT_member_ic();
+
+ void RCU_SHB_base_cmp();
+ void RCU_SHB_base_less();
+ void RCU_SHB_base_cmpmix();
+ void RCU_SHB_base_ic();
+ void RCU_SHB_member_cmp();
+ void RCU_SHB_member_less();
+ void RCU_SHB_member_cmpmix();
+ void RCU_SHB_member_ic();
+
+ void RCU_SHT_base_cmp();
+ void RCU_SHT_base_less();
+ void RCU_SHT_base_cmpmix();
+ void RCU_SHT_base_ic();
+ void RCU_SHT_member_cmp();
+ void RCU_SHT_member_less();
+ void RCU_SHT_member_cmpmix();
+ void RCU_SHT_member_ic();
+
+ void nogc_base_cmp();
+ void nogc_base_less();
+ void nogc_base_cmpmix();
+ void nogc_base_ic();
+ void nogc_member_cmp();
+ void nogc_member_less();
+ void nogc_member_cmpmix();
+ void nogc_member_ic();
+
+ void nogc_base_cmp_unord();
+ void nogc_base_less_unord();
+ void nogc_base_equal_to_unord();
+ void nogc_base_cmpmix_unord();
+ void nogc_base_equal_to_mix_unord();
+ void nogc_base_ic_unord();
+ void nogc_member_cmp_unord();
+ void nogc_member_less_unord();
+ void nogc_member_equal_to_unord();
+ void nogc_member_cmpmix_unord();
+ void nogc_member_equal_to_mix_unord();
+ void nogc_member_ic_unord();
+
+ CPPUNIT_TEST_SUITE(IntrusiveLazyListHeaderTest)
+ CPPUNIT_TEST(HP_base_cmp)
+ CPPUNIT_TEST(HP_base_less)
+ CPPUNIT_TEST(HP_base_cmpmix)
+ CPPUNIT_TEST(HP_base_ic)
+ CPPUNIT_TEST(HP_member_cmp)
+ CPPUNIT_TEST(HP_member_less)
+ CPPUNIT_TEST(HP_member_cmpmix)
+ CPPUNIT_TEST(HP_member_ic)
+
+ CPPUNIT_TEST(DHP_base_cmp)
+ CPPUNIT_TEST(DHP_base_less)
+ CPPUNIT_TEST(DHP_base_cmpmix)
+ CPPUNIT_TEST(DHP_base_ic)
+ CPPUNIT_TEST(DHP_member_cmp)
+ CPPUNIT_TEST(DHP_member_less)
+ CPPUNIT_TEST(DHP_member_cmpmix)
+ CPPUNIT_TEST(DHP_member_ic)
+
+ CPPUNIT_TEST(RCU_GPI_base_cmp)
+ CPPUNIT_TEST(RCU_GPI_base_less)
+ CPPUNIT_TEST(RCU_GPI_base_cmpmix)
+ CPPUNIT_TEST(RCU_GPI_base_ic)
+ CPPUNIT_TEST(RCU_GPI_member_cmp)
+ CPPUNIT_TEST(RCU_GPI_member_less)
+ CPPUNIT_TEST(RCU_GPI_member_cmpmix)
+ CPPUNIT_TEST(RCU_GPI_member_ic)
+
+ CPPUNIT_TEST(RCU_GPB_base_cmp)
+ CPPUNIT_TEST(RCU_GPB_base_less)
+ CPPUNIT_TEST(RCU_GPB_base_cmpmix)
+ CPPUNIT_TEST(RCU_GPB_base_ic)
+ CPPUNIT_TEST(RCU_GPB_member_cmp)
+ CPPUNIT_TEST(RCU_GPB_member_less)
+ CPPUNIT_TEST(RCU_GPB_member_cmpmix)
+ CPPUNIT_TEST(RCU_GPB_member_ic)
+
+ CPPUNIT_TEST(RCU_GPT_base_cmp)
+ CPPUNIT_TEST(RCU_GPT_base_less)
+ CPPUNIT_TEST(RCU_GPT_base_cmpmix)
+ CPPUNIT_TEST(RCU_GPT_base_ic)
+ CPPUNIT_TEST(RCU_GPT_member_cmp)
+ CPPUNIT_TEST(RCU_GPT_member_less)
+ CPPUNIT_TEST(RCU_GPT_member_cmpmix)
+ CPPUNIT_TEST(RCU_GPT_member_ic)
+
+ CPPUNIT_TEST(RCU_SHB_base_cmp)
+ CPPUNIT_TEST(RCU_SHB_base_less)
+ CPPUNIT_TEST(RCU_SHB_base_cmpmix)
+ CPPUNIT_TEST(RCU_SHB_base_ic)
+ CPPUNIT_TEST(RCU_SHB_member_cmp)
+ CPPUNIT_TEST(RCU_SHB_member_less)
+ CPPUNIT_TEST(RCU_SHB_member_cmpmix)
+ CPPUNIT_TEST(RCU_SHB_member_ic)
+
+ CPPUNIT_TEST(RCU_SHT_base_cmp)
+ CPPUNIT_TEST(RCU_SHT_base_less)
+ CPPUNIT_TEST(RCU_SHT_base_cmpmix)
+ CPPUNIT_TEST(RCU_SHT_base_ic)
+ CPPUNIT_TEST(RCU_SHT_member_cmp)
+ CPPUNIT_TEST(RCU_SHT_member_less)
+ CPPUNIT_TEST(RCU_SHT_member_cmpmix)
+ CPPUNIT_TEST(RCU_SHT_member_ic)
+
+ CPPUNIT_TEST(nogc_base_cmp)
+ CPPUNIT_TEST(nogc_base_less)
+ CPPUNIT_TEST(nogc_base_cmpmix)
+ CPPUNIT_TEST(nogc_base_ic)
+ CPPUNIT_TEST(nogc_member_cmp)
+ CPPUNIT_TEST(nogc_member_less)
+ CPPUNIT_TEST(nogc_member_cmpmix)
+ CPPUNIT_TEST(nogc_member_ic)
+
+ CPPUNIT_TEST(nogc_base_cmp_unord)
+ CPPUNIT_TEST(nogc_base_less_unord)
+ CPPUNIT_TEST(nogc_base_equal_to_unord)
+ CPPUNIT_TEST(nogc_base_cmpmix_unord)
+ CPPUNIT_TEST(nogc_base_equal_to_mix_unord)
+ CPPUNIT_TEST(nogc_base_ic_unord)
+ CPPUNIT_TEST(nogc_member_cmp_unord)
+ CPPUNIT_TEST(nogc_member_less_unord)
+ CPPUNIT_TEST(nogc_member_equal_to_unord)
+ CPPUNIT_TEST(nogc_member_cmpmix_unord)
+ CPPUNIT_TEST(nogc_member_equal_to_mix_unord)
+ CPPUNIT_TEST(nogc_member_ic_unord)
+
+ CPPUNIT_TEST_SUITE_END()
+ };
+} // namespace ordlist
+
+#endif // #ifndef CDSTEST_HDR_INTRUSIVE_LAZY_H
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_intrusive_lazy.h"
+#include <cds/intrusive/lazy_list_dhp.h>
+
+namespace ordlist {
+ void IntrusiveLazyListHeaderTest::DHP_base_cmp()
+ {
+ typedef base_int_item< cds::gc::DHP > item;
+ struct traits : public ci::lazy_list::traits
+ {
+ typedef ci::lazy_list::base_hook< co::gc<cds::gc::DHP> > hook;
+ typedef cmp<item> compare;
+ typedef faked_disposer disposer;
+ };
+ typedef ci::LazyList< cds::gc::DHP, item, traits > list;
+ test_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::DHP_base_less()
+ {
+ typedef base_int_item< cds::gc::DHP > item;
+ typedef ci::LazyList< cds::gc::DHP
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::DHP> > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::DHP_base_cmpmix()
+ {
+ typedef base_int_item< cds::gc::DHP > item;
+ typedef ci::LazyList< cds::gc::DHP
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::DHP> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::DHP_base_ic()
+ {
+ typedef base_int_item< cds::gc::DHP > item;
+ typedef ci::LazyList< cds::gc::DHP
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::DHP> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::DHP_member_cmp()
+ {
+ typedef member_int_item< cds::gc::DHP > item;
+ typedef ci::LazyList< cds::gc::DHP
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<cds::gc::DHP>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::DHP_member_less()
+ {
+ typedef member_int_item< cds::gc::DHP > item;
+ typedef ci::LazyList< cds::gc::DHP
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<cds::gc::DHP>
+ > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::DHP_member_cmpmix()
+ {
+ typedef member_int_item< cds::gc::DHP > item;
+ typedef ci::LazyList< cds::gc::DHP
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<cds::gc::DHP>
+ > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::DHP_member_ic()
+ {
+ typedef member_int_item< cds::gc::DHP > item;
+ typedef ci::LazyList< cds::gc::DHP
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<cds::gc::DHP>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_int<list>();
+ }
+
+} // namespace ordlist
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_intrusive_lazy.h"
+#include <cds/intrusive/lazy_list_hp.h>
+
+namespace ordlist {
+ void IntrusiveLazyListHeaderTest::HP_base_cmp()
+ {
+ typedef base_int_item< cds::gc::HP > item;
+ struct traits : public ci::lazy_list::traits
+ {
+ typedef ci::lazy_list::base_hook< co::gc<cds::gc::HP> > hook;
+ typedef cmp<item> compare;
+ typedef faked_disposer disposer;
+ };
+ typedef ci::LazyList< cds::gc::HP, item, traits > list;
+ test_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::HP_base_less()
+ {
+ typedef base_int_item< cds::gc::HP > item;
+ typedef ci::LazyList< cds::gc::HP
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::HP> > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::HP_base_cmpmix()
+ {
+ typedef base_int_item< cds::gc::HP > item;
+ typedef ci::LazyList< cds::gc::HP
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::HP> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::HP_base_ic()
+ {
+ typedef base_int_item< cds::gc::HP > item;
+ typedef ci::LazyList< cds::gc::HP
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::HP> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::HP_member_cmp()
+ {
+ typedef member_int_item< cds::gc::HP > item;
+ typedef ci::LazyList< cds::gc::HP
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<cds::gc::HP>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::HP_member_less()
+ {
+ typedef member_int_item< cds::gc::HP > item;
+ struct traits : public ci::lazy_list::traits
+ {
+ typedef ci::lazy_list::member_hook< offsetof( item, hMember ), co::gc<cds::gc::HP>> hook;
+ typedef IntrusiveLazyListHeaderTest::less<item> less;
+ typedef faked_disposer disposer;
+ };
+ typedef ci::LazyList< cds::gc::HP, item, traits > list;
+ test_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::HP_member_cmpmix()
+ {
+ typedef member_int_item< cds::gc::HP > item;
+ typedef ci::LazyList< cds::gc::HP
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<cds::gc::HP>
+ > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::HP_member_ic()
+ {
+ typedef member_int_item< cds::gc::HP > item;
+ typedef ci::LazyList< cds::gc::HP
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<cds::gc::HP>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_int<list>();
+ }
+} // namespace ordlist
+
+CPPUNIT_TEST_SUITE_REGISTRATION(ordlist::IntrusiveLazyListHeaderTest);
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_intrusive_lazy.h"
+#include <cds/intrusive/lazy_list_nogc.h>
+
+namespace ordlist {
+ void IntrusiveLazyListHeaderTest::nogc_base_cmp()
+ {
+ typedef base_int_item< cds::gc::nogc > item;
+ struct traits : public ci::lazy_list::traits {
+ typedef ci::lazy_list::base_hook< co::gc<cds::gc::nogc> > hook;
+ typedef cmp<item> compare;
+ typedef faked_disposer disposer;
+ };
+ typedef ci::LazyList< cds::gc::nogc, item, traits > list;
+ test_nogc_int<list>();
+ }
+
+ void IntrusiveLazyListHeaderTest::nogc_base_less()
+ {
+ typedef base_int_item< cds::gc::nogc > item;
+ struct traits: public
+ ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::nogc> > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ {};
+ typedef ci::LazyList< cds::gc::nogc, item, traits > list;
+ test_nogc_int<list>();
+ }
+
+ void IntrusiveLazyListHeaderTest::nogc_base_cmpmix()
+ {
+ typedef base_int_item< cds::gc::nogc > item;
+ typedef ci::LazyList< cds::gc::nogc
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::nogc> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_nogc_int<list>();
+ }
+
+ void IntrusiveLazyListHeaderTest::nogc_base_ic()
+ {
+ typedef base_int_item< cds::gc::nogc > item;
+ typedef ci::LazyList< cds::gc::nogc
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::nogc> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_nogc_int<list>();
+ }
+
+ void IntrusiveLazyListHeaderTest::nogc_member_cmp()
+ {
+ typedef member_int_item< cds::gc::nogc > item;
+ typedef ci::LazyList< cds::gc::nogc
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<cds::gc::nogc>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_nogc_int<list>();
+ }
+
+ void IntrusiveLazyListHeaderTest::nogc_member_less()
+ {
+ typedef member_int_item< cds::gc::nogc > item;
+ typedef ci::LazyList< cds::gc::nogc
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<cds::gc::nogc>
+ > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_nogc_int<list>();
+ }
+
+ void IntrusiveLazyListHeaderTest::nogc_member_cmpmix()
+ {
+ typedef member_int_item< cds::gc::nogc > item;
+ typedef ci::LazyList< cds::gc::nogc
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<cds::gc::nogc>
+ > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_nogc_int<list>();
+ }
+
+ void IntrusiveLazyListHeaderTest::nogc_member_ic()
+ {
+ typedef member_int_item< cds::gc::nogc > item;
+ typedef ci::LazyList< cds::gc::nogc
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<cds::gc::nogc>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_nogc_int<list>();
+ }
+
+} // namespace ordlist
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_intrusive_lazy.h"
+#include <cds/intrusive/lazy_list_nogc.h>
+
+namespace ordlist {
+ namespace {
+ typedef IntrusiveLazyListHeaderTest::base_int_item< cds::gc::nogc > base_item;
+ typedef IntrusiveLazyListHeaderTest::member_int_item< cds::gc::nogc > member_item;
+
+ struct cmp_traits : public ci::lazy_list::traits {
+ typedef ci::lazy_list::base_hook< co::gc<cds::gc::nogc> > hook;
+ typedef IntrusiveLazyListHeaderTest::cmp<base_item> compare;
+ typedef IntrusiveLazyListHeaderTest::faked_disposer disposer;
+ static const bool sort = false;
+ };
+
+ struct less_traits: public ci::lazy_list::traits {
+ typedef ci::lazy_list::base_hook< co::gc<cds::gc::nogc> > hook;
+ typedef IntrusiveLazyListHeaderTest::less<base_item> less;
+ typedef IntrusiveLazyListHeaderTest::faked_disposer disposer;
+ static const bool sort = false;
+ };
+
+ struct equal_to_traits: public ci::lazy_list::traits {
+ typedef ci::lazy_list::base_hook< co::gc<cds::gc::nogc> > hook;
+ typedef IntrusiveLazyListHeaderTest::equal_to<base_item> equal_to;
+ typedef IntrusiveLazyListHeaderTest::faked_disposer disposer;
+ static const bool sort = false;
+ };
+
+ typedef ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::nogc> > >
+ ,co::less< IntrusiveLazyListHeaderTest::less<base_item> >
+ ,co::compare< IntrusiveLazyListHeaderTest::cmp<base_item> >
+ ,ci::opt::disposer< IntrusiveLazyListHeaderTest::faked_disposer >
+ ,co::sort< false > >::type cmpmix_traits;
+
+ typedef ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::nogc> > >
+ ,co::compare< IntrusiveLazyListHeaderTest::cmp<base_item> >
+ ,co::equal_to< IntrusiveLazyListHeaderTest::equal_to<base_item> >
+ ,ci::opt::disposer< IntrusiveLazyListHeaderTest::faked_disposer >
+ ,co::sort< false > >::type equal_to_mix_traits;
+
+ typedef ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::nogc> > >
+ ,co::equal_to< IntrusiveLazyListHeaderTest::equal_to<base_item> >
+ ,ci::opt::disposer< IntrusiveLazyListHeaderTest::faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ ,co::sort< false > >::type ic_traits;
+
+ typedef ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( member_item, hMember )
+ ,co::gc<cds::gc::nogc> > >
+ ,co::compare< IntrusiveLazyListHeaderTest::cmp<member_item> >
+ ,ci::opt::disposer< IntrusiveLazyListHeaderTest::faked_disposer >
+ ,co::sort< false > >::type member_cmp_traits;
+
+ typedef ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( member_item, hMember )
+ ,co::gc<cds::gc::nogc> > >
+ ,co::less< IntrusiveLazyListHeaderTest::less<member_item> >
+ ,ci::opt::disposer< IntrusiveLazyListHeaderTest::faked_disposer >
+ ,co::sort< false > >::type member_less_traits;
+
+ typedef ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( member_item, hMember )
+ ,co::gc<cds::gc::nogc> > >
+ ,co::equal_to< IntrusiveLazyListHeaderTest::equal_to<member_item> >
+ ,ci::opt::disposer< IntrusiveLazyListHeaderTest::faked_disposer >
+ ,co::sort< false > >::type member_equal_to_traits;
+
+ typedef ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( member_item, hMember )
+ ,co::gc<cds::gc::nogc> > >
+ ,co::less< IntrusiveLazyListHeaderTest::less<member_item> >
+ ,co::compare< IntrusiveLazyListHeaderTest::cmp<member_item> >
+ ,ci::opt::disposer< IntrusiveLazyListHeaderTest::faked_disposer >
+ ,co::sort< false > >::type member_cmpmix_traits;
+
+ typedef ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( member_item, hMember )
+ ,co::gc<cds::gc::nogc> > >
+ ,co::compare< IntrusiveLazyListHeaderTest::cmp<member_item> >
+ ,co::equal_to< IntrusiveLazyListHeaderTest::equal_to<member_item> >
+ ,ci::opt::disposer< IntrusiveLazyListHeaderTest::faked_disposer >
+ ,co::sort< false > >::type member_equal_to_mix_traits;
+
+ typedef ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( member_item, hMember ),
+ co::gc<cds::gc::nogc> > >
+ ,co::equal_to< IntrusiveLazyListHeaderTest::equal_to<member_item> >
+ ,ci::opt::disposer< IntrusiveLazyListHeaderTest::faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ ,co::sort< false > >::type member_ic_traits;
+
+ }
+ void IntrusiveLazyListHeaderTest::nogc_base_cmp_unord()
+ {
+ typedef ci::LazyList< cds::gc::nogc, base_item, cmp_traits > list;
+ test_nogc_int_unordered<list>();
+ }
+ void IntrusiveLazyListHeaderTest::nogc_base_less_unord()
+ {
+ typedef ci::LazyList< cds::gc::nogc, base_item, less_traits > list;
+ test_nogc_int_unordered<list>();
+ }
+ void IntrusiveLazyListHeaderTest::nogc_base_equal_to_unord()
+ {
+ typedef ci::LazyList< cds::gc::nogc, base_item, equal_to_traits > list;
+ test_nogc_int_unordered<list>();
+ }
+ void IntrusiveLazyListHeaderTest::nogc_base_cmpmix_unord()
+ {
+ typedef ci::LazyList< cds::gc::nogc, base_item, cmpmix_traits > list;
+ test_nogc_int_unordered<list>();
+ }
+ void IntrusiveLazyListHeaderTest::nogc_base_equal_to_mix_unord()
+ {
+ typedef ci::LazyList< cds::gc::nogc, base_item, equal_to_mix_traits > list;
+ test_nogc_int_unordered<list>();
+ }
+ void IntrusiveLazyListHeaderTest::nogc_base_ic_unord()
+ {
+ typedef ci::LazyList< cds::gc::nogc, base_item, ic_traits > list;
+ test_nogc_int_unordered<list>();
+ }
+ void IntrusiveLazyListHeaderTest::nogc_member_cmp_unord()
+ {
+ typedef ci::LazyList< cds::gc::nogc, member_item, member_cmp_traits > list;
+ test_nogc_int_unordered<list>();
+ }
+ void IntrusiveLazyListHeaderTest::nogc_member_less_unord()
+ {
+ typedef ci::LazyList< cds::gc::nogc, member_item, member_less_traits > list;
+ test_nogc_int_unordered<list>();
+ }
+ void IntrusiveLazyListHeaderTest::nogc_member_equal_to_unord()
+ {
+ typedef ci::LazyList< cds::gc::nogc, member_item, member_equal_to_traits > list;
+ test_nogc_int_unordered<list>();
+ }
+ void IntrusiveLazyListHeaderTest::nogc_member_cmpmix_unord()
+ {
+ typedef ci::LazyList< cds::gc::nogc, member_item, member_cmpmix_traits > list;
+ test_nogc_int_unordered<list>();
+ }
+ void IntrusiveLazyListHeaderTest::nogc_member_equal_to_mix_unord()
+ {
+ typedef ci::LazyList< cds::gc::nogc, member_item, member_equal_to_mix_traits > list;
+ test_nogc_int_unordered<list>();
+ }
+ void IntrusiveLazyListHeaderTest::nogc_member_ic_unord()
+ {
+ typedef ci::LazyList< cds::gc::nogc, member_item, member_ic_traits > list;
+ test_nogc_int_unordered<list>();
+ }
+
+} // namespace ordlist
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_intrusive_lazy.h"
+#include <cds/urcu/general_buffered.h>
+#include <cds/intrusive/lazy_list_rcu.h>
+
+namespace ordlist {
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::general_buffered<> > RCU;
+ }
+
+ void IntrusiveLazyListHeaderTest::RCU_GPB_base_cmp()
+ {
+ typedef base_int_item< RCU > item;
+ typedef ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type list_traits;
+ typedef ci::LazyList< RCU, item, list_traits > list;
+
+ test_rcu_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::RCU_GPB_base_less()
+ {
+ typedef base_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::RCU_GPB_base_cmpmix()
+ {
+ typedef base_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::RCU_GPB_base_ic()
+ {
+ typedef base_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::RCU_GPB_member_cmp()
+ {
+ typedef member_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::RCU_GPB_member_less()
+ {
+ typedef member_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::RCU_GPB_member_cmpmix()
+ {
+ typedef member_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::RCU_GPB_member_ic()
+ {
+ typedef member_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+} // namespace ordlist
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_intrusive_lazy.h"
+#include <cds/urcu/general_instant.h>
+#include <cds/intrusive/lazy_list_rcu.h>
+
+namespace ordlist {
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::general_instant<> > RCU;
+ }
+
+ void IntrusiveLazyListHeaderTest::RCU_GPI_base_cmp()
+ {
+ typedef base_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::RCU_GPI_base_less()
+ {
+ typedef base_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::RCU_GPI_base_cmpmix()
+ {
+ typedef base_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::RCU_GPI_base_ic()
+ {
+ typedef base_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::RCU_GPI_member_cmp()
+ {
+ typedef member_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::RCU_GPI_member_less()
+ {
+ typedef member_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::RCU_GPI_member_cmpmix()
+ {
+ typedef member_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::RCU_GPI_member_ic()
+ {
+ typedef member_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+} // namespace ordlist
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_intrusive_lazy.h"
+#include <cds/urcu/general_threaded.h>
+#include <cds/intrusive/lazy_list_rcu.h>
+
+namespace ordlist {
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::general_threaded<> > RCU;
+ }
+
+ void IntrusiveLazyListHeaderTest::RCU_GPT_base_cmp()
+ {
+ typedef base_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::RCU_GPT_base_less()
+ {
+ typedef base_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::RCU_GPT_base_cmpmix()
+ {
+ typedef base_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::RCU_GPT_base_ic()
+ {
+ typedef base_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::RCU_GPT_member_cmp()
+ {
+ typedef member_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::RCU_GPT_member_less()
+ {
+ typedef member_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::RCU_GPT_member_cmpmix()
+ {
+ typedef member_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveLazyListHeaderTest::RCU_GPT_member_ic()
+ {
+ typedef member_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+} // namespace ordlist
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_intrusive_lazy.h"
+#include <cds/urcu/signal_buffered.h>
+#include <cds/intrusive/lazy_list_rcu.h>
+
+namespace ordlist {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::signal_buffered<> > RCU;
+ }
+#endif
+
+ void IntrusiveLazyListHeaderTest::RCU_SHB_base_cmp()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef base_int_item< RCU > item;
+ typedef ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type list_traits;
+ typedef ci::LazyList< RCU, item, list_traits > list;
+
+ test_rcu_int<list>();
+#endif
+ }
+
+ void IntrusiveLazyListHeaderTest::RCU_SHB_base_less()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef base_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+
+ void IntrusiveLazyListHeaderTest::RCU_SHB_base_cmpmix()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef base_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+
+ void IntrusiveLazyListHeaderTest::RCU_SHB_base_ic()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef base_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+
+ void IntrusiveLazyListHeaderTest::RCU_SHB_member_cmp()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef member_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+
+ void IntrusiveLazyListHeaderTest::RCU_SHB_member_less()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef member_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+
+ void IntrusiveLazyListHeaderTest::RCU_SHB_member_cmpmix()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef member_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+
+ void IntrusiveLazyListHeaderTest::RCU_SHB_member_ic()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef member_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+
+} // namespace ordlist
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_intrusive_lazy.h"
+#include <cds/urcu/signal_threaded.h>
+#include <cds/intrusive/lazy_list_rcu.h>
+
+namespace ordlist {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::signal_threaded<> > RCU;
+ }
+#endif
+
+ void IntrusiveLazyListHeaderTest::RCU_SHT_base_cmp()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef base_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+ void IntrusiveLazyListHeaderTest::RCU_SHT_base_less()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef base_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+ void IntrusiveLazyListHeaderTest::RCU_SHT_base_cmpmix()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef base_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+ void IntrusiveLazyListHeaderTest::RCU_SHT_base_ic()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef base_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+ void IntrusiveLazyListHeaderTest::RCU_SHT_member_cmp()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef member_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+ void IntrusiveLazyListHeaderTest::RCU_SHT_member_less()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef member_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+ void IntrusiveLazyListHeaderTest::RCU_SHT_member_cmpmix()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef member_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+ void IntrusiveLazyListHeaderTest::RCU_SHT_member_ic()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef member_int_item< RCU > item;
+ typedef ci::LazyList< RCU
+ ,item
+ ,ci::lazy_list::make_traits<
+ ci::opt::hook< ci::lazy_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+} // namespace ordlist
--- /dev/null
+//$$CDS-header$$
+
+#ifndef CDSTEST_HDR_INTRUSIVE_MICHAEL_H
+#define CDSTEST_HDR_INTRUSIVE_MICHAEL_H
+
+#include "cppunit/cppunit_proxy.h"
+#include <cds/intrusive/details/michael_list_base.h>
+
+namespace ordlist {
+ namespace ci = cds::intrusive;
+ namespace co = cds::opt;
+
+ class IntrusiveMichaelListHeaderTest: public CppUnitMini::TestCase
+ {
+ public:
+
+ struct stat {
+ int nDisposeCount;
+ int nEnsureExistsCall;
+ int nEnsureNewCall;
+ int nFindCall;
+ int nEraseCall;
+
+ stat()
+ : nDisposeCount(0)
+ , nEnsureExistsCall(0)
+ , nEnsureNewCall(0)
+ , nFindCall(0)
+ , nEraseCall(0)
+ {}
+
+ stat( const stat& s )
+ {
+ *this = s;
+ }
+
+ stat& operator =(const stat& s)
+ {
+ memcpy( this, &s, sizeof(s));
+ return *this;
+ }
+ };
+
+ template <typename GC>
+ struct base_int_item: public ci::michael_list::node< GC >
+ {
+ int nKey;
+ int nVal;
+
+ mutable stat s;
+
+ base_int_item()
+ {}
+
+ base_int_item(int key, int val)
+ : nKey( key )
+ , nVal(val)
+ , s()
+ {}
+
+ base_int_item(const base_int_item& v )
+ : nKey( v.nKey )
+ , nVal( v.nVal )
+ , s()
+ {}
+
+ const int& key() const
+ {
+ return nKey;
+ }
+ };
+
+ template <typename GC>
+ struct member_int_item
+ {
+ int nKey;
+ int nVal;
+
+ ci::michael_list::node< GC > hMember;
+
+ mutable stat s;
+
+ member_int_item()
+ {}
+
+ member_int_item(int key, int val)
+ : nKey( key )
+ , nVal(val)
+ , s()
+ {}
+
+ member_int_item(const member_int_item& v )
+ : nKey( v.nKey )
+ , nVal( v.nVal )
+ , s()
+ {}
+
+ const int& key() const
+ {
+ return nKey;
+ }
+ };
+
+ template <typename T>
+ struct less
+ {
+ bool operator ()(const T& v1, const T& v2 ) const
+ {
+ return v1.key() < v2.key();
+ }
+
+ template <typename Q>
+ bool operator ()(const T& v1, const Q& v2 ) const
+ {
+ return v1.key() < v2;
+ }
+
+ template <typename Q>
+ bool operator ()(const Q& v1, const T& v2 ) const
+ {
+ return v1 < v2.key();
+ }
+ };
+
+ struct other_item {
+ int nKey;
+
+ other_item( int n )
+ : nKey(n)
+ {}
+ };
+
+ struct other_less {
+ template <typename T, typename Q>
+ bool operator()( T const& i1, Q const& i2) const
+ {
+ return i1.nKey < i2.nKey;
+ }
+ };
+
+ template <typename T>
+ struct cmp {
+ int operator ()(const T& v1, const T& v2 ) const
+ {
+ if ( v1.key() < v2.key() )
+ return -1;
+ return v1.key() > v2.key() ? 1 : 0;
+ }
+
+ template <typename Q>
+ int operator ()(const T& v1, const Q& v2 ) const
+ {
+ if ( v1.key() < v2 )
+ return -1;
+ return v1.key() > v2 ? 1 : 0;
+ }
+
+ template <typename Q>
+ int operator ()(const Q& v1, const T& v2 ) const
+ {
+ if ( v1 < v2.key() )
+ return -1;
+ return v1 > v2.key() ? 1 : 0;
+ }
+ };
+
+ struct faked_disposer
+ {
+ template <typename T>
+ void operator ()( T * p )
+ {
+ ++p->s.nDisposeCount;
+ }
+ };
+
+ struct ensure_functor
+ {
+ template <typename T>
+ void operator ()(bool bNew, T& item, T& /*val*/ )
+ {
+ if ( bNew )
+ ++item.s.nEnsureNewCall;
+ else
+ ++item.s.nEnsureExistsCall;
+ }
+ };
+
+ struct find_functor
+ {
+ template <typename T, typename Q>
+ void operator ()( T& item, Q& /*val*/ )
+ {
+ ++item.s.nFindCall;
+ }
+ };
+
+ struct erase_functor
+ {
+ template <typename T>
+ void operator()( T const& item )
+ {
+ item.s.nEraseCall++;
+ }
+ };
+
+ template <class OrdList>
+ void test_int_common()
+ {
+ typedef typename OrdList::value_type value_type;
+
+ value_type v1( 10, 50 );
+ value_type v2( 5, 25 );
+ value_type v3( 20, 100 );
+ {
+ OrdList l;
+ CPPUNIT_ASSERT( l.empty() );
+
+ CPPUNIT_ASSERT( l.insert( v1 )) ; // true
+ CPPUNIT_ASSERT( l.find( v1.key() ));
+
+ CPPUNIT_ASSERT( v1.s.nFindCall == 0 );
+ CPPUNIT_ASSERT( l.find( v1.key(), find_functor() ));
+ CPPUNIT_ASSERT( v1.s.nFindCall == 1 );
+
+ CPPUNIT_ASSERT( !l.find( v2.key() ));
+ CPPUNIT_ASSERT( !l.find_with( v3.key(), less<value_type>() ));
+ CPPUNIT_ASSERT( !l.empty() );
+
+ CPPUNIT_ASSERT( !l.insert( v1 )) ; // assertion "is_empty" is not raised since pNext is nullptr
+
+ {
+ value_type v( v1 );
+ CPPUNIT_ASSERT( !l.insert( v )) ; // false
+ }
+
+ std::pair<bool, bool> ret = l.ensure( v2, ensure_functor() );
+ CPPUNIT_ASSERT( ret.first );
+ CPPUNIT_ASSERT( ret.second );
+ CPPUNIT_ASSERT( v2.s.nEnsureNewCall == 1 );
+ CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == 0 );
+
+ //CPPUNIT_ASSERT( !l.insert( v2 )) ; // assertion "is_empty"
+
+ CPPUNIT_ASSERT( l.find_with( v1.key(), less<value_type>() )) ; // true
+
+ CPPUNIT_ASSERT( v1.s.nFindCall == 1 );
+ CPPUNIT_ASSERT( l.find_with( v1.key(), less<value_type>(), find_functor() ));
+ CPPUNIT_ASSERT( v1.s.nFindCall == 2 );
+
+ CPPUNIT_ASSERT( l.find( v2.key() ));
+
+ CPPUNIT_ASSERT( v2.s.nFindCall == 0 );
+ CPPUNIT_ASSERT( l.find( v2.key(), find_functor() ));
+ CPPUNIT_ASSERT( v2.s.nFindCall == 1 );
+
+ CPPUNIT_ASSERT( !l.find( v3.key() ));
+
+ {
+ CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == 0 );
+ CPPUNIT_ASSERT( v2.s.nEnsureNewCall == 1 );
+
+ value_type v( v2 );
+ ret = l.ensure( v, ensure_functor() );
+
+ CPPUNIT_ASSERT( ret.first );
+ CPPUNIT_ASSERT( !ret.second );
+ CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == 1 );
+ CPPUNIT_ASSERT( v2.s.nEnsureNewCall == 1 );
+ CPPUNIT_ASSERT( v.s.nEnsureExistsCall == 0 );
+ CPPUNIT_ASSERT( v.s.nEnsureNewCall == 0 );
+ }
+
+ CPPUNIT_ASSERT( !l.empty() );
+
+ CPPUNIT_ASSERT( l.insert( v3 )) ; // true
+ CPPUNIT_ASSERT( l.find( v3.key() ));
+
+ CPPUNIT_ASSERT( v3.s.nFindCall == 0 );
+ CPPUNIT_ASSERT( l.find( v3.key(), find_functor() ));
+ CPPUNIT_ASSERT( v3.s.nFindCall == 1 );
+
+ CPPUNIT_ASSERT( l.unlink( v2 ) );
+ CPPUNIT_ASSERT( l.find( v1.key() )) ; // true
+ CPPUNIT_ASSERT( !l.find( v2.key() )) ; // true
+ CPPUNIT_ASSERT( l.find( v3.key() )) ; // true
+ CPPUNIT_ASSERT( !l.empty() );
+ CPPUNIT_ASSERT( !l.unlink( v2 ) );
+
+ {
+ // v1 key is in the list but v NODE is not in the list
+ value_type v( v1 );
+ CPPUNIT_ASSERT( !l.unlink( v ) );
+ }
+
+ CPPUNIT_ASSERT( l.unlink( v1 ) );
+ CPPUNIT_ASSERT( !l.unlink( v1 ) );
+ CPPUNIT_ASSERT( !l.find( v1.key() ));
+ CPPUNIT_ASSERT( !l.find( v2.key() ));
+ CPPUNIT_ASSERT( l.find( v3.key() ));
+ CPPUNIT_ASSERT( !l.empty() );
+ CPPUNIT_ASSERT( !l.unlink( v1 ) );
+ CPPUNIT_ASSERT( !l.unlink( v2 ) );
+
+ CPPUNIT_ASSERT( l.unlink( v3 ) );
+ CPPUNIT_ASSERT( !l.find_with( v1.key(), less<value_type>() ));
+ CPPUNIT_ASSERT( !l.find_with( v2.key(), less<value_type>(), find_functor() ));
+ CPPUNIT_ASSERT( !l.find( v3.key(), find_functor() ));
+ CPPUNIT_ASSERT( l.empty() );
+ CPPUNIT_ASSERT( !l.unlink( v1 ) );
+ CPPUNIT_ASSERT( !l.unlink( v2 ) );
+ CPPUNIT_ASSERT( !l.unlink( v3 ) );
+
+ // Apply retired pointer to clean links
+ OrdList::gc::force_dispose();
+
+ stat s( v3.s );
+ ret = l.ensure( v3, ensure_functor() );
+ CPPUNIT_ASSERT( ret.first );
+ CPPUNIT_ASSERT( ret.second );
+ CPPUNIT_ASSERT( v3.s.nEnsureNewCall == s.nEnsureNewCall + 1);
+ CPPUNIT_ASSERT( v3.s.nEnsureExistsCall == s.nEnsureExistsCall );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ s = v2.s;
+ ret = l.ensure( v2, ensure_functor() );
+ CPPUNIT_ASSERT( ret.first );
+ CPPUNIT_ASSERT( ret.second );
+ CPPUNIT_ASSERT( v2.s.nEnsureNewCall == s.nEnsureNewCall + 1);
+ CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == s.nEnsureExistsCall );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ s = v1.s;
+ ret = l.ensure( v1, ensure_functor() );
+ CPPUNIT_ASSERT( ret.first );
+ CPPUNIT_ASSERT( ret.second );
+ CPPUNIT_ASSERT( v1.s.nEnsureNewCall == s.nEnsureNewCall + 1);
+ CPPUNIT_ASSERT( v1.s.nEnsureExistsCall == s.nEnsureExistsCall );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ // Erase test
+ CPPUNIT_ASSERT( v1.s.nEraseCall == 0 );
+ CPPUNIT_ASSERT( l.erase( v1.key(), erase_functor()) );
+ CPPUNIT_ASSERT( v1.s.nEraseCall == 1 );
+ //CPPUNIT_ASSERT( v1.s.nDisposeCount == 0 );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ CPPUNIT_ASSERT( l.erase_with( v2.key(), less<value_type>() ) );
+ CPPUNIT_ASSERT( !l.erase( v2.key()));
+ //CPPUNIT_ASSERT( v2.s.nDisposeCount == 0 );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ CPPUNIT_ASSERT( v2.s.nEraseCall == 0 );
+ CPPUNIT_ASSERT( !l.erase( v2, erase_functor() ));
+ CPPUNIT_ASSERT( v2.s.nEraseCall == 0 );
+ CPPUNIT_ASSERT( !l.erase( v1 ));
+ //CPPUNIT_ASSERT( v2.s.nDisposeCount == 0 );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ CPPUNIT_ASSERT( v3.s.nEraseCall == 0 );
+ CPPUNIT_ASSERT( l.erase_with( v3, less<value_type>(), erase_functor() ));
+ CPPUNIT_ASSERT( v3.s.nEraseCall == 1 );
+ //CPPUNIT_ASSERT( v3.s.nDisposeCount == 0 );
+ CPPUNIT_ASSERT( l.empty() );
+
+ // Apply retired pointer to clean links
+ OrdList::gc::force_dispose();
+
+ // Unlink test
+ CPPUNIT_ASSERT( l.insert( v1 ));
+ CPPUNIT_ASSERT( l.insert( v3 ));
+ CPPUNIT_ASSERT( !l.empty() );
+ CPPUNIT_ASSERT( !l.unlink( v2 ));
+ CPPUNIT_ASSERT( l.unlink( v1 ));
+ CPPUNIT_ASSERT( !l.unlink( v1 ));
+ CPPUNIT_ASSERT( l.unlink( v3 ));
+ CPPUNIT_ASSERT( !l.unlink( v3 ));
+ CPPUNIT_ASSERT( l.empty() );
+
+ // Apply retired pointer
+ OrdList::gc::force_dispose();
+ CPPUNIT_ASSERT( v1.s.nDisposeCount == 3 );
+ CPPUNIT_ASSERT( v2.s.nDisposeCount == 2 );
+ CPPUNIT_ASSERT( v3.s.nDisposeCount == 3 );
+
+ // Destructor test (call disposer)
+ CPPUNIT_ASSERT( l.insert( v1 ));
+ CPPUNIT_ASSERT( l.insert( v3 ));
+ CPPUNIT_ASSERT( l.insert( v2 ));
+
+ // Iterator test
+ // begin/end
+ {
+ typename OrdList::iterator it = l.begin();
+ typename OrdList::const_iterator cit = l.cbegin();
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it != l.cend() );
+ CPPUNIT_ASSERT( cit != l.end() );
+ CPPUNIT_ASSERT( cit != l.cend() );
+ CPPUNIT_ASSERT( cit == it );
+
+ CPPUNIT_ASSERT( it->nKey == v2.nKey );
+ CPPUNIT_ASSERT( it->nVal == v2.nVal );
+ CPPUNIT_ASSERT( ++it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == v1.nKey );
+ CPPUNIT_ASSERT( it->nVal == v1.nVal );
+ CPPUNIT_ASSERT( ++it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == v3.nKey );
+ CPPUNIT_ASSERT( it->nVal == v3.nVal );
+ CPPUNIT_ASSERT( ++it == l.end() );
+ }
+
+ // cbegin/cend
+ {
+ typename OrdList::const_iterator it = l.cbegin();
+ CPPUNIT_ASSERT( it != l.cend() );
+ CPPUNIT_ASSERT( it->nKey == v2.nKey );
+ CPPUNIT_ASSERT( it->nVal == v2.nVal );
+ CPPUNIT_ASSERT( ++it != l.cend() );
+ CPPUNIT_ASSERT( it->nKey == v1.nKey );
+ CPPUNIT_ASSERT( it->nVal == v1.nVal );
+ CPPUNIT_ASSERT( ++it != l.cend() );
+ CPPUNIT_ASSERT( it->nKey == v3.nKey );
+ CPPUNIT_ASSERT( it->nVal == v3.nVal );
+ CPPUNIT_ASSERT( ++it == l.cend() );
+ }
+
+ // const begin/end
+ {
+ OrdList const & lref = l;
+ typename OrdList::const_iterator it = lref.begin();
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == v2.nKey );
+ CPPUNIT_ASSERT( it->nVal == v2.nVal );
+ CPPUNIT_ASSERT( ++it != lref.end() );
+ CPPUNIT_ASSERT( it->nKey == v1.nKey );
+ CPPUNIT_ASSERT( it->nVal == v1.nVal );
+ CPPUNIT_ASSERT( ++it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == v3.nKey );
+ CPPUNIT_ASSERT( it->nVal == v3.nVal );
+ CPPUNIT_ASSERT( ++it == l.end() );
+ }
+ }
+
+ // Apply retired pointer
+ OrdList::gc::force_dispose();
+
+ CPPUNIT_ASSERT( v1.s.nDisposeCount == 4 );
+ CPPUNIT_ASSERT( v2.s.nDisposeCount == 3 );
+ CPPUNIT_ASSERT( v3.s.nDisposeCount == 4 );
+ }
+
+ template <class OrdList>
+ void test_int()
+ {
+ test_int_common<OrdList>();
+
+ OrdList l;
+ typename OrdList::guarded_ptr gp;
+
+ static int const nLimit = 20;
+ typename OrdList::value_type arrItem[nLimit];
+
+ {
+ int a[nLimit];
+ for (int i = 0; i < nLimit; ++i)
+ a[i]=i;
+ std::random_shuffle( a, a + nLimit );
+
+ for (int i = 0; i < nLimit; ++i) {
+ arrItem[i].nKey = a[i];
+ arrItem[i].nVal = a[i] * 2;
+ }
+
+ // extract/get
+ for ( int i = 0; i < nLimit; ++i )
+ CPPUNIT_ASSERT( l.insert( arrItem[i] ) );
+
+ for ( int i=0; i < nLimit; ++i ) {
+ gp = l.get( arrItem[i].nKey );
+ CPPUNIT_ASSERT_EX( gp, "i=" << i );
+ CPPUNIT_ASSERT( !gp.empty());
+ CPPUNIT_CHECK( gp->nKey == arrItem[i].nKey );
+ CPPUNIT_CHECK( gp->nVal == arrItem[i].nVal );
+ gp.release();
+
+ gp = l.extract( arrItem[i].nKey );
+ CPPUNIT_ASSERT_EX( gp, "i=" << i );
+ CPPUNIT_ASSERT( !gp.empty());
+ CPPUNIT_CHECK( gp->nKey == arrItem[i].nKey );
+ CPPUNIT_CHECK( gp->nVal == arrItem[i].nVal );
+ gp.release();
+
+ gp = l.get( arrItem[i].nKey );
+ CPPUNIT_CHECK( !gp );
+ CPPUNIT_CHECK( gp.empty());
+ CPPUNIT_CHECK( !l.extract( arrItem[i].nKey ));
+ CPPUNIT_CHECK( gp.empty());
+ }
+ CPPUNIT_ASSERT( l.empty() );
+ CPPUNIT_ASSERT( !l.get( nLimit/2 ));
+ CPPUNIT_ASSERT( gp.empty());
+ CPPUNIT_ASSERT( !l.extract( nLimit/2 ));
+ CPPUNIT_ASSERT( gp.empty());
+
+ // Apply retired pointer
+ OrdList::gc::force_dispose();
+
+ // extract_with/get_with
+ for ( int i = 0; i < nLimit; ++i )
+ CPPUNIT_ASSERT( l.insert( arrItem[i] ) );
+
+ for ( int i=0; i < nLimit; ++i ) {
+ other_item itm( arrItem[i].nKey );
+ gp = l.get_with( itm, other_less() );
+ CPPUNIT_ASSERT_EX( gp, "i=" << i );
+ CPPUNIT_ASSERT( !gp.empty());
+ CPPUNIT_CHECK( gp->nKey == arrItem[i].nKey );
+ CPPUNIT_CHECK( gp->nVal == arrItem[i].nVal );
+ gp.release();
+
+ gp = l.extract_with( itm, other_less() );
+ CPPUNIT_ASSERT_EX( gp, "i=" << i );
+ CPPUNIT_ASSERT( !gp.empty());
+ CPPUNIT_CHECK( gp->nKey == arrItem[i].nKey );
+ CPPUNIT_CHECK( gp->nVal == arrItem[i].nVal );
+ gp.release();
+
+ gp = l.get_with( itm, other_less() );
+ CPPUNIT_CHECK( !gp );
+ CPPUNIT_CHECK( gp.empty());
+ CPPUNIT_CHECK( !l.extract_with( itm, other_less() ));
+ CPPUNIT_CHECK( gp.empty());
+ }
+ CPPUNIT_ASSERT( l.empty() );
+ CPPUNIT_ASSERT( !l.get_with( other_item(nLimit/2), other_less() ));
+ CPPUNIT_ASSERT( gp.empty());
+ CPPUNIT_ASSERT( !l.extract_with( other_item(nLimit/2), other_less() ));
+ CPPUNIT_ASSERT( gp.empty());
+
+ // Apply retired pointer
+ OrdList::gc::force_dispose();
+
+ for ( int i=0; i < nLimit; i++ ) {
+ CPPUNIT_ASSERT( arrItem[i].s.nDisposeCount == 2 );
+ }
+ }
+ }
+
+ template <class OrdList>
+ void test_rcu_int()
+ {
+ test_int_common<OrdList>();
+
+ OrdList l;
+ static int const nLimit = 20;
+ typename OrdList::value_type arrItem[nLimit];
+
+ typedef typename OrdList::rcu_lock rcu_lock;
+ typedef typename OrdList::value_type value_type;
+ typedef typename OrdList::gc rcu_type;
+
+ {
+ int a[nLimit];
+ for (int i = 0; i < nLimit; ++i)
+ a[i]=i;
+ std::random_shuffle( a, a + nLimit );
+
+ for (int i = 0; i < nLimit; ++i) {
+ arrItem[i].nKey = a[i];
+ arrItem[i].nVal = a[i] * 2;
+ }
+
+ // extract/get
+ for ( int i = 0; i < nLimit; ++i )
+ CPPUNIT_ASSERT( l.insert( arrItem[i] ) );
+
+ typename OrdList::exempt_ptr ep;
+
+ for ( int i = 0; i < nLimit; ++i ) {
+ {
+ rcu_lock lock;
+ value_type * pGet = l.get( a[i] );
+ CPPUNIT_ASSERT( pGet != nullptr );
+ CPPUNIT_CHECK( pGet->nKey == a[i] );
+ CPPUNIT_CHECK( pGet->nVal == a[i] * 2 );
+ }
+
+ {
+ rcu_lock lock;
+ ep = l.extract( a[i] );
+ CPPUNIT_ASSERT( ep );
+ CPPUNIT_ASSERT( !ep.empty() );
+ CPPUNIT_CHECK( ep->nKey == a[i] );
+ CPPUNIT_CHECK( (*ep).nVal == a[i] * 2 );
+ }
+ ep.release();
+
+ {
+ rcu_lock lock;
+ CPPUNIT_CHECK( l.get( a[i] ) == nullptr );
+ CPPUNIT_CHECK( !l.extract( a[i] ));
+ CPPUNIT_CHECK( ep.empty() );
+ }
+ }
+ CPPUNIT_ASSERT( l.empty() );
+
+ {
+ rcu_lock lock;
+ CPPUNIT_CHECK( l.get( a[0] ) == nullptr );
+ ep = l.extract( a[0] );
+ CPPUNIT_CHECK( !ep );
+ CPPUNIT_CHECK( ep.empty() );
+ }
+ // Apply retired pointer
+ OrdList::gc::force_dispose();
+
+ // extract_with/get_with
+ for ( int i = 0; i < nLimit; ++i ) {
+ CPPUNIT_ASSERT( l.insert( arrItem[i] ) );
+ }
+
+ for ( int i = 0; i < nLimit; ++i ) {
+ other_item itm( a[i] );
+ {
+ rcu_lock lock;
+ value_type * pGet = l.get_with( itm, other_less() );
+ CPPUNIT_ASSERT( pGet != nullptr );
+ CPPUNIT_CHECK( pGet->nKey == a[i] );
+ CPPUNIT_CHECK( pGet->nVal == a[i] * 2 );
+ }
+
+ {
+ rcu_lock lock;
+ ep = l.extract_with( itm, other_less() );
+ CPPUNIT_ASSERT( ep );
+ CPPUNIT_ASSERT( !ep.empty() );
+ CPPUNIT_CHECK( ep->nKey == a[i] );
+ CPPUNIT_CHECK( ep->nVal == a[i] * 2 );
+ }
+ ep.release();
+
+ {
+ rcu_lock lock;
+ CPPUNIT_CHECK( l.get_with( itm, other_less() ) == nullptr );
+ ep = l.extract_with( itm, other_less() );
+ CPPUNIT_CHECK( !ep );
+ CPPUNIT_CHECK( ep.empty() );
+ }
+ }
+ CPPUNIT_ASSERT( l.empty() );
+
+ {
+ rcu_lock lock;
+ CPPUNIT_CHECK( l.get_with( other_item( 0 ), other_less() ) == nullptr );
+ CPPUNIT_CHECK( !l.extract_with( other_item(0), other_less() ));
+ CPPUNIT_CHECK( ep.empty() );
+ }
+ // Apply retired pointer
+ OrdList::gc::force_dispose();
+ }
+ }
+
+ template <class OrdList>
+ void test_nogc_int()
+ {
+ typedef typename OrdList::value_type value_type;
+ {
+ value_type v1( 10, 50 );
+ value_type v2( 5, 25 );
+ value_type v3( 20, 100 );
+ {
+ OrdList l;
+ CPPUNIT_ASSERT( l.empty() );
+
+ CPPUNIT_ASSERT( l.insert( v1 )) ; // true
+ CPPUNIT_ASSERT( l.find( v1.key() ) == &v1 );
+
+ CPPUNIT_ASSERT( v1.s.nFindCall == 0 );
+ CPPUNIT_ASSERT( l.find( v1.key(), find_functor() ));
+ CPPUNIT_ASSERT( v1.s.nFindCall == 1 );
+
+ CPPUNIT_ASSERT( l.find_with( v2.key(), less<value_type>() ) == nullptr );
+ CPPUNIT_ASSERT( !l.find_with( v3.key(), less<value_type>(), find_functor() ));
+ CPPUNIT_ASSERT( !l.empty() );
+
+ CPPUNIT_ASSERT( !l.insert( v1 )) ; // assertion "is_empty" is not raised since pNext is nullptr
+
+ {
+ value_type v( v1 );
+ CPPUNIT_ASSERT( !l.insert( v )) ; // false
+ }
+
+ std::pair<bool, bool> ret = l.ensure( v2, ensure_functor() );
+ CPPUNIT_ASSERT( ret.first );
+ CPPUNIT_ASSERT( ret.second );
+ CPPUNIT_ASSERT( v2.s.nEnsureNewCall == 1 );
+ CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == 0 );
+
+ //CPPUNIT_ASSERT( !l.insert( v2 )) ; // assertion "is_empty"
+
+ CPPUNIT_ASSERT( l.find( v1.key() ) == &v1 ) ; // true
+
+ CPPUNIT_ASSERT( v1.s.nFindCall == 1 );
+ CPPUNIT_ASSERT( l.find( v1.key(), find_functor() ));
+ CPPUNIT_ASSERT( v1.s.nFindCall == 2 );
+
+ CPPUNIT_ASSERT( l.find( v2.key() ) == &v2 );
+
+ CPPUNIT_ASSERT( v2.s.nFindCall == 0 );
+ CPPUNIT_ASSERT( l.find( v2.key(), find_functor() ));
+ CPPUNIT_ASSERT( v2.s.nFindCall == 1 );
+
+ CPPUNIT_ASSERT( !l.find( v3.key() ));
+
+ {
+ value_type v( v2 );
+ ret = l.ensure( v, ensure_functor() );
+
+ CPPUNIT_ASSERT( ret.first );
+ CPPUNIT_ASSERT( !ret.second );
+ CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == 1 );
+ CPPUNIT_ASSERT( v.s.nEnsureExistsCall == 0 && v.s.nEnsureNewCall == 0 );
+ }
+
+ CPPUNIT_ASSERT( !l.empty() );
+
+ CPPUNIT_ASSERT( l.insert( v3 )) ; // true
+ CPPUNIT_ASSERT( l.find( v3.key() ) == &v3 );
+
+ CPPUNIT_ASSERT( v3.s.nFindCall == 0 );
+ CPPUNIT_ASSERT( l.find( v3.key(), find_functor() ));
+ CPPUNIT_ASSERT( v3.s.nFindCall == 1 );
+
+ {
+ typename OrdList::iterator it = l.begin();
+ typename OrdList::const_iterator cit = l.cbegin();
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it != l.cend() );
+ CPPUNIT_ASSERT( cit != l.end() );
+ CPPUNIT_ASSERT( cit != l.cend() );
+ CPPUNIT_ASSERT( cit == it );
+
+ CPPUNIT_ASSERT( it->nKey == v2.nKey );
+ CPPUNIT_ASSERT( it->nVal == v2.nVal );
+ CPPUNIT_ASSERT( ++it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == v1.nKey );
+ CPPUNIT_ASSERT( it->nVal == v1.nVal );
+ CPPUNIT_ASSERT( it++ != l.end() );
+ CPPUNIT_ASSERT( it->nKey == v3.nKey );
+ CPPUNIT_ASSERT( it->nVal == v3.nVal );
+ CPPUNIT_ASSERT( it++ != l.end() );
+ CPPUNIT_ASSERT( it == l.end() );
+ }
+
+ {
+ OrdList const & lref = l;
+ typename OrdList::const_iterator it = lref.begin();
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == v2.nKey );
+ CPPUNIT_ASSERT( it->nVal == v2.nVal );
+ CPPUNIT_ASSERT( ++it != lref.end() );
+ CPPUNIT_ASSERT( it->nKey == v1.nKey );
+ CPPUNIT_ASSERT( it->nVal == v1.nVal );
+ CPPUNIT_ASSERT( it++ != l.end() );
+ CPPUNIT_ASSERT( it->nKey == v3.nKey );
+ CPPUNIT_ASSERT( it->nVal == v3.nVal );
+ CPPUNIT_ASSERT( it++ != lref.end() );
+ CPPUNIT_ASSERT( it == l.end() );
+ }
+ }
+
+ // Disposer called on list destruction
+ CPPUNIT_ASSERT( v1.s.nDisposeCount == 1 );
+ CPPUNIT_ASSERT( v2.s.nDisposeCount == 1 );
+ CPPUNIT_ASSERT( v3.s.nDisposeCount == 1 );
+ }
+ }
+
+ void HP_base_cmp();
+ void HP_base_less();
+ void HP_base_cmpmix();
+ void HP_base_ic();
+ void HP_member_cmp();
+ void HP_member_less();
+ void HP_member_cmpmix();
+ void HP_member_ic();
+
+ void DHP_base_cmp();
+ void DHP_base_less();
+ void DHP_base_cmpmix();
+ void DHP_base_ic();
+ void DHP_member_cmp();
+ void DHP_member_less();
+ void DHP_member_cmpmix();
+ void DHP_member_ic();
+
+ void RCU_GPI_base_cmp();
+ void RCU_GPI_base_less();
+ void RCU_GPI_base_cmpmix();
+ void RCU_GPI_base_ic();
+ void RCU_GPI_member_cmp();
+ void RCU_GPI_member_less();
+ void RCU_GPI_member_cmpmix();
+ void RCU_GPI_member_ic();
+
+ void RCU_GPB_base_cmp();
+ void RCU_GPB_base_less();
+ void RCU_GPB_base_cmpmix();
+ void RCU_GPB_base_ic();
+ void RCU_GPB_member_cmp();
+ void RCU_GPB_member_less();
+ void RCU_GPB_member_cmpmix();
+ void RCU_GPB_member_ic();
+
+ void RCU_GPT_base_cmp();
+ void RCU_GPT_base_less();
+ void RCU_GPT_base_cmpmix();
+ void RCU_GPT_base_ic();
+ void RCU_GPT_member_cmp();
+ void RCU_GPT_member_less();
+ void RCU_GPT_member_cmpmix();
+ void RCU_GPT_member_ic();
+
+ void RCU_SHB_base_cmp();
+ void RCU_SHB_base_less();
+ void RCU_SHB_base_cmpmix();
+ void RCU_SHB_base_ic();
+ void RCU_SHB_member_cmp();
+ void RCU_SHB_member_less();
+ void RCU_SHB_member_cmpmix();
+ void RCU_SHB_member_ic();
+
+ void RCU_SHT_base_cmp();
+ void RCU_SHT_base_less();
+ void RCU_SHT_base_cmpmix();
+ void RCU_SHT_base_ic();
+ void RCU_SHT_member_cmp();
+ void RCU_SHT_member_less();
+ void RCU_SHT_member_cmpmix();
+ void RCU_SHT_member_ic();
+
+ void nogc_base_cmp();
+ void nogc_base_less();
+ void nogc_base_cmpmix();
+ void nogc_base_ic();
+ void nogc_member_cmp();
+ void nogc_member_less();
+ void nogc_member_cmpmix();
+ void nogc_member_ic();
+
+
+ CPPUNIT_TEST_SUITE(IntrusiveMichaelListHeaderTest)
+ CPPUNIT_TEST(HP_base_cmp)
+ CPPUNIT_TEST(HP_base_less)
+ CPPUNIT_TEST(HP_base_cmpmix)
+ CPPUNIT_TEST(HP_base_ic)
+ CPPUNIT_TEST(HP_member_cmp)
+ CPPUNIT_TEST(HP_member_less)
+ CPPUNIT_TEST(HP_member_cmpmix)
+ CPPUNIT_TEST(HP_member_ic)
+
+ CPPUNIT_TEST(DHP_base_cmp)
+ CPPUNIT_TEST(DHP_base_less)
+ CPPUNIT_TEST(DHP_base_cmpmix)
+ CPPUNIT_TEST(DHP_base_ic)
+ CPPUNIT_TEST(DHP_member_cmp)
+ CPPUNIT_TEST(DHP_member_less)
+ CPPUNIT_TEST(DHP_member_cmpmix)
+ CPPUNIT_TEST(DHP_member_ic)
+
+ CPPUNIT_TEST(RCU_GPI_base_cmp)
+ CPPUNIT_TEST(RCU_GPI_base_less)
+ CPPUNIT_TEST(RCU_GPI_base_cmpmix)
+ CPPUNIT_TEST(RCU_GPI_base_ic)
+ CPPUNIT_TEST(RCU_GPI_member_cmp)
+ CPPUNIT_TEST(RCU_GPI_member_less)
+ CPPUNIT_TEST(RCU_GPI_member_cmpmix)
+ CPPUNIT_TEST(RCU_GPI_member_ic)
+
+ CPPUNIT_TEST(RCU_GPB_base_cmp)
+ CPPUNIT_TEST(RCU_GPB_base_less)
+ CPPUNIT_TEST(RCU_GPB_base_cmpmix)
+ CPPUNIT_TEST(RCU_GPB_base_ic)
+ CPPUNIT_TEST(RCU_GPB_member_cmp)
+ CPPUNIT_TEST(RCU_GPB_member_less)
+ CPPUNIT_TEST(RCU_GPB_member_cmpmix)
+ CPPUNIT_TEST(RCU_GPB_member_ic)
+
+ CPPUNIT_TEST(RCU_GPT_base_cmp)
+ CPPUNIT_TEST(RCU_GPT_base_less)
+ CPPUNIT_TEST(RCU_GPT_base_cmpmix)
+ CPPUNIT_TEST(RCU_GPT_base_ic)
+ CPPUNIT_TEST(RCU_GPT_member_cmp)
+ CPPUNIT_TEST(RCU_GPT_member_less)
+ CPPUNIT_TEST(RCU_GPT_member_cmpmix)
+ CPPUNIT_TEST(RCU_GPT_member_ic)
+
+ CPPUNIT_TEST(nogc_base_cmp)
+ CPPUNIT_TEST(nogc_base_less)
+ CPPUNIT_TEST(nogc_base_cmpmix)
+ CPPUNIT_TEST(nogc_base_ic)
+ CPPUNIT_TEST(nogc_member_cmp)
+ CPPUNIT_TEST(nogc_member_less)
+ CPPUNIT_TEST(nogc_member_cmpmix)
+ CPPUNIT_TEST(nogc_member_ic)
+
+ CPPUNIT_TEST_SUITE_END()
+ };
+} // namespace ordlist
+
+#endif // CDSTEST_HDR_INTRUSIVE_MICHAEL_H
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_intrusive_michael.h"
+#include <cds/intrusive/michael_list_dhp.h>
+
+namespace ordlist {
+ void IntrusiveMichaelListHeaderTest::DHP_base_cmp()
+ {
+ typedef base_int_item< cds::gc::DHP > item;
+ struct traits : public ci::michael_list::traits {
+ typedef ci::michael_list::base_hook< co::gc<cds::gc::DHP> > hook;
+ typedef cmp<item> compare;
+ typedef faked_disposer disposer;
+ };
+ typedef ci::MichaelList< cds::gc::DHP, item, traits > list;
+ test_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::DHP_base_less()
+ {
+ typedef base_int_item< cds::gc::DHP > item;
+ typedef ci::MichaelList< cds::gc::DHP
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::DHP> > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::DHP_base_cmpmix()
+ {
+ typedef base_int_item< cds::gc::DHP > item;
+ typedef ci::MichaelList< cds::gc::DHP
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::DHP> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::DHP_base_ic()
+ {
+ typedef base_int_item< cds::gc::DHP > item;
+ typedef ci::MichaelList< cds::gc::DHP
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::DHP> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::DHP_member_cmp()
+ {
+ typedef member_int_item< cds::gc::DHP > item;
+ typedef ci::MichaelList< cds::gc::DHP
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<cds::gc::DHP>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::DHP_member_less()
+ {
+ typedef member_int_item< cds::gc::DHP > item;
+ typedef ci::MichaelList< cds::gc::DHP
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<cds::gc::DHP>
+ > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::DHP_member_cmpmix()
+ {
+ typedef member_int_item< cds::gc::DHP > item;
+ typedef ci::MichaelList< cds::gc::DHP
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<cds::gc::DHP>
+ > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::DHP_member_ic()
+ {
+ typedef member_int_item< cds::gc::DHP > item;
+ typedef ci::MichaelList< cds::gc::DHP
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<cds::gc::DHP>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_int<list>();
+ }
+
+} // namespace ordlist
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_intrusive_michael.h"
+#include <cds/intrusive/michael_list_hp.h>
+
+namespace ordlist {
+ void IntrusiveMichaelListHeaderTest::HP_base_cmp()
+ {
+ typedef base_int_item< cds::gc::HP > item;
+ struct traits : public ci::michael_list::traits {
+ typedef ci::michael_list::base_hook< co::gc<cds::gc::HP> > hook;
+ typedef cmp<item> compare;
+ typedef faked_disposer disposer;
+ };
+ typedef ci::MichaelList< cds::gc::HP, item, traits > list;
+ test_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::HP_base_less()
+ {
+ typedef base_int_item< cds::gc::HP > item;
+ typedef ci::MichaelList< cds::gc::HP
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::HP> > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::HP_base_cmpmix()
+ {
+ typedef base_int_item< cds::gc::HP > item;
+ typedef ci::MichaelList< cds::gc::HP
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::HP> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::HP_base_ic()
+ {
+ typedef base_int_item< cds::gc::HP > item;
+ typedef ci::MichaelList< cds::gc::HP
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::HP> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::HP_member_cmp()
+ {
+ typedef member_int_item< cds::gc::HP > item;
+ typedef ci::MichaelList< cds::gc::HP
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<cds::gc::HP>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::HP_member_less()
+ {
+ typedef member_int_item< cds::gc::HP > item;
+ typedef ci::MichaelList< cds::gc::HP
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<cds::gc::HP>
+ > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::HP_member_cmpmix()
+ {
+ typedef member_int_item< cds::gc::HP > item;
+ typedef ci::MichaelList< cds::gc::HP
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<cds::gc::HP>
+ > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::HP_member_ic()
+ {
+ typedef member_int_item< cds::gc::HP > item;
+ typedef ci::MichaelList< cds::gc::HP
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<cds::gc::HP>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_int<list>();
+ }
+} // namespace ordlist
+
+CPPUNIT_TEST_SUITE_REGISTRATION(ordlist::IntrusiveMichaelListHeaderTest);
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_intrusive_michael.h"
+#include <cds/urcu/general_buffered.h>
+#include <cds/intrusive/michael_list_rcu.h>
+
+namespace ordlist {
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::general_buffered<> > RCU;
+ }
+
+ void IntrusiveMichaelListHeaderTest::RCU_GPB_base_cmp()
+ {
+ typedef base_int_item< RCU > item;
+ struct traits : public ci::michael_list::traits
+ {
+ typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
+ typedef cmp<item> compare;
+ typedef faked_disposer disposer;
+ };
+ typedef ci::MichaelList< RCU, item, traits > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_GPB_base_less()
+ {
+ typedef base_int_item< RCU > item;
+ struct traits : public ci::michael_list::traits
+ {
+ typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
+ typedef IntrusiveMichaelListHeaderTest::less<item> less;
+ typedef faked_disposer disposer;
+ };
+ typedef ci::MichaelList< RCU, item, traits > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_GPB_base_cmpmix()
+ {
+ typedef base_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_GPB_base_ic()
+ {
+ typedef base_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_GPB_member_cmp()
+ {
+ typedef member_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_GPB_member_less()
+ {
+ typedef member_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_GPB_member_cmpmix()
+ {
+ typedef member_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_GPB_member_ic()
+ {
+ typedef member_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+
+}
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_intrusive_michael.h"
+#include <cds/urcu/general_instant.h>
+#include <cds/intrusive/michael_list_rcu.h>
+
+namespace ordlist {
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::general_instant<> > RCU;
+ }
+
+ void IntrusiveMichaelListHeaderTest::RCU_GPI_base_cmp()
+ {
+ typedef base_int_item< RCU > item;
+ struct traits : public ci::michael_list::traits
+ {
+ typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
+ typedef cmp<item> compare;
+ typedef faked_disposer disposer;
+ };
+ typedef ci::MichaelList< RCU, item, traits > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_GPI_base_less()
+ {
+ typedef base_int_item< RCU > item;
+ struct traits : public ci::michael_list::traits
+ {
+ typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
+ typedef IntrusiveMichaelListHeaderTest::less<item> less;
+ typedef faked_disposer disposer;
+ };
+ typedef ci::MichaelList< RCU, item, traits > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_GPI_base_cmpmix()
+ {
+ typedef base_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_GPI_base_ic()
+ {
+ typedef base_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_GPI_member_cmp()
+ {
+ typedef member_int_item< RCU > item;
+ struct traits: public
+ ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ {};
+ typedef ci::MichaelList< RCU, item, traits > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_GPI_member_less()
+ {
+ typedef member_int_item< RCU > item;
+ struct traits: public
+ ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ {};
+ typedef ci::MichaelList< RCU, item, traits > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_GPI_member_cmpmix()
+ {
+ typedef member_int_item< RCU > item;
+ struct traits: public
+ ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ {};
+ typedef ci::MichaelList< RCU, item, traits > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_GPI_member_ic()
+ {
+ typedef member_int_item< RCU > item;
+ struct traits: public
+ ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ {};
+ typedef ci::MichaelList< RCU, item, traits > list;
+ test_rcu_int<list>();
+ }
+} // namespace ordlist
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_intrusive_michael.h"
+#include <cds/urcu/general_threaded.h>
+#include <cds/intrusive/michael_list_rcu.h>
+
+namespace ordlist {
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::general_threaded<> > RCU;
+ }
+
+ void IntrusiveMichaelListHeaderTest::RCU_GPT_base_cmp()
+ {
+ typedef base_int_item< RCU > item;
+ struct traits : public ci::michael_list::traits
+ {
+ typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
+ typedef cmp<item> compare;
+ typedef faked_disposer disposer;
+ };
+ typedef ci::MichaelList< RCU, item, traits > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_GPT_base_less()
+ {
+ typedef base_int_item< RCU > item;
+ struct traits : public ci::michael_list::traits
+ {
+ typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
+ typedef IntrusiveMichaelListHeaderTest::less<item> less;
+ typedef faked_disposer disposer;
+ };
+ typedef ci::MichaelList< RCU, item, traits > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_GPT_base_cmpmix()
+ {
+ typedef base_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_GPT_base_ic()
+ {
+ typedef base_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_GPT_member_cmp()
+ {
+ typedef member_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_GPT_member_less()
+ {
+ typedef member_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_GPT_member_cmpmix()
+ {
+ typedef member_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_GPT_member_ic()
+ {
+ typedef member_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_rcu_int<list>();
+ }
+
+}
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_intrusive_michael.h"
+#include <cds/urcu/signal_buffered.h>
+#include <cds/intrusive/michael_list_rcu.h>
+
+namespace ordlist {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::signal_buffered<> > RCU;
+ }
+#endif
+
+ void IntrusiveMichaelListHeaderTest::RCU_SHB_base_cmp()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef base_int_item< RCU > item;
+ struct traits : public ci::michael_list::traits
+ {
+ typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
+ typedef cmp<item> compare;
+ typedef faked_disposer disposer;
+ };
+ typedef ci::MichaelList< RCU, item, traits > list;
+ test_rcu_int<list>();
+#endif
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_SHB_base_less()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef base_int_item< RCU > item;
+ struct traits : public ci::michael_list::traits
+ {
+ typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
+ typedef IntrusiveMichaelListHeaderTest::less<item> less;
+ typedef faked_disposer disposer;
+ };
+ typedef ci::MichaelList< RCU, item, traits > list;
+ test_rcu_int<list>();
+#endif
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_SHB_base_cmpmix()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef base_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_SHB_base_ic()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef base_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_SHB_member_cmp()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef member_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_SHB_member_less()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef member_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_SHB_member_cmpmix()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef member_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_SHB_member_ic()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef member_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+
+}
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_intrusive_michael.h"
+#include <cds/urcu/signal_threaded.h>
+#include <cds/intrusive/michael_list_rcu.h>
+
+namespace ordlist {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::signal_threaded<> > RCU;
+ }
+#endif
+
+ void IntrusiveMichaelListHeaderTest::RCU_SHT_base_cmp()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef base_int_item< RCU > item;
+ struct traits : public ci::michael_list::traits
+ {
+ typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
+ typedef cmp<item> compare;
+ typedef faked_disposer disposer;
+ };
+ typedef ci::MichaelList< RCU, item, traits > list;
+ test_rcu_int<list>();
+#endif
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_SHT_base_less()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef base_int_item< RCU > item;
+ struct traits : public ci::michael_list::traits
+ {
+ typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
+ typedef IntrusiveMichaelListHeaderTest::less<item> less;
+ typedef faked_disposer disposer;
+ };
+ typedef ci::MichaelList< RCU, item, traits > list;
+ test_rcu_int<list>();
+#endif
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_SHT_base_cmpmix()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef base_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_SHT_base_ic()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef base_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_SHT_member_cmp()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef member_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_SHT_member_less()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef member_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_SHT_member_cmpmix()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef member_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+ void IntrusiveMichaelListHeaderTest::RCU_SHT_member_ic()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ typedef member_int_item< RCU > item;
+ typedef ci::MichaelList< RCU
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<RCU>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_rcu_int<list>();
+#endif
+ }
+
+}
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_intrusive_michael.h"
+#include <cds/intrusive/michael_list_nogc.h>
+
+namespace ordlist {
+ void IntrusiveMichaelListHeaderTest::nogc_base_cmp()
+ {
+ typedef base_int_item< cds::gc::nogc > item;
+ struct traits : public ci::michael_list::traits
+ {
+ typedef ci::michael_list::base_hook< co::gc<cds::gc::nogc> > hook;
+ typedef cmp<item> compare;
+ typedef faked_disposer disposer;
+ };
+ typedef ci::MichaelList< cds::gc::nogc, item, traits > list;
+ test_nogc_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::nogc_base_less()
+ {
+ typedef base_int_item< cds::gc::nogc > item;
+ struct traits : public ci::michael_list::traits
+ {
+ typedef ci::michael_list::base_hook< co::gc<cds::gc::nogc> > hook;
+ typedef IntrusiveMichaelListHeaderTest::less<item> less;
+ typedef faked_disposer disposer;
+ };
+ typedef ci::MichaelList< cds::gc::nogc, item, traits > list;
+ test_nogc_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::nogc_base_cmpmix()
+ {
+ typedef base_int_item< cds::gc::nogc > item;
+ typedef ci::MichaelList< cds::gc::nogc
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::nogc> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_nogc_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::nogc_base_ic()
+ {
+ typedef base_int_item< cds::gc::nogc > item;
+ typedef ci::MichaelList< cds::gc::nogc
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::nogc> > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_nogc_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::nogc_member_cmp()
+ {
+ typedef member_int_item< cds::gc::nogc > item;
+ typedef ci::MichaelList< cds::gc::nogc
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<cds::gc::nogc>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_nogc_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::nogc_member_less()
+ {
+ typedef member_int_item< cds::gc::nogc > item;
+ typedef ci::MichaelList< cds::gc::nogc
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<cds::gc::nogc>
+ > >
+ ,co::less< less<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_nogc_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::nogc_member_cmpmix()
+ {
+ typedef member_int_item< cds::gc::nogc > item;
+ typedef ci::MichaelList< cds::gc::nogc
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<cds::gc::nogc>
+ > >
+ ,co::less< less<item> >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ >::type
+ > list;
+ test_nogc_int<list>();
+ }
+ void IntrusiveMichaelListHeaderTest::nogc_member_ic()
+ {
+ typedef member_int_item< cds::gc::nogc > item;
+ typedef ci::MichaelList< cds::gc::nogc
+ ,item
+ ,ci::michael_list::make_traits<
+ ci::opt::hook< ci::michael_list::member_hook<
+ offsetof( item, hMember ),
+ co::gc<cds::gc::nogc>
+ > >
+ ,co::compare< cmp<item> >
+ ,ci::opt::disposer< faked_disposer >
+ ,co::item_counter< cds::atomicity::item_counter >
+ >::type
+ > list;
+ test_nogc_int<list>();
+ }
+
+} // namespace ordlist
--- /dev/null
+//$$CDS-header$$
+
+#ifndef CDSTEST_HDR_LAZY_H
+#define CDSTEST_HDR_LAZY_H
+
+#include "cppunit/cppunit_proxy.h"
+#include <cds/container/details/lazy_list_base.h>
+
+namespace ordlist {
+ namespace cc = cds::container;
+ namespace co = cds::container::opt;
+
+ class LazyListTestHeader: public CppUnitMini::TestCase
+ {
+ public:
+ struct stat {
+ int nEnsureExistsCall;
+ int nEnsureNewCall;
+
+ stat()
+ {
+ nEnsureExistsCall
+ = nEnsureNewCall
+ = 0;
+ }
+ };
+
+ struct item {
+ int nKey;
+ int nVal;
+
+ stat s;
+
+ item(int key)
+ : nKey( key )
+ , nVal( key * 2 )
+ , s()
+ {}
+
+ item(int key, int val)
+ : nKey( key )
+ , nVal(val)
+ , s()
+ {}
+
+ item( item const& v )
+ : nKey( v.nKey )
+ , nVal( v.nVal )
+ , s()
+ {}
+
+ int key() const
+ {
+ return nKey;
+ }
+ };
+
+ template <typename T>
+ struct lt
+ {
+ bool operator ()(const T& v1, const T& v2 ) const
+ {
+ return v1.key() < v2.key();
+ }
+
+ template <typename Q>
+ bool operator ()(const T& v1, const Q& v2 ) const
+ {
+ return v1.key() < v2;
+ }
+
+ template <typename Q>
+ bool operator ()(const Q& v1, const T& v2 ) const
+ {
+ return v1 < v2.key();
+ }
+ };
+
+ template <typename T>
+ struct equal_to
+ {
+ bool operator ()(const T& v1, const T& v2 ) const
+ {
+ return v1.key() == v2.key();
+ }
+
+ template <typename Q>
+ bool operator ()(const T& v1, const Q& v2 ) const
+ {
+ return v1.key() == v2;
+ }
+
+ template <typename Q>
+ bool operator ()(const Q& v1, const T& v2 ) const
+ {
+ return v1 == v2.key();
+ }
+ };
+
+ template <typename T>
+ struct cmp {
+ int operator ()(const T& v1, const T& v2 ) const
+ {
+ if ( v1.key() < v2.key() )
+ return -1;
+ return v1.key() > v2.key() ? 1 : 0;
+ }
+
+ template <typename Q>
+ int operator ()(const T& v1, const Q& v2 ) const
+ {
+ if ( v1.key() < v2 )
+ return -1;
+ return v1.key() > v2 ? 1 : 0;
+ }
+
+ template <typename Q>
+ int operator ()(const Q& v1, const T& v2 ) const
+ {
+ if ( v1 < v2.key() )
+ return -1;
+ return v1 > v2.key() ? 1 : 0;
+ }
+ };
+
+ struct insert_functor {
+ void operator ()( item& i )
+ {
+ i.nVal = i.nKey * 1033;
+ }
+ };
+ struct dummy_insert_functor {
+ void operator ()( item& /*i*/ )
+ {
+ // This functor should not be called
+ TestCase::current_test()->error( "CPPUNIT_ASSERT", "dummy_insert_functor should not be called", __FILE__, __LINE__ );
+ }
+ };
+
+ static void insert_function( item& i )
+ {
+ i.nVal = i.nKey * 1024;
+ }
+ static void dummy_insert_function( item& /*i*/ )
+ {
+ // This function should not be called
+ TestCase::current_test()->error( "CPPUNIT_ASSERT", "dummy_insert_function should not be called", __FILE__, __LINE__ );
+ }
+
+ struct erase_functor {
+ unsigned int nEraseCall;
+
+ erase_functor()
+ : nEraseCall(0)
+ {}
+
+ void operator()( item const& /*i*/)
+ {
+ ++nEraseCall;
+ }
+ };
+
+ struct check_value {
+ unsigned int m_nMultiplier;
+
+ check_value( unsigned int nMultiplier )
+ : m_nMultiplier( nMultiplier )
+ {}
+
+ check_value( const check_value& s )
+ : m_nMultiplier( s.m_nMultiplier )
+ {}
+
+ void operator()( item& i, int )
+ {
+ CPPUNIT_ASSERT_CURRENT( int(i.nKey * m_nMultiplier) == i.nVal );
+ }
+ };
+
+ struct check_exact_value {
+ int m_nExpected;
+
+ check_exact_value( int nExpected )
+ : m_nExpected( nExpected )
+ {}
+
+ check_exact_value( check_exact_value const& s)
+ : m_nExpected( s.m_nExpected )
+ {}
+
+ void operator()( item& i, int )
+ {
+ CPPUNIT_ASSERT_CURRENT( i.nVal == m_nExpected );
+ }
+ };
+
+ struct dummy_check_value {
+ void operator()( item& /*i*/, int )
+ {
+ // This functor should not be called
+ TestCase::current_test()->error( "CPPUNIT_ASSERT", "dummy_check_value should not be called", __FILE__, __LINE__ );
+ }
+ };
+
+ struct ensure_functor {
+ void operator()( bool /*bNew*/, item& i, int /*n*/ )
+ {
+ i.nVal = i.nKey * 1024;
+ }
+ };
+
+ static void ensure_func( bool /*bNew*/, item& i, int n )
+ {
+ i.nVal = n * 1033;
+ }
+
+ struct other_item
+ {
+ int nKey;
+
+ other_item()
+ {}
+
+ other_item(int n)
+ : nKey(n)
+ {}
+ };
+
+ struct other_less
+ {
+ template <typename T1, typename T2>
+ bool operator()( T1 const& t1, T2 const& t2 ) const
+ {
+ return t1.nKey < t2.nKey;
+ }
+ };
+
+ protected:
+ template <class OrdList>
+ void test_with( OrdList& l )
+ {
+ typedef typename OrdList::value_type value_type;
+
+ // The list should be empty
+ CPPUNIT_ASSERT( l.empty() );
+
+ // insert test
+ CPPUNIT_ASSERT( l.insert( 50 ) );
+ CPPUNIT_ASSERT( l.insert( item( 25 )) );
+ CPPUNIT_ASSERT( l.insert( item( 100 )) );
+
+ // insert failed - such key exists
+ CPPUNIT_ASSERT( !l.insert( 50 ) );
+ CPPUNIT_ASSERT( !l.insert( item( 100 )) );
+
+ // clear test
+
+ // The list should not be empty
+ CPPUNIT_ASSERT( !l.empty() );
+ l.clear();
+ // and now the list is empty
+ CPPUNIT_ASSERT( l.empty() );
+
+ // Test insert with functor
+
+ CPPUNIT_ASSERT( l.insert( 100, insert_functor() ) );
+ // passed by ref
+ {
+ insert_functor f;
+ CPPUNIT_ASSERT( l.insert( item( 25 ), std::ref( f ) ) );
+ CPPUNIT_ASSERT( !l.insert( item( 100 ), std::ref( f ) ) );
+ }
+ // Test insert with function
+ CPPUNIT_ASSERT( l.insert( 50, insert_function ));
+ CPPUNIT_ASSERT( !l.insert( 25, dummy_insert_function ));
+ CPPUNIT_ASSERT( !l.insert( 100, dummy_insert_functor() ));
+
+ // The list should not be empty
+ CPPUNIT_ASSERT( !l.empty() );
+
+ // Check inserted values
+ {
+ int i;
+ i = 100;
+
+ CPPUNIT_ASSERT( l.find( 100 ));
+ CPPUNIT_ASSERT( l.find( i, check_value(1033) ));
+ {
+ check_value f(1033);
+ i = 25;
+ CPPUNIT_ASSERT( l.find_with( 25, lt<value_type>() ));
+ CPPUNIT_ASSERT( l.find_with( i, lt<value_type>(), std::ref( f ) ) );
+ }
+ i = 50;
+ CPPUNIT_ASSERT( l.find( 50 ));
+ CPPUNIT_ASSERT( l.find( i, check_value(1024) ));
+
+ i = 10;
+ CPPUNIT_ASSERT( !l.find_with( 10, lt<value_type>() ));
+ CPPUNIT_ASSERT( !l.find_with( i, lt<value_type>(), dummy_check_value() ));
+ i = 75;
+ CPPUNIT_ASSERT( !l.find( 75 ));
+ CPPUNIT_ASSERT( !l.find( i, dummy_check_value() ));
+ i = 150;
+ CPPUNIT_ASSERT( !l.find( 150 ));
+ CPPUNIT_ASSERT( !l.find( i, dummy_check_value() ));
+ }
+
+ // The list should not be empty
+ CPPUNIT_ASSERT( !l.empty() );
+ l.clear();
+ // and now the list is empty
+ CPPUNIT_ASSERT( l.empty() );
+
+ // Ensure test
+ {
+ std::pair<bool, bool> ensureResult;
+ ensure_functor f;
+ ensureResult = l.ensure( 100, ensure_functor() );
+ CPPUNIT_ASSERT( ensureResult.first );
+ CPPUNIT_ASSERT( ensureResult.second );
+
+ ensureResult = l.ensure( 200, std::ref( f ) );
+ CPPUNIT_ASSERT( ensureResult.first );
+ CPPUNIT_ASSERT( ensureResult.second );
+
+ ensureResult = l.ensure( 50, ensure_func );
+ CPPUNIT_ASSERT( ensureResult.first );
+ CPPUNIT_ASSERT( ensureResult.second );
+
+ int i;
+ i = 100;
+ CPPUNIT_ASSERT( l.find( i, check_value(1024) ));
+ i = 50;
+ CPPUNIT_ASSERT( l.find( i, check_value(1033) ));
+ i = 200;
+ CPPUNIT_ASSERT( l.find( i, check_value(1024) ));
+
+ // ensure existing key
+ ensureResult = l.ensure( 200, ensure_func );
+ CPPUNIT_ASSERT( ensureResult.first );
+ CPPUNIT_ASSERT( !ensureResult.second );
+ i = 200;
+ CPPUNIT_ASSERT( l.find( i, check_value(1033) ));
+
+ ensureResult = l.ensure( 50, ensure_functor() );
+ CPPUNIT_ASSERT( ensureResult.first );
+ CPPUNIT_ASSERT( !ensureResult.second );
+ i = 50;
+ CPPUNIT_ASSERT( l.find( i, check_value(1024) ));
+ }
+
+ // erase test (list: 50, 100, 200)
+ CPPUNIT_ASSERT( !l.empty() );
+ CPPUNIT_ASSERT( l.insert(160));
+ CPPUNIT_ASSERT( l.insert(250));
+ CPPUNIT_ASSERT( !l.empty() );
+
+ CPPUNIT_ASSERT( !l.erase( 150 ));
+
+ CPPUNIT_ASSERT( l.erase( 100 ));
+ CPPUNIT_ASSERT( !l.erase( 100 ));
+
+ CPPUNIT_ASSERT( l.erase_with( 200, lt<value_type>() ));
+ CPPUNIT_ASSERT( !l.erase_with( 200, lt<value_type>() ));
+
+ {
+ erase_functor ef;
+ CPPUNIT_ASSERT( ef.nEraseCall == 0 );
+ CPPUNIT_ASSERT( l.erase_with( 160, lt<value_type>(), std::ref(ef) ));
+ CPPUNIT_ASSERT( ef.nEraseCall == 1 );
+ CPPUNIT_ASSERT( !l.erase_with( 160, lt<value_type>(), std::ref(ef) ));
+ CPPUNIT_ASSERT( ef.nEraseCall == 1 );
+
+ CPPUNIT_ASSERT( l.erase( 250, std::ref(ef) ));
+ CPPUNIT_ASSERT( ef.nEraseCall == 2 );
+ CPPUNIT_ASSERT( !l.erase( 250, std::ref(ef) ));
+ CPPUNIT_ASSERT( ef.nEraseCall == 2 );
+ }
+
+ CPPUNIT_ASSERT( l.erase( 50 ));
+ CPPUNIT_ASSERT( !l.erase( 50 ));
+
+ CPPUNIT_ASSERT( l.empty() );
+
+ // clear empty list
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+
+ {
+ int i;
+ // insert test
+ CPPUNIT_ASSERT( l.emplace( 501 ) );
+ CPPUNIT_ASSERT( l.emplace( 251, 152 ));
+ CPPUNIT_ASSERT( l.emplace( item( 1001 )) );
+
+ // insert failed - such key exists
+ CPPUNIT_ASSERT( !l.emplace( 501, 2 ) );
+ CPPUNIT_ASSERT( !l.emplace( 251, 10) );
+
+ i = 501;
+ CPPUNIT_ASSERT( l.find( i, check_exact_value(501*2) ));
+ i = 251;
+ CPPUNIT_ASSERT( l.find( i, check_exact_value(152) ));
+ i = 1001;
+ CPPUNIT_ASSERT( l.find( i, check_exact_value(1001*2) ));
+
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+ }
+
+ // Iterator test
+ {
+ int nCount = 100;
+ for ( int i = 0; i < nCount; ++i )
+ CPPUNIT_ASSERT( l.insert( i ) );
+
+ {
+ typename OrdList::iterator it( l.begin() );
+ typename OrdList::const_iterator cit( l.cbegin() );
+ CPPUNIT_CHECK( it == cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ ++it;
+ CPPUNIT_CHECK( it != cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ ++cit;
+ CPPUNIT_CHECK( it == cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ }
+
+ int i = 0;
+ for ( typename OrdList::iterator it = l.begin(), itEnd = l.end(); it != itEnd; ++it, ++i ) {
+ it->nVal = i * 2;
+ CPPUNIT_ASSERT( it->nKey == i );
+ }
+
+ // Check that we have visited all items
+ for ( int i = 0; i < nCount; ++i )
+ CPPUNIT_ASSERT( l.find( i, check_value(2) ));
+
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+
+ // Const iterator
+ for ( int i = 0; i < nCount; ++i )
+ CPPUNIT_ASSERT( l.insert(i) );
+
+ i = 0;
+ const OrdList& rl = l;
+ for ( typename OrdList::const_iterator it = rl.begin(), itEnd = rl.end(); it != itEnd; ++it, ++i ) {
+ // it->nVal = i * 2 ; // not!
+ CPPUNIT_ASSERT( it->nKey == i );
+ }
+
+ // Check that we have visited all items
+ for ( int i = 0; i < nCount; ++i )
+ CPPUNIT_ASSERT( l.find_with( i, lt<value_type>(), check_value(2) ));
+
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+ }
+ }
+
+ template <class OrdList>
+ void test()
+ {
+ typedef typename OrdList::guarded_ptr guarded_ptr;
+ typedef typename OrdList::value_type value_type;
+
+ OrdList l;
+ test_with( l );
+
+ static int const nLimit = 20;
+ int arr[nLimit];
+ for ( int i = 0; i < nLimit; i++ )
+ arr[i] = i;
+ std::random_shuffle( arr, arr + nLimit );
+
+ // extract/get
+ for ( int i = 0; i < nLimit; ++i )
+ l.insert( arr[i] );
+ {
+ guarded_ptr gp;
+ for ( int i = 0; i < nLimit; ++i ) {
+ int nKey = arr[i];
+
+ gp = l.get( nKey );
+ CPPUNIT_ASSERT( gp );
+ CPPUNIT_ASSERT( !gp.empty());
+ CPPUNIT_CHECK( gp->nKey == nKey );
+ CPPUNIT_CHECK( gp->nVal == nKey * 2 );
+ gp.release();
+
+ gp = l.extract( nKey );
+ CPPUNIT_ASSERT( gp );
+ CPPUNIT_ASSERT( !gp.empty());
+ CPPUNIT_CHECK( gp->nKey == nKey );
+ CPPUNIT_CHECK( gp->nVal == nKey*2 );
+ gp.release();
+
+ gp = l.get( nKey );
+ CPPUNIT_CHECK( !gp );
+ CPPUNIT_CHECK( gp.empty());
+ CPPUNIT_CHECK( !l.extract( nKey));
+ CPPUNIT_CHECK( gp.empty());
+ }
+ CPPUNIT_ASSERT( l.empty());
+ CPPUNIT_CHECK( !l.get(arr[0]));
+ CPPUNIT_CHECK( gp.empty());
+ CPPUNIT_CHECK( !l.extract( arr[0]));
+ CPPUNIT_CHECK( gp.empty());
+ }
+
+ // extract_with/get_with
+ for ( int i = 0; i < nLimit; ++i )
+ l.insert( arr[i] );
+ {
+ guarded_ptr gp;
+ for ( int i = 0; i < nLimit; ++i ) {
+ int nKey = arr[i];
+ other_item key( nKey );
+
+ gp = l.get_with( key, other_less() );
+ CPPUNIT_ASSERT( gp );
+ CPPUNIT_ASSERT( !gp.empty());
+ CPPUNIT_CHECK( gp->nKey == nKey );
+ CPPUNIT_CHECK( gp->nVal == nKey * 2 );
+ gp.release();
+
+ gp = l.extract_with( key, other_less() );
+ CPPUNIT_ASSERT( gp );
+ CPPUNIT_ASSERT( !gp.empty());
+ CPPUNIT_CHECK( gp->nKey == nKey );
+ CPPUNIT_CHECK( gp->nVal == nKey*2 );
+ gp.release();
+
+ gp = l.get_with( key, other_less() );
+ CPPUNIT_CHECK( !gp );
+ CPPUNIT_CHECK( gp.empty());
+ CPPUNIT_CHECK( !l.extract_with( key, other_less()));
+ CPPUNIT_CHECK( gp.empty());
+ }
+ CPPUNIT_ASSERT( l.empty());
+ CPPUNIT_CHECK( !l.get_with(other_item(arr[0]), other_less()));
+ CPPUNIT_CHECK( gp.empty());
+ CPPUNIT_CHECK( !l.extract_with( other_item(arr[0]), other_less()));
+ CPPUNIT_CHECK( gp.empty());
+ }
+
+ }
+
+ template <class OrdList>
+ void test_rcu()
+ {
+ OrdList l;
+ test_with( l );
+
+ static int const nLimit = 20;
+
+ typedef typename OrdList::rcu_lock rcu_lock;
+ typedef typename OrdList::value_type value_type;
+ typedef typename OrdList::gc rcu_type;
+
+ {
+ int a[nLimit];
+ for (int i = 0; i < nLimit; ++i)
+ a[i]=i;
+ std::random_shuffle( a, a + nLimit );
+
+ // extract/get
+ for ( int i = 0; i < nLimit; ++i )
+ CPPUNIT_ASSERT( l.insert( a[i] ) );
+
+ typename OrdList::exempt_ptr ep;
+
+ for ( int i = 0; i < nLimit; ++i ) {
+ {
+ rcu_lock lock;
+ value_type * pGet = l.get( a[i] );
+ CPPUNIT_ASSERT( pGet != nullptr );
+ CPPUNIT_CHECK( pGet->nKey == a[i] );
+ CPPUNIT_CHECK( pGet->nVal == a[i] * 2 );
+
+ ep = l.extract( a[i] );
+ CPPUNIT_ASSERT( ep );
+ CPPUNIT_ASSERT( !ep.empty() );
+ CPPUNIT_CHECK( ep->nKey == a[i] );
+ CPPUNIT_CHECK( (*ep).nVal == a[i] * 2 );
+ }
+ ep.release();
+ {
+ rcu_lock lock;
+ CPPUNIT_CHECK( l.get( a[i] ) == nullptr );
+ CPPUNIT_CHECK( !l.extract( a[i] ));
+ }
+ }
+ CPPUNIT_ASSERT( l.empty() );
+
+ {
+ rcu_lock lock;
+ CPPUNIT_CHECK( l.get( a[0] ) == nullptr );
+ ep = l.extract( a[0] );
+ CPPUNIT_CHECK( !ep );
+ CPPUNIT_CHECK( ep.empty() );
+ }
+
+ // extract_with/get_with
+ for ( int i = 0; i < nLimit; ++i ) {
+ CPPUNIT_ASSERT( l.insert( a[i] ) );
+ }
+
+ for ( int i = 0; i < nLimit; ++i ) {
+ other_item itm( a[i] );
+ {
+ rcu_lock lock;
+ value_type * pGet = l.get_with( itm, other_less() );
+ CPPUNIT_ASSERT( pGet != nullptr );
+ CPPUNIT_CHECK( pGet->nKey == a[i] );
+ CPPUNIT_CHECK( pGet->nVal == a[i] * 2 );
+
+ ep = l.extract_with( itm, other_less() );
+ CPPUNIT_ASSERT( ep );
+ CPPUNIT_ASSERT( !ep.empty() );
+ CPPUNIT_CHECK( ep->nKey == a[i] );
+ CPPUNIT_CHECK( ep->nVal == a[i] * 2 );
+ }
+ ep.release();
+ {
+ rcu_lock lock;
+ CPPUNIT_CHECK( l.get_with( itm, other_less() ) == nullptr );
+ ep = l.extract_with( itm, other_less() );
+ CPPUNIT_CHECK( !ep );
+ CPPUNIT_CHECK( ep.empty() );
+ }
+ }
+ CPPUNIT_ASSERT( l.empty() );
+
+ {
+ rcu_lock lock;
+ CPPUNIT_CHECK( l.get_with( other_item( 0 ), other_less() ) == nullptr );
+ CPPUNIT_CHECK( !l.extract_with( other_item(0), other_less() ));
+ CPPUNIT_CHECK( ep.empty() );
+ }
+ }
+ }
+
+ template <class OrdList>
+ void nogc_test()
+ {
+ typedef OrdList list;
+ typedef typename list::value_type value_type;
+ typedef std::pair<typename list::iterator, bool> ensure_result;
+
+ typename list::iterator it;
+
+ list l;
+ CPPUNIT_ASSERT( l.empty() );
+ CPPUNIT_ASSERT( l.insert(50) != l.end() );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ ensure_result eres = l.ensure( item(100, 33) );
+ CPPUNIT_ASSERT( eres.second );
+ CPPUNIT_ASSERT( eres.first != l.end() );
+ CPPUNIT_ASSERT( l.insert( item(150) ) != l.end() );
+
+ CPPUNIT_ASSERT( l.insert(100) == l.end() );
+ eres = l.ensure( item(50, 33) );
+ CPPUNIT_ASSERT( !eres.second );
+ CPPUNIT_ASSERT( eres.first->nVal == eres.first->nKey * 2 );
+ eres.first->nVal = 63;
+
+ it = l.find( 33 );
+ CPPUNIT_ASSERT( it == l.end() );
+
+ it = l.find( 50 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == 50 );
+ CPPUNIT_ASSERT( it->nVal == 63 );
+
+ it = l.find( 100 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == 100 );
+ CPPUNIT_ASSERT( it->nVal == 33 );
+
+ it = l.find_with( 150, lt<value_type>() );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == 150 );
+ CPPUNIT_ASSERT( it->nVal == it->nKey * 2 );
+
+ CPPUNIT_ASSERT( !l.empty() );
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+
+ // insert test
+ CPPUNIT_ASSERT( l.emplace( 501 ) != l.end());
+ CPPUNIT_ASSERT( l.emplace( 251, 152 ) != l.end());
+ CPPUNIT_ASSERT( l.emplace( item( 1001 )) != l.end());
+
+ // insert failed - such key exists
+ CPPUNIT_ASSERT( l.emplace( 501, 2 ) == l.end());
+ CPPUNIT_ASSERT( l.emplace( 251, 10) == l.end());
+
+ it = l.find( 501 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == 501 );
+ CPPUNIT_ASSERT( it->nVal == 501 * 2 );
+
+ it = l.find_with( 251, lt<value_type>() );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == 251 );
+ CPPUNIT_ASSERT( it->nVal == 152 );
+
+ it = l.find( 1001 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == 1001 );
+ CPPUNIT_ASSERT( it->nVal == 1001 * 2 );
+
+ {
+ typename OrdList::iterator it( l.begin() );
+ typename OrdList::const_iterator cit( l.cbegin() );
+ CPPUNIT_CHECK( it == cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ ++it;
+ CPPUNIT_CHECK( it != cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ ++cit;
+ CPPUNIT_CHECK( it == cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ }
+
+
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+ }
+
+ template <class UnordList>
+ void nogc_unord_test()
+ {
+ typedef UnordList list;
+ typedef typename list::value_type value_type;
+ typedef std::pair<typename list::iterator, bool> ensure_result;
+
+ typename list::iterator it;
+
+ list l;
+ CPPUNIT_ASSERT( l.empty() );
+ CPPUNIT_ASSERT( l.insert(50) != l.end() );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ ensure_result eres = l.ensure( item(100, 33) );
+ CPPUNIT_ASSERT( eres.second );
+ CPPUNIT_ASSERT( eres.first != l.end() );
+ CPPUNIT_ASSERT( l.insert( item(150) ) != l.end() );
+
+ CPPUNIT_ASSERT( l.insert(100) == l.end() );
+ eres = l.ensure( item(50, 33) );
+ CPPUNIT_ASSERT( !eres.second );
+ CPPUNIT_ASSERT( eres.first->nVal == eres.first->nKey * 2 );
+ eres.first->nVal = 63;
+
+ it = l.find( 33 );
+ CPPUNIT_ASSERT( it == l.end() );
+
+ it = l.find( 50 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == 50 );
+ CPPUNIT_ASSERT( it->nVal == 63 );
+
+ it = l.find( 100 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == 100 );
+ CPPUNIT_ASSERT( it->nVal == 33 );
+
+ it = l.find_with( 150, equal_to<value_type>() );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == 150 );
+ CPPUNIT_ASSERT( it->nVal == it->nKey * 2 );
+
+ CPPUNIT_ASSERT( !l.empty() );
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+
+ // insert test
+ CPPUNIT_ASSERT( l.emplace( 501 ) != l.end());
+ CPPUNIT_ASSERT( l.emplace( 251, 152 ) != l.end());
+ CPPUNIT_ASSERT( l.emplace( item( 1001 )) != l.end());
+
+ // insert failed - such key exists
+ CPPUNIT_ASSERT( l.emplace( 501, 2 ) == l.end());
+ CPPUNIT_ASSERT( l.emplace( 251, 10) == l.end());
+
+ it = l.find( 501 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == 501 );
+ CPPUNIT_ASSERT( it->nVal == 501 * 2 );
+
+ it = l.find( 1001 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == 1001 );
+ CPPUNIT_ASSERT( it->nVal == 1001 * 2 );
+
+ {
+ typename UnordList::iterator it( l.begin() );
+ typename UnordList::const_iterator cit( l.cbegin() );
+ CPPUNIT_CHECK( it == cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ ++it;
+ CPPUNIT_CHECK( it != cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ ++cit;
+ CPPUNIT_CHECK( it == cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ }
+
+
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+ }
+
+ void HP_cmp();
+ void HP_less();
+ void HP_cmpmix();
+ void HP_ic();
+
+ void DHP_cmp();
+ void DHP_less();
+ void DHP_cmpmix();
+ void DHP_ic();
+
+ void RCU_GPI_cmp();
+ void RCU_GPI_less();
+ void RCU_GPI_cmpmix();
+ void RCU_GPI_ic();
+
+ void RCU_GPB_cmp();
+ void RCU_GPB_less();
+ void RCU_GPB_cmpmix();
+ void RCU_GPB_ic();
+
+ void RCU_GPT_cmp();
+ void RCU_GPT_less();
+ void RCU_GPT_cmpmix();
+ void RCU_GPT_ic();
+
+ void RCU_SHB_cmp();
+ void RCU_SHB_less();
+ void RCU_SHB_cmpmix();
+ void RCU_SHB_ic();
+
+ void RCU_SHT_cmp();
+ void RCU_SHT_less();
+ void RCU_SHT_cmpmix();
+ void RCU_SHT_ic();
+
+ void NOGC_cmp();
+ void NOGC_less();
+ void NOGC_cmpmix();
+ void NOGC_ic();
+
+ void NOGC_cmp_unord();
+ void NOGC_less_unord();
+ void NOGC_equal_to_unord();
+ void NOGC_cmpmix_unord();
+ void NOGC_equal_to_mix_unord();
+ void NOGC_ic_unord();
+
+
+ CPPUNIT_TEST_SUITE(LazyListTestHeader)
+ CPPUNIT_TEST(HP_cmp)
+ CPPUNIT_TEST(HP_less)
+ CPPUNIT_TEST(HP_cmpmix)
+ CPPUNIT_TEST(HP_ic)
+
+ CPPUNIT_TEST(DHP_cmp)
+ CPPUNIT_TEST(DHP_less)
+ CPPUNIT_TEST(DHP_cmpmix)
+ CPPUNIT_TEST(DHP_ic)
+
+ CPPUNIT_TEST(RCU_GPI_cmp)
+ CPPUNIT_TEST(RCU_GPI_less)
+ CPPUNIT_TEST(RCU_GPI_cmpmix)
+ CPPUNIT_TEST(RCU_GPI_ic)
+
+ CPPUNIT_TEST(RCU_GPB_cmp)
+ CPPUNIT_TEST(RCU_GPB_less)
+ CPPUNIT_TEST(RCU_GPB_cmpmix)
+ CPPUNIT_TEST(RCU_GPB_ic)
+
+ CPPUNIT_TEST(RCU_GPT_cmp)
+ CPPUNIT_TEST(RCU_GPT_less)
+ CPPUNIT_TEST(RCU_GPT_cmpmix)
+ CPPUNIT_TEST(RCU_GPT_ic)
+
+ CPPUNIT_TEST(RCU_SHB_cmp)
+ CPPUNIT_TEST(RCU_SHB_less)
+ CPPUNIT_TEST(RCU_SHB_cmpmix)
+ CPPUNIT_TEST(RCU_SHB_ic)
+
+ CPPUNIT_TEST(RCU_SHT_cmp)
+ CPPUNIT_TEST(RCU_SHT_less)
+ CPPUNIT_TEST(RCU_SHT_cmpmix)
+ CPPUNIT_TEST(RCU_SHT_ic)
+
+ CPPUNIT_TEST(NOGC_cmp)
+ CPPUNIT_TEST(NOGC_less)
+ CPPUNIT_TEST(NOGC_cmpmix)
+ CPPUNIT_TEST(NOGC_ic)
+
+ CPPUNIT_TEST(NOGC_cmp_unord)
+ CPPUNIT_TEST(NOGC_less_unord)
+ CPPUNIT_TEST(NOGC_equal_to_unord)
+ CPPUNIT_TEST(NOGC_cmpmix_unord)
+ CPPUNIT_TEST(NOGC_equal_to_mix_unord)
+ CPPUNIT_TEST(NOGC_ic_unord)
+
+ CPPUNIT_TEST_SUITE_END()
+ };
+
+} // namespace ordlist
+
+#endif // #ifndef CDSTEST_HDR_LAZY_H
\ No newline at end of file
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_lazy.h"
+#include <cds/container/lazy_list_dhp.h>
+
+namespace ordlist {
+ namespace {
+ struct DHP_cmp_traits: public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
+ };
+ }
+ void LazyListTestHeader::DHP_cmp()
+ {
+ // traits-based version
+ typedef cc::LazyList< cds::gc::DHP, item, DHP_cmp_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< cds::gc::DHP, item,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+ namespace {
+ struct DHP_less_traits: public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ };
+ }
+ void LazyListTestHeader::DHP_less()
+ {
+ // traits-based version
+ typedef cc::LazyList< cds::gc::DHP, item, DHP_less_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< cds::gc::DHP, item,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+ namespace {
+ struct DHP_cmpmix_traits: public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ };
+ }
+ void LazyListTestHeader::DHP_cmpmix()
+ {
+ // traits-based version
+ typedef cc::LazyList< cds::gc::DHP, item, DHP_cmpmix_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< cds::gc::DHP, item,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ ,cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+ namespace {
+ struct DHP_ic_traits: public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+ void LazyListTestHeader::DHP_ic()
+ {
+ // traits-based version
+ typedef cc::LazyList< cds::gc::DHP, item, DHP_ic_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< cds::gc::DHP, item,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<item> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+} // namespace ordlist
+
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_lazy.h"
+#include <cds/container/lazy_list_hp.h>
+
+namespace ordlist {
+ namespace {
+ struct HP_cmp_traits: public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
+ };
+
+ }
+ void LazyListTestHeader::HP_cmp()
+ {
+ // traits-based version
+ typedef cc::LazyList< cds::gc::HP, item, HP_cmp_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< cds::gc::HP, item,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+ namespace {
+ struct HP_less_traits: public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ };
+ }
+ void LazyListTestHeader::HP_less()
+ {
+ // traits-based version
+ typedef cc::LazyList< cds::gc::HP, item, HP_less_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< cds::gc::HP, item,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+ namespace {
+ struct HP_cmpmix_traits: public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ };
+ }
+ void LazyListTestHeader::HP_cmpmix()
+ {
+ // traits-based version
+ typedef cc::LazyList< cds::gc::HP, item, HP_cmpmix_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< cds::gc::HP, item,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ ,cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+ namespace {
+ struct HP_ic_traits: public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+ void LazyListTestHeader::HP_ic()
+ {
+ // traits-based version
+ typedef cc::LazyList< cds::gc::HP, item, HP_ic_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< cds::gc::HP, item,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<item> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+} // namespace ordlist
+
+CPPUNIT_TEST_SUITE_REGISTRATION(ordlist::LazyListTestHeader);
--- /dev/null
+//$$CDS-header$$
+
+#ifndef CDSTEST_HDR_LAZY_KV_H
+#define CDSTEST_HDR_LAZY_KV_H
+
+#include "cppunit/cppunit_proxy.h"
+#include <cds/container/details/lazy_list_base.h>
+
+namespace ordlist {
+ namespace cc = cds::container;
+ namespace co = cds::container::opt;
+
+ class LazyKVListTestHeader: public CppUnitMini::TestCase
+ {
+ public:
+ typedef int key_type;
+ struct value_type {
+ int m_val;
+
+ value_type()
+ : m_val(0)
+ {}
+
+ value_type( int n )
+ : m_val( n )
+ {}
+ };
+
+ template <typename T>
+ struct lt
+ {
+ bool operator ()(const T& v1, const T& v2 ) const
+ {
+ return v1 < v2;
+ }
+ };
+
+ template <typename T>
+ struct cmp {
+ int operator ()(const T& v1, const T& v2 ) const
+ {
+ if ( v1 < v2 )
+ return -1;
+ return v1 > v2 ? 1 : 0;
+ }
+ };
+
+ template <typename T>
+ struct eq {
+ bool operator ()(const T& v1, const T& v2 ) const
+ {
+ return v1 == v2;
+ }
+ };
+
+ struct check_value {
+ int m_nExpected;
+
+ check_value( int nExpected )
+ : m_nExpected( nExpected )
+ {}
+
+ template <typename T>
+ void operator ()( T& pair )
+ {
+ CPPUNIT_ASSERT_CURRENT( pair.second.m_val == m_nExpected );
+ }
+ };
+
+ struct insert_functor {
+ template <typename T>
+ void operator()( T& pair )
+ {
+ pair.second.m_val = pair.first * 10;
+ }
+ };
+
+ struct ensure_functor {
+ template <typename T>
+ void operator()( bool /*bNew*/, T& pair )
+ {
+ pair.second.m_val = pair.first * 50;
+ }
+ };
+
+ struct erase_functor {
+ int nKey;
+ int nVal;
+
+ erase_functor()
+ : nKey(0)
+ , nVal(0)
+ {}
+
+ template <typename T>
+ void operator()( T& i )
+ {
+ nKey = i.first;
+ nVal = i.second.m_val;
+ }
+ };
+
+ typedef float other_key;
+ struct other_less {
+ bool operator()( float f, int i ) const
+ {
+ return int(f) < i;
+ }
+ bool operator()( int i, float f ) const
+ {
+ return i < int(f);
+ }
+ };
+
+ protected:
+ template <class OrdList>
+ void test_with( OrdList& l)
+ {
+ typedef typename OrdList::value_type value_type;
+
+ typename OrdList::iterator itTest;
+ typename OrdList::const_iterator citTest;
+
+ CPPUNIT_ASSERT( l.empty() );
+
+ // insert / find test
+ CPPUNIT_ASSERT( !l.find( 100 ));
+ CPPUNIT_ASSERT( l.insert( 100 ));
+ CPPUNIT_ASSERT( !l.empty() );
+ CPPUNIT_ASSERT( l.find( 100 ));
+
+ check_value chk(0);
+ CPPUNIT_ASSERT( l.find( 100, std::ref( chk ) ) );
+
+ CPPUNIT_ASSERT( !l.find_with( 50, lt<key_type>() ));
+ CPPUNIT_ASSERT( l.insert( 50, 500 ));
+ CPPUNIT_ASSERT( l.find_with( 50, lt<key_type>() ));
+ CPPUNIT_ASSERT( !l.insert( 50, 5 ));
+ chk.m_nExpected = 500;
+ CPPUNIT_ASSERT( l.find( 50, std::ref( chk ) ) );
+ chk.m_nExpected = 0;
+ CPPUNIT_ASSERT( l.find( 100, std::ref( chk ) ) );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ CPPUNIT_ASSERT( !l.find( 150 ));
+ CPPUNIT_ASSERT( l.insert_with( 150, insert_functor() ));
+ CPPUNIT_ASSERT( l.find( 150 ));
+ chk.m_nExpected = 1500;
+ CPPUNIT_ASSERT( l.find_with( 150, lt<key_type>(), std::ref( chk ) ) );
+ chk.m_nExpected = 0;
+ CPPUNIT_ASSERT( l.find( 100, std::ref( chk ) ) );
+ chk.m_nExpected = 500;
+ CPPUNIT_ASSERT( l.find( 50, std::ref( chk ) ) );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ // erase test
+
+ CPPUNIT_ASSERT( !l.erase( 500 ));
+ CPPUNIT_ASSERT( !l.empty() );
+
+ CPPUNIT_ASSERT( l.find( 50 ));
+ {
+ erase_functor ef;
+ l.erase( 50, std::ref( ef ) );
+ CPPUNIT_ASSERT( ef.nKey == 50 );
+ CPPUNIT_ASSERT( ef.nVal == 500 );
+ }
+ CPPUNIT_ASSERT( !l.find( 50 ));
+
+ // ensure test
+ std::pair<bool, bool> bEnsureResult;
+ bEnsureResult = l.ensure( 100, ensure_functor() );
+ CPPUNIT_ASSERT( bEnsureResult.first );
+ CPPUNIT_ASSERT( !bEnsureResult.second );
+ chk.m_nExpected = 5000;
+ CPPUNIT_ASSERT( l.find( 100, std::ref( chk ) ) );
+
+ {
+ ensure_functor ef;
+ bEnsureResult = l.ensure( 50, std::ref( ef ) );
+ }
+ CPPUNIT_ASSERT( bEnsureResult.first );
+ CPPUNIT_ASSERT( bEnsureResult.second );
+ chk.m_nExpected = 2500;
+ CPPUNIT_ASSERT( l.find( 50, std::ref( chk ) ) );
+
+ // erase test
+ CPPUNIT_ASSERT( !l.empty() );
+ CPPUNIT_ASSERT( l.insert_with( 200, insert_functor() ));
+ CPPUNIT_ASSERT( l.insert( 25 ));
+ CPPUNIT_ASSERT( l.erase( 100 ));
+ CPPUNIT_ASSERT( l.erase( 150 ));
+ {
+ erase_functor ef;
+ CPPUNIT_ASSERT( l.erase_with( 200, lt<key_type>(), std::ref(ef)) );
+ CPPUNIT_ASSERT( ef.nKey == 200 );
+ CPPUNIT_ASSERT( ef.nVal == 2000 );
+ }
+ CPPUNIT_ASSERT( l.erase_with( 25, lt<key_type>()))
+ CPPUNIT_ASSERT( l.erase( 50 ));
+ CPPUNIT_ASSERT( l.empty() );
+
+ // clear empty list
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+
+ // insert test
+ CPPUNIT_ASSERT( l.emplace( 501 ) );
+ CPPUNIT_ASSERT( l.emplace( 251, 152 ));
+
+ // insert failed - such key exists
+ CPPUNIT_ASSERT( !l.emplace( 501, 2 ) );
+ CPPUNIT_ASSERT( !l.emplace( 251, 10) );
+
+ check_value cv(0);
+ CPPUNIT_ASSERT( l.find( 501, std::ref(cv) ));
+ cv.m_nExpected = 152;
+ CPPUNIT_ASSERT( l.find( 251, std::ref(cv) ));
+
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+
+ // Iterator test
+ {
+ int nCount = 100;
+ for ( int i = 0; i < nCount; ++i )
+ CPPUNIT_ASSERT( l.insert(i, i * 2 ) );
+
+ {
+ typename OrdList::iterator it( l.begin() );
+ typename OrdList::const_iterator cit( l.cbegin() );
+ CPPUNIT_CHECK( it == cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ ++it;
+ CPPUNIT_CHECK( it != cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ ++cit;
+ CPPUNIT_CHECK( it == cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ }
+
+ int i = 0;
+ for ( typename OrdList::iterator it = l.begin(), itEnd = l.end(); it != itEnd; ++it, ++i ) {
+ CPPUNIT_ASSERT( it.key() == i );
+ CPPUNIT_ASSERT( it.val().m_val == i * 2 );
+ it.val().m_val = i * 3;
+ }
+
+ // Check that we have visited all items
+ for ( int i = 0; i < nCount; ++i ) {
+ chk.m_nExpected = i * 3;
+ CPPUNIT_ASSERT( l.find( i, std::ref( chk ) ) );
+ }
+
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+
+ // Const iterator
+ for ( int i = 0; i < nCount; ++i )
+ CPPUNIT_ASSERT( l.insert(i, i * 7) );
+
+ i = 0;
+ const OrdList& rl = l;
+ for ( typename OrdList::const_iterator it = rl.begin(), itEnd = rl.end(); it != itEnd; ++it, ++i ) {
+ CPPUNIT_ASSERT( it.key() == i );
+ CPPUNIT_ASSERT( it.val().m_val == i * 7 );
+ }
+
+ // Check that we have visited all items
+ for ( int i = nCount; i > 0; --i ) {
+ chk.m_nExpected = (i - 1) * 7;
+ CPPUNIT_ASSERT( l.find_with( i - 1, lt<key_type>(), std::ref( chk ) ) );
+ }
+
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+ }
+ }
+
+ template <class OrdList>
+ void test()
+ {
+ OrdList l;
+ test_with(l);
+
+ typedef typename OrdList::guarded_ptr guarded_ptr;
+
+ static int const nLimit = 20;
+ int arr[nLimit];
+ for ( int i = 0; i < nLimit; i++ )
+ arr[i] = i;
+ std::random_shuffle( arr, arr + nLimit );
+
+ // extract/get
+ for ( int i = 0; i < nLimit; ++i )
+ l.insert( arr[i], arr[i] * 2 );
+ {
+ guarded_ptr gp;
+ for ( int i = 0; i < nLimit; ++i ) {
+ int nKey = arr[i];
+
+ gp = l.get( nKey );
+ CPPUNIT_ASSERT( gp );
+ CPPUNIT_ASSERT( !gp.empty());
+ CPPUNIT_CHECK( gp->first == nKey );
+ CPPUNIT_CHECK( gp->second.m_val == nKey * 2 );
+ gp.release();
+
+ gp = l.extract( nKey );
+ CPPUNIT_ASSERT( gp );
+ CPPUNIT_ASSERT( !gp.empty());
+ CPPUNIT_CHECK( gp->first == nKey );
+ CPPUNIT_CHECK( gp->second.m_val == nKey*2 );
+ gp.release();
+
+ gp = l.get( nKey );
+ CPPUNIT_CHECK( !gp );
+ CPPUNIT_CHECK( gp.empty());
+ CPPUNIT_CHECK( !l.extract( nKey));
+ CPPUNIT_CHECK( gp.empty());
+ }
+ CPPUNIT_ASSERT( l.empty());
+ CPPUNIT_CHECK( !l.get(arr[0]));
+ CPPUNIT_CHECK( gp.empty());
+ CPPUNIT_CHECK( !l.extract( arr[0]));
+ CPPUNIT_CHECK( gp.empty());
+ }
+
+ // extract_with/get_with
+ for ( int i = 0; i < nLimit; ++i )
+ l.insert( arr[i], arr[i] * 2 );
+ {
+ guarded_ptr gp;
+ for ( int i = 0; i < nLimit; ++i ) {
+ int nKey = arr[i];
+ other_key key = float(nKey + 0.3);
+
+ gp = l.get_with( key, other_less() );
+ CPPUNIT_ASSERT( gp );
+ CPPUNIT_ASSERT( !gp.empty());
+ CPPUNIT_CHECK( gp->first == nKey );
+ CPPUNIT_CHECK( gp->second.m_val == nKey * 2 );
+ gp.release();
+
+ gp = l.extract_with( key, other_less() );
+ CPPUNIT_ASSERT( gp );
+ CPPUNIT_ASSERT( !gp.empty());
+ CPPUNIT_CHECK( gp->first == nKey );
+ CPPUNIT_CHECK( gp->second.m_val == nKey*2 );
+ gp.release();
+
+ gp = l.get_with( key, other_less() );
+ CPPUNIT_CHECK( !gp );
+ CPPUNIT_CHECK( gp.empty());
+ CPPUNIT_CHECK( !l.extract_with( key, other_less()));
+ CPPUNIT_CHECK( gp.empty());
+ }
+ CPPUNIT_ASSERT( l.empty());
+ CPPUNIT_CHECK( !l.get_with(3.4f, other_less()));
+ CPPUNIT_CHECK( gp.empty());
+ CPPUNIT_CHECK( !l.extract_with( 3.4f, other_less()));
+ CPPUNIT_CHECK( gp.empty());
+ }
+ }
+
+ template <class OrdList>
+ void test_rcu()
+ {
+ OrdList l;
+ test_with(l);
+
+ static int const nLimit = 20;
+
+ typedef typename OrdList::rcu_lock rcu_lock;
+ typedef typename OrdList::value_type value_type;
+ typedef typename OrdList::gc rcu_type;
+
+ {
+ int a[nLimit];
+ for (int i = 0; i < nLimit; ++i)
+ a[i]=i;
+ std::random_shuffle( a, a + nLimit );
+
+ // extract/get
+ for ( int i = 0; i < nLimit; ++i )
+ CPPUNIT_ASSERT( l.insert( a[i], a[i]*2 ) );
+
+ typename OrdList::exempt_ptr ep;
+
+ for ( int i = 0; i < nLimit; ++i ) {
+ {
+ rcu_lock lock;
+ value_type * pGet = l.get( a[i] );
+ CPPUNIT_ASSERT( pGet != nullptr );
+ CPPUNIT_CHECK( pGet->first == a[i] );
+ CPPUNIT_CHECK( pGet->second.m_val == a[i] * 2 );
+
+ ep = l.extract( a[i] );
+ CPPUNIT_ASSERT( ep );
+ CPPUNIT_ASSERT( !ep.empty() );
+ CPPUNIT_CHECK( ep->first == a[i] );
+ CPPUNIT_CHECK( (*ep).second.m_val == a[i] * 2 );
+ }
+ ep.release();
+ {
+ rcu_lock lock;
+ CPPUNIT_CHECK( l.get( a[i] ) == nullptr );
+ ep = l.extract( a[i] );
+ CPPUNIT_CHECK( !ep );
+ CPPUNIT_CHECK( ep.empty() );
+ }
+ }
+ CPPUNIT_ASSERT( l.empty() );
+
+ {
+ rcu_lock lock;
+ CPPUNIT_CHECK( l.get( a[0] ) == nullptr );
+ CPPUNIT_CHECK( !l.extract( a[0] ) );
+ }
+
+ // extract_with/get_with
+ for ( int i = 0; i < nLimit; ++i ) {
+ CPPUNIT_ASSERT( l.insert( a[i], a[i]*2 ) );
+ }
+
+ for ( int i = 0; i < nLimit; ++i ) {
+ float itm = a[i] + 0.3f;
+ {
+ rcu_lock lock;
+ value_type * pGet = l.get_with( itm, other_less() );
+ CPPUNIT_ASSERT( pGet != nullptr );
+ CPPUNIT_CHECK( pGet->first == a[i] );
+ CPPUNIT_CHECK( pGet->second.m_val == a[i] * 2 );
+
+ ep = l.extract_with( itm, other_less() );
+ CPPUNIT_ASSERT( ep );
+ CPPUNIT_ASSERT( !ep.empty() );
+ CPPUNIT_CHECK( ep->first == a[i] );
+ CPPUNIT_CHECK( ep->second.m_val == a[i] * 2 );
+ }
+ ep.release();
+ {
+ rcu_lock lock;
+ CPPUNIT_CHECK( l.get_with( itm, other_less()) == nullptr );
+ ep = l.extract_with( itm, other_less() );
+ CPPUNIT_CHECK( !ep );
+ CPPUNIT_CHECK( ep.empty() );
+ }
+ }
+ CPPUNIT_ASSERT( l.empty() );
+
+ {
+ rcu_lock lock;
+ CPPUNIT_CHECK( l.get_with( 3.14f, other_less() ) == nullptr );
+ CPPUNIT_CHECK( !l.extract_with( 3.14f, other_less() ));
+ CPPUNIT_CHECK( ep.empty() );
+ }
+ }
+ }
+
+ template <class OrdList>
+ void nogc_test()
+ {
+ typedef typename OrdList::value_type value_type;
+ typedef typename OrdList::iterator iterator;
+
+ {
+ OrdList l;
+ iterator it;
+
+ CPPUNIT_ASSERT( l.empty() );
+
+ // insert / find test
+ CPPUNIT_ASSERT( l.find( 100 ) == l.end() );
+ CPPUNIT_ASSERT( l.insert( 100 ) != l.end() );
+ CPPUNIT_ASSERT( !l.empty() );
+ it = l.find( 100 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 100 );
+ CPPUNIT_ASSERT( it.val().m_val == 0 );
+
+ CPPUNIT_ASSERT( l.find_with( 50, lt<key_type>() ) == l.end() );
+ CPPUNIT_ASSERT( l.insert( 50, 500 ) != l.end());
+ it = l.find( 50 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 50 );
+ CPPUNIT_ASSERT( it.val().m_val == 500 );
+
+ CPPUNIT_ASSERT( l.insert( 50, 5 ) == l.end() );
+ it = l.find( 50 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 50 );
+ CPPUNIT_ASSERT( it.val().m_val == 500 );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ CPPUNIT_ASSERT( l.find( 150 ) == l.end() );
+ CPPUNIT_ASSERT( l.insert_with( 150, insert_functor() ) != l.end() );
+ it = l.find( 150 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 150 );
+ CPPUNIT_ASSERT( it.val().m_val == 1500 );
+ it = l.find( 100 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 100 );
+ CPPUNIT_ASSERT( it.val().m_val == 0 );
+ it = l.find( 50 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 50 );
+ CPPUNIT_ASSERT( it.val().m_val == 500 );
+ it.val().m_val = 25;
+ it = l.find( 50 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 50 );
+ CPPUNIT_ASSERT( it.val().m_val == 25 );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ // ensure existing item
+ std::pair<iterator, bool> ensureResult;
+ ensureResult = l.ensure( 100 );
+ CPPUNIT_ASSERT( !ensureResult.second );
+ CPPUNIT_ASSERT( ensureResult.first.key() == 100 );
+ CPPUNIT_ASSERT( ensureResult.first.val().m_val == 0 );
+ ensureResult.first.val().m_val = 5;
+ it = l.find( 100 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 100 );
+ CPPUNIT_ASSERT( it.val().m_val == 5 );
+
+ CPPUNIT_ASSERT( !l.empty() );
+
+ // ensure new item
+ ensureResult = l.ensure( 1000 );
+ CPPUNIT_ASSERT( ensureResult.second );
+ CPPUNIT_ASSERT( ensureResult.first.key() == 1000 );
+ CPPUNIT_ASSERT( ensureResult.first.val().m_val == 0 );
+ ensureResult.first.val().m_val = 33;
+ ensureResult = l.ensure( 1000 );
+ CPPUNIT_ASSERT( !ensureResult.second );
+ CPPUNIT_ASSERT( ensureResult.first.key() == 1000 );
+ CPPUNIT_ASSERT( ensureResult.first.val().m_val == 33 );
+
+ // clear test
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+
+ // insert test
+ CPPUNIT_ASSERT( l.emplace( 501 ) != l.end());
+ CPPUNIT_ASSERT( l.emplace( 251, 152 ) != l.end());
+
+ // insert failed - such key exists
+ CPPUNIT_ASSERT( l.emplace( 501, 2 ) == l.end());
+ CPPUNIT_ASSERT( l.emplace( 251, 10) == l.end());
+
+ it = l.find(501);
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 501 );
+ CPPUNIT_ASSERT( it.val().m_val == 0 );
+
+ it = l.find(251);
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 251 );
+ CPPUNIT_ASSERT( it.val().m_val == 152 );
+
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+
+ // Iterator test
+ {
+ int nCount = 100;
+ for ( int i = 0; i < nCount; ++i )
+ CPPUNIT_ASSERT( l.insert(i, i * 2 ) != l.end() );
+
+ {
+ typename OrdList::iterator it( l.begin() );
+ typename OrdList::const_iterator cit( l.cbegin() );
+ CPPUNIT_CHECK( it == cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ ++it;
+ CPPUNIT_CHECK( it != cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ ++cit;
+ CPPUNIT_CHECK( it == cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ }
+
+ int i = 0;
+ for ( typename OrdList::iterator iter = l.begin(), itEnd = l.end(); iter != itEnd; ++iter, ++i ) {
+ CPPUNIT_ASSERT( iter.key() == i );
+ CPPUNIT_ASSERT( iter->first == i );
+ CPPUNIT_ASSERT( (*iter).first == i );
+
+ CPPUNIT_ASSERT( iter.val().m_val == i * 2 );
+ CPPUNIT_ASSERT( iter->second.m_val == i * 2 );
+ CPPUNIT_ASSERT( (*iter).second.m_val == i * 2 );
+
+ iter.val().m_val = i * 3;
+ }
+
+ // Check that we have visited all items
+ for ( int i = 0; i < nCount; ++i ) {
+ it = l.find( i );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == i );
+ CPPUNIT_ASSERT( it.val().m_val == i * 3 );
+ }
+
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+
+ // Const iterator
+ for ( int i = 0; i < nCount; ++i )
+ CPPUNIT_ASSERT( l.insert(i, i * 7) != l.end() );
+
+ i = 0;
+ const OrdList& rl = l;
+ for ( typename OrdList::const_iterator iter = rl.begin(), itEnd = rl.end(); iter != itEnd; ++iter, ++i ) {
+ CPPUNIT_ASSERT( iter.key() == i );
+ CPPUNIT_ASSERT( iter->first == i );
+ CPPUNIT_ASSERT( (*iter).first == i );
+
+ CPPUNIT_ASSERT( iter.val().m_val == i * 7 );
+ CPPUNIT_ASSERT( iter->second.m_val == i * 7 );
+ CPPUNIT_ASSERT( (*iter).second.m_val == i * 7 );
+ // it.val().m_val = i * 3 ; // error: const-iterator
+ }
+
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+ }
+
+ }
+ }
+
+ template <class UnordList>
+ void nogc_unord_test()
+ {
+ typedef typename UnordList::value_type value_type;
+ typedef typename UnordList::iterator iterator;
+
+ {
+ UnordList l;
+ iterator it;
+
+ CPPUNIT_ASSERT( l.empty() );
+
+ // insert / find test
+ CPPUNIT_ASSERT( l.find( 100 ) == l.end() );
+ CPPUNIT_ASSERT( l.insert( 100 ) != l.end() );
+ CPPUNIT_ASSERT( !l.empty() );
+ it = l.find( 100 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 100 );
+ CPPUNIT_ASSERT( it.val().m_val == 0 );
+
+ CPPUNIT_ASSERT( l.find_with( 50, eq<key_type>() ) == l.end() );
+ CPPUNIT_ASSERT( l.insert( 50, 500 ) != l.end());
+ it = l.find( 50 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 50 );
+ CPPUNIT_ASSERT( it.val().m_val == 500 );
+
+ CPPUNIT_ASSERT( l.insert( 50, 5 ) == l.end() );
+ it = l.find( 50 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 50 );
+ CPPUNIT_ASSERT( it.val().m_val == 500 );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ CPPUNIT_ASSERT( l.find( 150 ) == l.end() );
+ CPPUNIT_ASSERT( l.insert_with( 150, insert_functor() ) != l.end() );
+ it = l.find( 150 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 150 );
+ CPPUNIT_ASSERT( it.val().m_val == 1500 );
+ it = l.find( 100 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 100 );
+ CPPUNIT_ASSERT( it.val().m_val == 0 );
+ it = l.find( 50 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 50 );
+ CPPUNIT_ASSERT( it.val().m_val == 500 );
+ it.val().m_val = 25;
+ it = l.find( 50 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 50 );
+ CPPUNIT_ASSERT( it.val().m_val == 25 );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ // ensure existing item
+ std::pair<iterator, bool> ensureResult;
+ ensureResult = l.ensure( 100 );
+ CPPUNIT_ASSERT( !ensureResult.second );
+ CPPUNIT_ASSERT( ensureResult.first.key() == 100 );
+ CPPUNIT_ASSERT( ensureResult.first.val().m_val == 0 );
+ ensureResult.first.val().m_val = 5;
+ it = l.find( 100 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 100 );
+ CPPUNIT_ASSERT( it.val().m_val == 5 );
+
+ CPPUNIT_ASSERT( !l.empty() );
+
+ // ensure new item
+ ensureResult = l.ensure( 1000 );
+ CPPUNIT_ASSERT( ensureResult.second );
+ CPPUNIT_ASSERT( ensureResult.first.key() == 1000 );
+ CPPUNIT_ASSERT( ensureResult.first.val().m_val == 0 );
+ ensureResult.first.val().m_val = 33;
+ ensureResult = l.ensure( 1000 );
+ CPPUNIT_ASSERT( !ensureResult.second );
+ CPPUNIT_ASSERT( ensureResult.first.key() == 1000 );
+ CPPUNIT_ASSERT( ensureResult.first.val().m_val == 33 );
+
+ // clear test
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+
+ // insert test
+ CPPUNIT_ASSERT( l.emplace( 501 ) != l.end());
+ CPPUNIT_ASSERT( l.emplace( 251, 152 ) != l.end());
+
+ // insert failed - such key exists
+ CPPUNIT_ASSERT( l.emplace( 501, 2 ) == l.end());
+ CPPUNIT_ASSERT( l.emplace( 251, 10) == l.end());
+
+ it = l.find(501);
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 501 );
+ CPPUNIT_ASSERT( it.val().m_val == 0 );
+
+ it = l.find(251);
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 251 );
+ CPPUNIT_ASSERT( it.val().m_val == 152 );
+
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+
+ // Iterator test
+ {
+ int nCount = 100;
+ for ( int i = 0; i < nCount; ++i )
+ CPPUNIT_ASSERT( l.insert(i, i * 2 ) != l.end() );
+
+ {
+ typename UnordList::iterator it( l.begin() );
+ typename UnordList::const_iterator cit( l.cbegin() );
+ CPPUNIT_CHECK( it == cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ ++it;
+ CPPUNIT_CHECK( it != cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ ++cit;
+ CPPUNIT_CHECK( it == cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ }
+
+ int i = 0;
+ for ( typename UnordList::iterator iter = l.begin(), itEnd = l.end(); iter != itEnd; ++iter, ++i ) {
+ CPPUNIT_ASSERT( iter.key() == i );
+ CPPUNIT_ASSERT( iter->first == i );
+ CPPUNIT_ASSERT( (*iter).first == i );
+
+ CPPUNIT_ASSERT( iter.val().m_val == i * 2 );
+ CPPUNIT_ASSERT( iter->second.m_val == i * 2 );
+ CPPUNIT_ASSERT( (*iter).second.m_val == i * 2 );
+
+ iter.val().m_val = i * 3;
+ }
+
+ // Check that we have visited all items
+ for ( int i = 0; i < nCount; ++i ) {
+ it = l.find( i );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == i );
+ CPPUNIT_ASSERT( it.val().m_val == i * 3 );
+ }
+
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+
+ // Const iterator
+ for ( int i = 0; i < nCount; ++i )
+ CPPUNIT_ASSERT( l.insert(i, i * 7) != l.end() );
+
+ i = 0;
+ const UnordList& rl = l;
+ for ( typename UnordList::const_iterator iter = rl.begin(), itEnd = rl.end(); iter != itEnd; ++iter, ++i ) {
+ CPPUNIT_ASSERT( iter.key() == i );
+ CPPUNIT_ASSERT( iter->first == i );
+ CPPUNIT_ASSERT( (*iter).first == i );
+
+ CPPUNIT_ASSERT( iter.val().m_val == i * 7 );
+ CPPUNIT_ASSERT( iter->second.m_val == i * 7 );
+ CPPUNIT_ASSERT( (*iter).second.m_val == i * 7 );
+ // it.val().m_val = i * 3 ; // error: const-iterator
+ }
+
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+ }
+
+ }
+ }
+
+
+ void HP_cmp();
+ void HP_less();
+ void HP_cmpmix();
+ void HP_ic();
+
+ void DHP_cmp();
+ void DHP_less();
+ void DHP_cmpmix();
+ void DHP_ic();
+
+ void RCU_GPI_cmp();
+ void RCU_GPI_less();
+ void RCU_GPI_cmpmix();
+ void RCU_GPI_ic();
+
+ void RCU_GPB_cmp();
+ void RCU_GPB_less();
+ void RCU_GPB_cmpmix();
+ void RCU_GPB_ic();
+
+ void RCU_GPT_cmp();
+ void RCU_GPT_less();
+ void RCU_GPT_cmpmix();
+ void RCU_GPT_ic();
+
+ void RCU_SHB_cmp();
+ void RCU_SHB_less();
+ void RCU_SHB_cmpmix();
+ void RCU_SHB_ic();
+
+ void RCU_SHT_cmp();
+ void RCU_SHT_less();
+ void RCU_SHT_cmpmix();
+ void RCU_SHT_ic();
+
+ void NOGC_cmp();
+ void NOGC_less();
+ void NOGC_cmpmix();
+ void NOGC_ic();
+
+ void NOGC_cmp_unord();
+ void NOGC_less_unord();
+ void NOGC_equal_to_unord();
+ void NOGC_cmpmix_unord();
+ void NOGC_ic_unord();
+
+ CPPUNIT_TEST_SUITE(LazyKVListTestHeader)
+ CPPUNIT_TEST(HP_cmp)
+ CPPUNIT_TEST(HP_less)
+ CPPUNIT_TEST(HP_cmpmix)
+ CPPUNIT_TEST(HP_ic)
+
+ CPPUNIT_TEST(DHP_cmp)
+ CPPUNIT_TEST(DHP_less)
+ CPPUNIT_TEST(DHP_cmpmix)
+ CPPUNIT_TEST(DHP_ic)
+
+ CPPUNIT_TEST(RCU_GPI_cmp)
+ CPPUNIT_TEST(RCU_GPI_less)
+ CPPUNIT_TEST(RCU_GPI_cmpmix)
+ CPPUNIT_TEST(RCU_GPI_ic)
+
+ CPPUNIT_TEST(RCU_GPB_cmp)
+ CPPUNIT_TEST(RCU_GPB_less)
+ CPPUNIT_TEST(RCU_GPB_cmpmix)
+ CPPUNIT_TEST(RCU_GPB_ic)
+
+ CPPUNIT_TEST(RCU_GPT_cmp)
+ CPPUNIT_TEST(RCU_GPT_less)
+ CPPUNIT_TEST(RCU_GPT_cmpmix)
+ CPPUNIT_TEST(RCU_GPT_ic)
+
+ CPPUNIT_TEST(RCU_SHB_cmp)
+ CPPUNIT_TEST(RCU_SHB_less)
+ CPPUNIT_TEST(RCU_SHB_cmpmix)
+ CPPUNIT_TEST(RCU_SHB_ic)
+
+ CPPUNIT_TEST(RCU_SHT_cmp)
+ CPPUNIT_TEST(RCU_SHT_less)
+ CPPUNIT_TEST(RCU_SHT_cmpmix)
+ CPPUNIT_TEST(RCU_SHT_ic)
+
+ CPPUNIT_TEST(NOGC_cmp)
+ CPPUNIT_TEST(NOGC_less)
+ CPPUNIT_TEST(NOGC_cmpmix)
+ CPPUNIT_TEST(NOGC_ic)
+
+ CPPUNIT_TEST(NOGC_cmp_unord)
+ CPPUNIT_TEST(NOGC_less_unord)
+ CPPUNIT_TEST(NOGC_equal_to_unord)
+ CPPUNIT_TEST(NOGC_cmpmix_unord)
+ CPPUNIT_TEST(NOGC_ic_unord)
+
+ CPPUNIT_TEST_SUITE_END()
+ };
+
+} // namespace ordlist
+
+#endif // #ifndef CDSTEST_HDR_LAZY_KV_H
\ No newline at end of file
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_lazy_kv.h"
+#include <cds/container/lazy_kvlist_dhp.h>
+
+namespace ordlist {
+ namespace {
+ struct DHP_cmp_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
+ };
+ }
+ void LazyKVListTestHeader::DHP_cmp()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< cds::gc::DHP, key_type, value_type, DHP_cmp_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< cds::gc::DHP, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+ namespace {
+ struct DHP_less_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ };
+ }
+ void LazyKVListTestHeader::DHP_less()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< cds::gc::DHP, key_type, value_type, DHP_less_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< cds::gc::DHP, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+ namespace {
+ struct DHP_cmpmix_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ };
+ }
+ void LazyKVListTestHeader::DHP_cmpmix()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< cds::gc::DHP, key_type, value_type, DHP_cmpmix_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< cds::gc::DHP, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ ,cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+ namespace {
+ struct DHP_ic_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+ void LazyKVListTestHeader::DHP_ic()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< cds::gc::DHP, key_type, value_type, DHP_ic_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< cds::gc::DHP, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+} // namespace ordlist
+
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_lazy_kv.h"
+#include <cds/container/lazy_kvlist_hp.h>
+
+namespace ordlist {
+ namespace {
+ struct HP_cmp_traits: public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
+ };
+
+ }
+ void LazyKVListTestHeader::HP_cmp()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< cds::gc::HP, key_type, value_type, HP_cmp_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< cds::gc::HP,
+ key_type,
+ value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+ namespace {
+ struct HP_less_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ };
+ }
+ void LazyKVListTestHeader::HP_less()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< cds::gc::HP, key_type, value_type, HP_less_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< cds::gc::HP, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+ namespace {
+ struct HP_cmpmix_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ };
+ }
+ void LazyKVListTestHeader::HP_cmpmix()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< cds::gc::HP, key_type, value_type, HP_cmpmix_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< cds::gc::HP, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ ,cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+ namespace {
+ struct HP_ic_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+ void LazyKVListTestHeader::HP_ic()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< cds::gc::HP, key_type, value_type, HP_ic_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< cds::gc::HP, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+} // namespace ordlist
+
+CPPUNIT_TEST_SUITE_REGISTRATION(ordlist::LazyKVListTestHeader);
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_lazy_kv.h"
+#include <cds/container/lazy_kvlist_nogc.h>
+
+namespace ordlist {
+ namespace {
+ struct NOGC_cmp_traits: public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
+ };
+
+ }
+ void LazyKVListTestHeader::NOGC_cmp()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< cds::gc::nogc, key_type, value_type, NOGC_cmp_traits > list;
+ nogc_test< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< cds::gc::nogc,
+ key_type,
+ value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ >::type
+ > opt_list;
+ nogc_test< opt_list >();
+ }
+
+ namespace {
+ struct NOGC_less_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ };
+ }
+ void LazyKVListTestHeader::NOGC_less()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< cds::gc::nogc, key_type, value_type, NOGC_less_traits > list;
+ nogc_test< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< cds::gc::nogc, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ nogc_test< opt_list >();
+ }
+
+ namespace {
+ struct NOGC_cmpmix_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ };
+ }
+ void LazyKVListTestHeader::NOGC_cmpmix()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< cds::gc::nogc, key_type, value_type, NOGC_cmpmix_traits > list;
+ nogc_test< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< cds::gc::nogc, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ ,cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ nogc_test< opt_list >();
+ }
+
+ namespace {
+ struct NOGC_ic_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+ void LazyKVListTestHeader::NOGC_ic()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< cds::gc::nogc, key_type, value_type, NOGC_ic_traits > list;
+ nogc_test< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< cds::gc::nogc, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ nogc_test< opt_list >();
+ }
+
+} // namespace ordlist
+
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_lazy_kv.h"
+#include <cds/container/lazy_kvlist_nogc.h>
+
+namespace ordlist {
+ namespace {
+ struct NOGC_cmp_traits: public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
+ static const bool sort = false;
+ };
+
+ }
+ void LazyKVListTestHeader::NOGC_cmp_unord()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< cds::gc::nogc, key_type, value_type, NOGC_cmp_traits > list;
+ nogc_unord_test< list >();
+
+ // option-based version
+ typedef cc::LazyKVList< cds::gc::nogc,
+ key_type,
+ value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ ,cc::opt::sort<false>
+ >::type
+ > opt_list;
+ nogc_unord_test< opt_list >();
+ }
+
+ namespace {
+ struct NOGC_less_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ static const bool sort = false;
+ };
+ }
+ void LazyKVListTestHeader::NOGC_less_unord()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< cds::gc::nogc, key_type, value_type, NOGC_less_traits > list;
+ nogc_unord_test< list >();
+
+ // option-based version
+ typedef cc::LazyKVList< cds::gc::nogc, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ ,cc::opt::sort<false>
+ >::type
+ > opt_list;
+ nogc_unord_test< opt_list >();
+ }
+
+ namespace {
+ struct NOGC_equal_to_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::eq<LazyKVListTestHeader::key_type> equal_to;
+ static const bool sort = false;
+ };
+ }
+ void LazyKVListTestHeader::NOGC_equal_to_unord()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< cds::gc::nogc, key_type, value_type, NOGC_equal_to_traits > list;
+ nogc_unord_test< list >();
+
+ // option-based version
+ typedef cc::LazyKVList< cds::gc::nogc, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::equal_to< eq<key_type> >
+ ,cc::opt::sort<false>
+ >::type
+ > opt_list;
+ nogc_unord_test< opt_list >();
+ }
+
+ namespace {
+ struct NOGC_cmpmix_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ typedef LazyKVListTestHeader::eq<LazyKVListTestHeader::key_type> equal_to;
+ static const bool sort = false;
+ };
+ }
+ void LazyKVListTestHeader::NOGC_cmpmix_unord()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< cds::gc::nogc, key_type, value_type, NOGC_cmpmix_traits > list;
+ nogc_unord_test< list >();
+
+ // option-based version
+ typedef cc::LazyKVList< cds::gc::nogc, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ ,cc::opt::less< lt<key_type> >
+ ,cc::opt::equal_to< eq<key_type> >
+ ,cc::opt::sort<false>
+ >::type
+ > opt_list;
+ nogc_unord_test< opt_list >();
+ }
+
+ namespace {
+ struct NOGC_ic_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::eq<LazyKVListTestHeader::key_type> equal_to;
+ typedef cds::atomicity::item_counter item_counter;
+ static const bool sort = false;
+ };
+ }
+ void LazyKVListTestHeader::NOGC_ic_unord()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< cds::gc::nogc, key_type, value_type, NOGC_ic_traits > list;
+ nogc_unord_test< list >();
+
+ // option-based version
+ typedef cc::LazyKVList< cds::gc::nogc, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::equal_to< eq<key_type> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ ,cc::opt::sort<false>
+ >::type
+ > opt_list;
+ nogc_unord_test< opt_list >();
+ }
+
+} // namespace ordlist
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_lazy_kv.h"
+#include <cds/urcu/general_buffered.h>
+#include <cds/container/lazy_kvlist_rcu.h>
+
+namespace ordlist {
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type;
+
+ struct RCU_GPB_cmp_traits: public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
+ };
+ }
+ void LazyKVListTestHeader::RCU_GPB_cmp()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_GPB_cmp_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< rcu_type, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPB_less_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ };
+ }
+ void LazyKVListTestHeader::RCU_GPB_less()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_GPB_less_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< rcu_type, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPB_cmpmix_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ };
+ }
+ void LazyKVListTestHeader::RCU_GPB_cmpmix()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_GPB_cmpmix_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< rcu_type, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ ,cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPB_ic_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+ void LazyKVListTestHeader::RCU_GPB_ic()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_GPB_ic_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< rcu_type, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+} // namespace ordlist
+
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_lazy_kv.h"
+#include <cds/urcu/general_instant.h>
+#include <cds/container/lazy_kvlist_rcu.h>
+
+namespace ordlist {
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type;
+
+ struct RCU_GPI_cmp_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
+ };
+ }
+ void LazyKVListTestHeader::RCU_GPI_cmp()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_GPI_cmp_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< rcu_type, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPI_less_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ };
+ }
+ void LazyKVListTestHeader::RCU_GPI_less()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_GPI_less_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< rcu_type, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPI_cmpmix_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ };
+ }
+ void LazyKVListTestHeader::RCU_GPI_cmpmix()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_GPI_cmpmix_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< rcu_type, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ ,cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPI_ic_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+ void LazyKVListTestHeader::RCU_GPI_ic()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_GPI_ic_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< rcu_type, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+} // namespace ordlist
+
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_lazy_kv.h"
+#include <cds/urcu/general_threaded.h>
+#include <cds/container/lazy_kvlist_rcu.h>
+
+namespace ordlist {
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type;
+
+ struct RCU_GPT_cmp_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
+ };
+ }
+ void LazyKVListTestHeader::RCU_GPT_cmp()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_GPT_cmp_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< rcu_type, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPT_less_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ };
+ }
+ void LazyKVListTestHeader::RCU_GPT_less()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_GPT_less_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< rcu_type, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPT_cmpmix_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ };
+ }
+ void LazyKVListTestHeader::RCU_GPT_cmpmix()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_GPT_cmpmix_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< rcu_type, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ ,cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPT_ic_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+ void LazyKVListTestHeader::RCU_GPT_ic()
+ {
+ // traits-based version
+ typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_GPT_ic_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< rcu_type, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+} // namespace ordlist
+
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_lazy_kv.h"
+#include <cds/urcu/signal_buffered.h>
+#include <cds/container/lazy_kvlist_rcu.h>
+
+namespace ordlist {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
+
+ struct RCU_SHB_cmp_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
+ };
+ }
+#endif
+
+ void LazyKVListTestHeader::RCU_SHB_cmp()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_SHB_cmp_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< rcu_type, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ struct RCU_SHB_less_traits: public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ };
+ }
+#endif
+
+ void LazyKVListTestHeader::RCU_SHB_less()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_SHB_less_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< rcu_type, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ struct RCU_SHB_cmpmix_traits: public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ };
+ }
+#endif
+
+ void LazyKVListTestHeader::RCU_SHB_cmpmix()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_SHB_cmpmix_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< rcu_type, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ ,cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ struct RCU_SHB_ic_traits: public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+#endif
+
+ void LazyKVListTestHeader::RCU_SHB_ic()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_SHB_ic_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< rcu_type, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+} // namespace ordlist
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_lazy_kv.h"
+#include <cds/urcu/signal_threaded.h>
+#include <cds/container/lazy_kvlist_rcu.h>
+
+namespace ordlist {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type;
+
+ struct RCU_SHT_cmp_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
+ };
+ }
+#endif
+ void LazyKVListTestHeader::RCU_SHT_cmp()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_SHT_cmp_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< rcu_type, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ struct RCU_SHT_less_traits : public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ };
+ }
+#endif
+ void LazyKVListTestHeader::RCU_SHT_less()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_SHT_less_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< rcu_type, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ struct RCU_SHT_cmpmix_traits: public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ };
+ }
+#endif
+ void LazyKVListTestHeader::RCU_SHT_cmpmix()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_SHT_cmpmix_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< rcu_type, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ ,cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ struct RCU_SHT_ic_traits: public cc::lazy_list::traits
+ {
+ typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+#endif
+ void LazyKVListTestHeader::RCU_SHT_ic()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_SHT_ic_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyKVList< rcu_type, key_type, value_type,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+} // namespace ordlist
+
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_lazy.h"
+#include <cds/container/lazy_list_nogc.h>
+
+namespace ordlist {
+ namespace {
+ struct NOGC_cmp_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
+ };
+ }
+ void LazyListTestHeader::NOGC_cmp()
+ {
+ // traits-based version
+ typedef cc::LazyList< cds::gc::nogc, item, NOGC_cmp_traits > list;
+ nogc_test< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< cds::gc::nogc, item,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ >::type
+ > opt_list;
+ nogc_test< opt_list >();
+ }
+
+ namespace {
+ struct NOGC_less_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ };
+ }
+ void LazyListTestHeader::NOGC_less()
+ {
+ // traits-based version
+ typedef cc::LazyList< cds::gc::nogc, item, NOGC_less_traits > list;
+ nogc_test< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< cds::gc::nogc, item,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ nogc_test< opt_list >();
+ }
+
+ namespace {
+ struct NOGC_cmpmix_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ };
+ }
+ void LazyListTestHeader::NOGC_cmpmix()
+ {
+ // traits-based version
+ typedef cc::LazyList< cds::gc::nogc, item, NOGC_cmpmix_traits > list;
+ nogc_test< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< cds::gc::nogc, item,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ ,cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ nogc_test< opt_list >();
+ }
+
+ namespace {
+ struct NOGC_ic_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+ void LazyListTestHeader::NOGC_ic()
+ {
+ // traits-based version
+ typedef cc::LazyList< cds::gc::nogc, item, NOGC_ic_traits > list;
+ nogc_test< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< cds::gc::nogc, item,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<item> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ nogc_test< opt_list >();
+ }
+} // namespace ordlist
+
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_lazy.h"
+#include <cds/container/lazy_list_nogc.h>
+
+namespace ordlist {
+ namespace {
+ struct NOGC_cmp_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
+ static const bool sort = false;
+ };
+ }
+ void LazyListTestHeader::NOGC_cmp_unord()
+ {
+ // traits-based version
+ typedef cc::LazyList< cds::gc::nogc, item, NOGC_cmp_traits > list;
+ nogc_unord_test< list >();
+
+ // option-based version
+ typedef cc::LazyList< cds::gc::nogc, item,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ ,cc::opt::sort<false>
+ >::type
+ > opt_list;
+ nogc_unord_test< opt_list >();
+ }
+
+ namespace {
+ struct NOGC_less_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ static const bool sort = false;
+ };
+ }
+ void LazyListTestHeader::NOGC_less_unord()
+ {
+ // traits-based version
+ typedef cc::LazyList< cds::gc::nogc, item, NOGC_less_traits > list;
+ nogc_unord_test< list >();
+
+ // option-based version
+ typedef cc::LazyList< cds::gc::nogc, item,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<item> >
+ ,cc::opt::sort<false>
+ >::type
+ > opt_list;
+ nogc_unord_test< opt_list >();
+ }
+
+ namespace {
+ struct NOGC_equal_to_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::equal_to<LazyListTestHeader::item> equal_to;
+ static const bool sort = false;
+ };
+ }
+ void LazyListTestHeader::NOGC_equal_to_unord()
+ {
+ // traits-based version
+ typedef cc::LazyList< cds::gc::nogc, item, NOGC_equal_to_traits > list;
+ nogc_unord_test< list >();
+
+ // option-based version
+ typedef cc::LazyList< cds::gc::nogc, item,
+ cc::lazy_list::make_traits<
+ cc::opt::equal_to< equal_to<item> >
+ ,cc::opt::sort<false>
+ >::type
+ > opt_list;
+ nogc_unord_test< opt_list >();
+ }
+
+ namespace {
+ struct NOGC_cmpmix_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ static const bool sort = false;
+ };
+ }
+ void LazyListTestHeader::NOGC_cmpmix_unord()
+ {
+ // traits-based version
+ typedef cc::LazyList< cds::gc::nogc, item, NOGC_cmpmix_traits > list;
+ nogc_unord_test< list >();
+
+ // option-based version
+ typedef cc::LazyList< cds::gc::nogc, item,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ ,cc::opt::less< lt<item> >
+ ,cc::opt::sort<false>
+ >::type
+ > opt_list;
+ nogc_unord_test< opt_list >();
+ }
+
+ namespace {
+ struct NOGC_equal_to_mix_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ typedef LazyListTestHeader::equal_to<LazyListTestHeader::item> equal_to;
+ static const bool sort = false;
+ };
+ }
+ void LazyListTestHeader::NOGC_equal_to_mix_unord()
+ {
+ // traits-based version
+ typedef cc::LazyList< cds::gc::nogc, item, NOGC_equal_to_mix_traits > list;
+ nogc_unord_test< list >();
+
+ // option-based version
+ typedef cc::LazyList< cds::gc::nogc, item,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ ,cc::opt::less< lt<item> >
+ ,cc::opt::equal_to< equal_to<item> >
+ ,cc::opt::sort<false>
+ >::type
+ > opt_list;
+ nogc_unord_test< opt_list >();
+ }
+ namespace {
+ struct NOGC_ic_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::equal_to<LazyListTestHeader::item> equal_to;
+ typedef cds::atomicity::item_counter item_counter;
+ static const bool sort = false;
+ };
+ }
+ void LazyListTestHeader::NOGC_ic_unord()
+ {
+ // traits-based version
+ typedef cc::LazyList< cds::gc::nogc, item, NOGC_ic_traits > list;
+ nogc_unord_test< list >();
+
+ // option-based version
+ typedef cc::LazyList< cds::gc::nogc, item,
+ cc::lazy_list::make_traits<
+ cc::opt::equal_to< equal_to<item> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ ,cc::opt::sort<false>
+ >::type
+ > opt_list;
+ nogc_unord_test< opt_list >();
+ }
+
+} // namespace ordlist
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_lazy.h"
+#include <cds/urcu/general_buffered.h>
+#include <cds/container/lazy_list_rcu.h>
+
+namespace ordlist {
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type;
+
+ struct RCU_GPB_cmp_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
+ };
+ }
+ void LazyListTestHeader::RCU_GPB_cmp()
+ {
+ // traits-based version
+ typedef cc::LazyList< rcu_type, item, RCU_GPB_cmp_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< rcu_type, item,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPB_less_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ };
+ }
+ void LazyListTestHeader::RCU_GPB_less()
+ {
+ // traits-based version
+ typedef cc::LazyList< rcu_type, item, RCU_GPB_less_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< rcu_type, item,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPB_cmpmix_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ };
+ }
+ void LazyListTestHeader::RCU_GPB_cmpmix()
+ {
+ // traits-based version
+ typedef cc::LazyList< rcu_type, item, RCU_GPB_cmpmix_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< rcu_type, item,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ ,cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPB_ic_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+ void LazyListTestHeader::RCU_GPB_ic()
+ {
+ // traits-based version
+ typedef cc::LazyList< rcu_type, item, RCU_GPB_ic_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< rcu_type, item,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<item> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+} // namespace ordlist
+
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_lazy.h"
+#include <cds/urcu/general_instant.h>
+#include <cds/container/lazy_list_rcu.h>
+
+namespace ordlist {
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type;
+
+ struct RCU_GPI_cmp_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
+ };
+ }
+ void LazyListTestHeader::RCU_GPI_cmp()
+ {
+ // traits-based version
+ typedef cc::LazyList< rcu_type, item, RCU_GPI_cmp_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< rcu_type, item,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPI_less_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ };
+ }
+ void LazyListTestHeader::RCU_GPI_less()
+ {
+ // traits-based version
+ typedef cc::LazyList< rcu_type, item, RCU_GPI_less_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< rcu_type, item,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPI_cmpmix_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ };
+ }
+ void LazyListTestHeader::RCU_GPI_cmpmix()
+ {
+ // traits-based version
+ typedef cc::LazyList< rcu_type, item, RCU_GPI_cmpmix_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< rcu_type, item,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ ,cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPI_ic_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+ void LazyListTestHeader::RCU_GPI_ic()
+ {
+ // traits-based version
+ typedef cc::LazyList< rcu_type, item, RCU_GPI_ic_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< rcu_type, item,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<item> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+} // namespace ordlist
+
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_lazy.h"
+#include <cds/urcu/general_threaded.h>
+#include <cds/container/lazy_list_rcu.h>
+
+namespace ordlist {
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type;
+
+ struct RCU_GPT_cmp_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
+ };
+ }
+ void LazyListTestHeader::RCU_GPT_cmp()
+ {
+ // traits-based version
+ typedef cc::LazyList< rcu_type, item, RCU_GPT_cmp_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< rcu_type, item,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPT_less_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ };
+ }
+ void LazyListTestHeader::RCU_GPT_less()
+ {
+ // traits-based version
+ typedef cc::LazyList< rcu_type, item, RCU_GPT_less_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< rcu_type, item,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPT_cmpmix_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ };
+ }
+ void LazyListTestHeader::RCU_GPT_cmpmix()
+ {
+ // traits-based version
+ typedef cc::LazyList< rcu_type, item, RCU_GPT_cmpmix_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< rcu_type, item,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ ,cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPT_ic_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+ void LazyListTestHeader::RCU_GPT_ic()
+ {
+ // traits-based version
+ typedef cc::LazyList< rcu_type, item, RCU_GPT_ic_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< rcu_type, item,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<item> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+} // namespace ordlist
+
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_lazy.h"
+#include <cds/urcu/signal_buffered.h>
+#include <cds/container/lazy_list_rcu.h>
+
+namespace ordlist {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
+
+ struct RCU_SHB_cmp_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
+ };
+ }
+#endif
+ void LazyListTestHeader::RCU_SHB_cmp()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::LazyList< rcu_type, item, RCU_SHB_cmp_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< rcu_type, item,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ struct RCU_SHB_less_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ };
+ }
+#endif
+ void LazyListTestHeader::RCU_SHB_less()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::LazyList< rcu_type, item, RCU_SHB_less_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< rcu_type, item,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ struct RCU_SHB_cmpmix_traits: public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ };
+ }
+#endif
+ void LazyListTestHeader::RCU_SHB_cmpmix()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::LazyList< rcu_type, item, RCU_SHB_cmpmix_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< rcu_type, item,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ ,cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ struct RCU_SHB_ic_traits: public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+#endif
+ void LazyListTestHeader::RCU_SHB_ic()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::LazyList< rcu_type, item, RCU_SHB_ic_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< rcu_type, item,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<item> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+} // namespace ordlist
+
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_lazy.h"
+#include <cds/urcu/signal_threaded.h>
+#include <cds/container/lazy_list_rcu.h>
+
+namespace ordlist {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type;
+
+ struct RCU_SHT_cmp_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
+ };
+ }
+#endif
+ void LazyListTestHeader::RCU_SHT_cmp()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::LazyList< rcu_type, item, RCU_SHT_cmp_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< rcu_type, item,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ struct RCU_SHT_less_traits : public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ };
+ }
+#endif
+ void LazyListTestHeader::RCU_SHT_less()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::LazyList< rcu_type, item, RCU_SHT_less_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< rcu_type, item,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ struct RCU_SHT_cmpmix_traits: public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ };
+ }
+#endif
+ void LazyListTestHeader::RCU_SHT_cmpmix()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::LazyList< rcu_type, item, RCU_SHT_cmpmix_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< rcu_type, item,
+ cc::lazy_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ ,cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ struct RCU_SHT_ic_traits: public cc::lazy_list::traits
+ {
+ typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+#endif
+ void LazyListTestHeader::RCU_SHT_ic()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::LazyList< rcu_type, item, RCU_SHT_ic_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::LazyList< rcu_type, item,
+ cc::lazy_list::make_traits<
+ cc::opt::less< lt<item> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+} // namespace ordlist
+
--- /dev/null
+//$$CDS-header$$
+
+#ifndef CDSTEST_HDR_MICHAEL_H
+#define CDSTEST_HDR_MICHAEL_H
+
+#include "cppunit/cppunit_proxy.h"
+#include <cds/container/details/michael_list_base.h>
+
+namespace ordlist {
+ namespace cc = cds::container;
+ namespace co = cds::container::opt;
+
+ class MichaelListTestHeader: public CppUnitMini::TestCase
+ {
+ public:
+ struct stat {
+ int nEnsureExistsCall;
+ int nEnsureNewCall;
+
+ stat()
+ {
+ nEnsureExistsCall
+ = nEnsureNewCall
+ = 0;
+ }
+ };
+
+ struct item {
+ int nKey;
+ int nVal;
+
+ stat s;
+
+ item(int key)
+ : nKey( key )
+ , nVal( key * 2 )
+ , s()
+ {}
+
+ item(int key, int val)
+ : nKey( key )
+ , nVal(val)
+ , s()
+ {}
+
+ item( const item& v )
+ : nKey( v.nKey )
+ , nVal( v.nVal )
+ , s()
+ {}
+
+ int key() const
+ {
+ return nKey;
+ }
+ };
+
+ template <typename T>
+ struct lt
+ {
+ bool operator ()(const T& v1, const T& v2 ) const
+ {
+ return v1.key() < v2.key();
+ }
+
+ template <typename Q>
+ bool operator ()(const T& v1, const Q& v2 ) const
+ {
+ return v1.key() < v2;
+ }
+
+ template <typename Q>
+ bool operator ()(const Q& v1, const T& v2 ) const
+ {
+ return v1 < v2.key();
+ }
+ };
+
+ template <typename T>
+ struct cmp {
+ int operator ()(const T& v1, const T& v2 ) const
+ {
+ if ( v1.key() < v2.key() )
+ return -1;
+ return v1.key() > v2.key() ? 1 : 0;
+ }
+
+ template <typename Q>
+ int operator ()(const T& v1, const Q& v2 ) const
+ {
+ if ( v1.key() < v2 )
+ return -1;
+ return v1.key() > v2 ? 1 : 0;
+ }
+
+ template <typename Q>
+ int operator ()(const Q& v1, const T& v2 ) const
+ {
+ if ( v1 < v2.key() )
+ return -1;
+ return v1 > v2.key() ? 1 : 0;
+ }
+ };
+
+ struct insert_functor {
+ void operator ()( item& i )
+ {
+ i.nVal = i.nKey * 1033;
+ }
+ };
+ struct dummy_insert_functor {
+ void operator ()( item& /*i*/ )
+ {
+ // This functor should not be called
+ TestCase::current_test()->error( "CPPUNIT_ASSERT", "dummy_insert_functor should not be called", __FILE__, __LINE__ );
+ }
+ };
+
+ struct erase_functor {
+ unsigned int nEraseCall;
+
+ erase_functor()
+ : nEraseCall(0)
+ {}
+
+ void operator()( item const& /*i*/)
+ {
+ ++nEraseCall;
+ }
+ };
+
+ static void insert_function( item& i )
+ {
+ i.nVal = i.nKey * 1024;
+ }
+ static void dummy_insert_function( item& /*i*/ )
+ {
+ // This function should not be called
+ TestCase::current_test()->error( "CPPUNIT_ASSERT", "dummy_insert_function should not be called", __FILE__, __LINE__ );
+ }
+
+
+ struct check_value {
+ unsigned int m_nMultiplier;
+
+ check_value( unsigned int nMultiplier )
+ : m_nMultiplier( nMultiplier )
+ {}
+
+ check_value( const check_value& s )
+ : m_nMultiplier( s.m_nMultiplier )
+ {}
+
+ void operator()( item& i, int )
+ {
+ CPPUNIT_ASSERT_CURRENT( int(i.nKey * m_nMultiplier) == i.nVal );
+ }
+ };
+
+ struct check_exact_value {
+ int m_nExpected;
+
+ check_exact_value( int nExpected )
+ : m_nExpected( nExpected )
+ {}
+
+ check_exact_value( check_exact_value const& s)
+ : m_nExpected( s.m_nExpected )
+ {}
+
+ void operator()( item& i, int )
+ {
+ CPPUNIT_ASSERT_CURRENT( i.nVal == m_nExpected );
+ }
+ };
+
+ struct dummy_check_value {
+ void operator()( item& /*i*/, int )
+ {
+ // This functor should not be called
+ TestCase::current_test()->error( "CPPUNIT_ASSERT", "dummy_check_value should not be called", __FILE__, __LINE__ );
+ }
+ };
+
+ struct ensure_functor {
+ void operator()( bool /*bNew*/, item& i, int /*n*/ )
+ {
+ i.nVal = i.nKey * 1024;
+ }
+ };
+
+ static void ensure_func( bool /*bNew*/, item& i, int n )
+ {
+ i.nVal = n * 1033;
+ }
+
+ struct other_item
+ {
+ int nKey;
+
+ other_item()
+ {}
+
+ other_item(int n)
+ : nKey(n)
+ {}
+ };
+
+ struct other_less
+ {
+ template <typename T1, typename T2>
+ bool operator()( T1 const& t1, T2 const& t2 ) const
+ {
+ return t1.nKey < t2.nKey;
+ }
+ };
+
+ protected:
+ template <class OrdList>
+ void test_with( OrdList& l )
+ {
+ typedef typename OrdList::value_type value_type;
+
+ // The list should be empty
+ CPPUNIT_ASSERT( l.empty() );
+
+ // insert test
+ CPPUNIT_ASSERT( l.insert( 50 ) );
+ CPPUNIT_ASSERT( l.insert( item( 25 )) );
+ CPPUNIT_ASSERT( l.insert( item( 100 )) );
+
+ // insert failed - such key exists
+ CPPUNIT_ASSERT( !l.insert( 50 ) );
+ CPPUNIT_ASSERT( !l.insert( item( 100 )) );
+
+ // clear test
+
+ // The list should not be empty
+ CPPUNIT_ASSERT( !l.empty() );
+ l.clear();
+ // and now the list is empty
+ CPPUNIT_ASSERT( l.empty() );
+
+ // Test insert with functor
+
+ CPPUNIT_ASSERT( l.insert( 100, insert_functor() ) );
+ // passed by ref
+ {
+ insert_functor f;
+ CPPUNIT_ASSERT( l.insert( item( 25 ), std::ref( f ) ) );
+ CPPUNIT_ASSERT( !l.insert( item( 100 ), std::ref( f ) ) );
+ }
+ // Test insert with function
+ CPPUNIT_ASSERT( l.insert( 50, insert_function ));
+ CPPUNIT_ASSERT( !l.insert( 25, dummy_insert_function ));
+ CPPUNIT_ASSERT( !l.insert( 100, dummy_insert_functor() ));
+
+ // The list should not be empty
+ CPPUNIT_ASSERT( !l.empty() );
+
+ // Check inserted values
+ {
+ int i;
+ i = 100;
+ CPPUNIT_ASSERT( l.find( 100 ));
+ CPPUNIT_ASSERT( l.find( i, check_value(1033) ));
+ {
+ check_value f(1033);
+ i = 25;
+ CPPUNIT_ASSERT( l.find_with( 25, lt<value_type>() ));
+ CPPUNIT_ASSERT( l.find_with( i, lt<value_type>(), std::ref( f ) ) );
+ }
+ i = 50;
+ CPPUNIT_ASSERT( l.find( 50 ));
+ CPPUNIT_ASSERT( l.find( i, check_value(1024) ));
+
+ i = 10;
+ CPPUNIT_ASSERT( !l.find_with( 10, lt<value_type>() ));
+ CPPUNIT_ASSERT( !l.find_with( i, lt<value_type>(), dummy_check_value() ));
+ i = 75;
+ CPPUNIT_ASSERT( !l.find( 75 ));
+ CPPUNIT_ASSERT( !l.find( i, dummy_check_value() ));
+ i = 150;
+ CPPUNIT_ASSERT( !l.find( 150 ));
+ CPPUNIT_ASSERT( !l.find( i, dummy_check_value() ));
+ }
+
+ // The list should not be empty
+ CPPUNIT_ASSERT( !l.empty() );
+ l.clear();
+ // and now the list is empty
+ CPPUNIT_ASSERT( l.empty() );
+
+ // Ensure test
+ {
+ std::pair<bool, bool> ensureResult;
+ ensure_functor f;
+ ensureResult = l.ensure( 100, ensure_functor() );
+ CPPUNIT_ASSERT( ensureResult.first );
+ CPPUNIT_ASSERT( ensureResult.second );
+
+ ensureResult = l.ensure( 200, std::ref( f ) );
+ CPPUNIT_ASSERT( ensureResult.first );
+ CPPUNIT_ASSERT( ensureResult.second );
+
+ ensureResult = l.ensure( 50, ensure_func );
+ CPPUNIT_ASSERT( ensureResult.first );
+ CPPUNIT_ASSERT( ensureResult.second );
+
+ int i;
+ i = 100;
+ CPPUNIT_ASSERT( l.find( i, check_value(1024) ));
+ i = 50;
+ CPPUNIT_ASSERT( l.find( i, check_value(1033) ));
+ i = 200;
+ CPPUNIT_ASSERT( l.find( i, check_value(1024) ));
+
+ // ensure existing key
+ ensureResult = l.ensure( 200, ensure_func );
+ CPPUNIT_ASSERT( ensureResult.first );
+ CPPUNIT_ASSERT( !ensureResult.second );
+ i = 200;
+ CPPUNIT_ASSERT( l.find( i, check_value(1033) ));
+
+ ensureResult = l.ensure( 50, ensure_functor() );
+ CPPUNIT_ASSERT( ensureResult.first );
+ CPPUNIT_ASSERT( !ensureResult.second );
+ i = 50;
+ CPPUNIT_ASSERT( l.find( i, check_value(1024) ));
+ }
+
+ // erase test (list: 50, 100, 200)
+ CPPUNIT_ASSERT( !l.empty() );
+ CPPUNIT_ASSERT( l.insert(160));
+ CPPUNIT_ASSERT( l.insert(250));
+ CPPUNIT_ASSERT( !l.empty() );
+
+ CPPUNIT_ASSERT( !l.erase( 150 ));
+
+ CPPUNIT_ASSERT( l.erase( 100 ));
+ CPPUNIT_ASSERT( !l.erase( 100 ));
+
+ CPPUNIT_ASSERT( l.erase_with( 200, lt<value_type>() ));
+ CPPUNIT_ASSERT( !l.erase_with( 200, lt<value_type>() ));
+
+ {
+ erase_functor ef;
+ CPPUNIT_ASSERT( ef.nEraseCall == 0 );
+ CPPUNIT_ASSERT( l.erase_with( 160, lt<value_type>(), std::ref(ef) ));
+ CPPUNIT_ASSERT( ef.nEraseCall == 1 );
+ CPPUNIT_ASSERT( !l.erase_with( 160, lt<value_type>(), std::ref(ef) ));
+ CPPUNIT_ASSERT( ef.nEraseCall == 1 );
+
+ CPPUNIT_ASSERT( l.erase( 250, std::ref(ef) ));
+ CPPUNIT_ASSERT( ef.nEraseCall == 2 );
+ CPPUNIT_ASSERT( !l.erase( 250, std::ref(ef) ));
+ CPPUNIT_ASSERT( ef.nEraseCall == 2 );
+ }
+
+ CPPUNIT_ASSERT( l.erase( 50 ));
+ CPPUNIT_ASSERT( !l.erase( 50 ));
+
+ CPPUNIT_ASSERT( l.empty() );
+
+ // clear empty list
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+
+ {
+ int i;
+
+ // insert test
+ CPPUNIT_ASSERT( l.emplace( 501 ) );
+ CPPUNIT_ASSERT( l.emplace( 251, 152 ));
+ CPPUNIT_ASSERT( l.emplace( item( 1001 )) );
+
+ // insert failed - such key exists
+ CPPUNIT_ASSERT( !l.emplace( 501, 2 ) );
+ CPPUNIT_ASSERT( !l.emplace( 251, 10) );
+
+ i = 501;
+ CPPUNIT_ASSERT( l.find( i, check_exact_value(501*2) ));
+ i = 251;
+ CPPUNIT_ASSERT( l.find( i, check_exact_value(152) ));
+ i = 1001;
+ CPPUNIT_ASSERT( l.find( i, check_exact_value(1001*2) ));
+
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+ }
+
+ // Iterator test
+ {
+ int nCount = 100;
+ for ( int i = 0; i < nCount; ++i )
+ CPPUNIT_ASSERT( l.insert(i) );
+
+ {
+ typename OrdList::iterator it( l.begin() );
+ typename OrdList::const_iterator cit( l.cbegin() );
+ CPPUNIT_CHECK( it == cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ ++it;
+ CPPUNIT_CHECK( it != cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ ++cit;
+ CPPUNIT_CHECK( it == cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ }
+
+ int i = 0;
+ for ( typename OrdList::iterator it = l.begin(), itEnd = l.end(); it != itEnd; ++it, ++i ) {
+ it->nVal = i * 2;
+ CPPUNIT_ASSERT( it->nKey == i );
+ }
+
+ // Check that we have visited all items
+ for ( int i = 0; i < nCount; ++i )
+ CPPUNIT_ASSERT( l.find( i, check_value(2) ));
+
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+
+ // Const iterator
+ for ( int i = 0; i < nCount; ++i )
+ CPPUNIT_ASSERT( l.insert(i) );
+
+ i = 0;
+ const OrdList& rl = l;
+ for ( typename OrdList::const_iterator it = rl.begin(), itEnd = rl.end(); it != itEnd; ++it, ++i ) {
+ // it->nVal = i * 2 ; // not!
+ CPPUNIT_ASSERT( it->nKey == i );
+ }
+
+ // Check that we have visited all items
+ for ( int i = 0; i < nCount; ++i )
+ CPPUNIT_ASSERT( l.find( i, check_value(2) ));
+
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+ }
+ }
+
+ template <typename OrdList>
+ void test()
+ {
+ typedef typename OrdList::guarded_ptr guarded_ptr;
+ typedef typename OrdList::value_type value_type;
+
+ OrdList l;
+ test_with(l);
+
+ static int const nLimit = 20;
+ int arr[nLimit];
+ for ( int i = 0; i < nLimit; i++ )
+ arr[i] = i;
+ std::random_shuffle( arr, arr + nLimit );
+
+ // extract/get
+ for ( int i = 0; i < nLimit; ++i )
+ l.insert( arr[i] );
+ {
+ guarded_ptr gp;
+ for ( int i = 0; i < nLimit; ++i ) {
+ int nKey = arr[i];
+
+ gp = l.get( nKey );
+ CPPUNIT_ASSERT( gp );
+ CPPUNIT_ASSERT( !gp.empty());
+ CPPUNIT_CHECK( gp->nKey == nKey );
+ CPPUNIT_CHECK( gp->nVal == nKey * 2 );
+ gp.release();
+
+ gp = l.extract( nKey );
+ CPPUNIT_ASSERT( gp );
+ CPPUNIT_ASSERT( !gp.empty());
+ CPPUNIT_CHECK( gp->nKey == nKey );
+ CPPUNIT_CHECK( gp->nVal == nKey*2 );
+ gp.release();
+
+ gp = l.get( nKey );
+ CPPUNIT_CHECK( !gp );
+ CPPUNIT_CHECK( gp.empty());
+ CPPUNIT_CHECK( !l.extract( nKey));
+ CPPUNIT_CHECK( gp.empty());
+ }
+ CPPUNIT_ASSERT( l.empty());
+ CPPUNIT_CHECK( !l.get(arr[0]));
+ CPPUNIT_CHECK( gp.empty());
+ CPPUNIT_CHECK( !l.extract( arr[0]));
+ CPPUNIT_CHECK( gp.empty());
+ }
+
+ // extract_with/get_with
+ for ( int i = 0; i < nLimit; ++i )
+ l.insert( arr[i] );
+ {
+ guarded_ptr gp;
+ for ( int i = 0; i < nLimit; ++i ) {
+ int nKey = arr[i];
+ other_item key( nKey );
+
+ gp = l.get_with( key, other_less() );
+ CPPUNIT_ASSERT( gp );
+ CPPUNIT_ASSERT( !gp.empty());
+ CPPUNIT_CHECK( gp->nKey == nKey );
+ CPPUNIT_CHECK( gp->nVal == nKey * 2 );
+ gp.release();
+
+ gp = l.extract_with( key, other_less() );
+ CPPUNIT_ASSERT( gp );
+ CPPUNIT_ASSERT( !gp.empty());
+ CPPUNIT_CHECK( gp->nKey == nKey );
+ CPPUNIT_CHECK( gp->nVal == nKey*2 );
+ gp.release();
+
+ gp = l.get_with( key, other_less() );
+ CPPUNIT_CHECK( !gp );
+ CPPUNIT_CHECK( gp.empty());
+ CPPUNIT_CHECK( !l.extract_with( key, other_less()));
+ CPPUNIT_CHECK( gp.empty());
+ }
+ CPPUNIT_ASSERT( l.empty());
+ CPPUNIT_CHECK( !l.get_with(other_item(arr[0]), other_less()));
+ CPPUNIT_CHECK( gp.empty());
+ CPPUNIT_CHECK( !l.extract_with( other_item(arr[0]), other_less()));
+ CPPUNIT_CHECK( gp.empty());
+ }
+ }
+
+ template <typename OrdList>
+ void test_rcu()
+ {
+ OrdList l;
+ test_with(l);
+
+ static int const nLimit = 20;
+
+ typedef typename OrdList::rcu_lock rcu_lock;
+ typedef typename OrdList::value_type value_type;
+ typedef typename OrdList::gc rcu_type;
+
+ {
+ int a[nLimit];
+ for (int i = 0; i < nLimit; ++i)
+ a[i]=i;
+ std::random_shuffle( a, a + nLimit );
+
+ // extract/get
+ for ( int i = 0; i < nLimit; ++i )
+ CPPUNIT_ASSERT( l.insert( a[i] ) );
+
+ typename OrdList::exempt_ptr ep;
+
+ for ( int i = 0; i < nLimit; ++i ) {
+ {
+ rcu_lock lock;
+ value_type * pGet = l.get( a[i] );
+ CPPUNIT_ASSERT( pGet != nullptr );
+ CPPUNIT_CHECK( pGet->nKey == a[i] );
+ CPPUNIT_CHECK( pGet->nVal == a[i] * 2 );
+
+ ep = l.extract( a[i] );
+ CPPUNIT_ASSERT( ep );
+ CPPUNIT_ASSERT( !ep.empty() );
+ CPPUNIT_CHECK( ep->nKey == a[i] );
+ CPPUNIT_CHECK( (*ep).nVal == a[i] * 2 );
+ }
+ ep.release();
+ {
+ rcu_lock lock;
+ CPPUNIT_CHECK( l.get( a[i] ) == nullptr );
+ ep = l.extract( a[i] );
+ CPPUNIT_CHECK( !ep );
+ CPPUNIT_CHECK( ep.empty() );
+ }
+ }
+ CPPUNIT_ASSERT( l.empty() );
+
+ {
+ rcu_lock lock;
+ CPPUNIT_CHECK( l.get( a[0] ) == nullptr );
+ CPPUNIT_CHECK( !l.extract( a[0] ) );
+ CPPUNIT_CHECK( ep.empty() );
+ }
+
+ // extract_with/get_with
+ for ( int i = 0; i < nLimit; ++i ) {
+ CPPUNIT_ASSERT( l.insert( a[i] ) );
+ }
+
+ for ( int i = 0; i < nLimit; ++i ) {
+ other_item itm( a[i] );
+ {
+ rcu_lock lock;
+ value_type * pGet = l.get_with( itm, other_less() );
+ CPPUNIT_ASSERT( pGet != nullptr );
+ CPPUNIT_CHECK( pGet->nKey == a[i] );
+ CPPUNIT_CHECK( pGet->nVal == a[i] * 2 );
+
+ ep = l.extract_with( itm, other_less() );
+ CPPUNIT_ASSERT( ep );
+ CPPUNIT_ASSERT( !ep.empty() );
+ CPPUNIT_CHECK( ep->nKey == a[i] );
+ CPPUNIT_CHECK( ep->nVal == a[i] * 2 );
+ }
+ ep.release();
+ {
+ rcu_lock lock;
+ CPPUNIT_CHECK( l.get_with( itm, other_less() ) == nullptr );
+ ep = l.extract_with( itm, other_less() );
+ CPPUNIT_CHECK( !ep );
+ CPPUNIT_CHECK( ep.empty() );
+ }
+ }
+ CPPUNIT_ASSERT( l.empty() );
+
+ {
+ rcu_lock lock;
+ CPPUNIT_CHECK( l.get_with( other_item( 0 ), other_less() ) == nullptr );
+ CPPUNIT_CHECK( !l.extract_with( other_item(0), other_less() ));
+ CPPUNIT_CHECK( ep.empty() );
+ }
+ }
+
+ }
+
+ template <class OrdList>
+ void nogc_test()
+ {
+ typedef OrdList list;
+ typedef typename list::value_type value_type;
+ typedef std::pair<typename list::iterator, bool> ensure_result;
+
+ typename list::iterator it;
+
+ list l;
+ CPPUNIT_ASSERT( l.empty() );
+ CPPUNIT_ASSERT( l.insert(50) != l.end() );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ ensure_result eres = l.ensure( item(100, 33) );
+ CPPUNIT_ASSERT( eres.second );
+ CPPUNIT_ASSERT( eres.first != l.end() );
+ CPPUNIT_ASSERT( l.insert( item(150) ) != l.end() );
+
+ CPPUNIT_ASSERT( l.insert(100) == l.end() );
+ eres = l.ensure( item(50, 33) );
+ CPPUNIT_ASSERT( !eres.second );
+ CPPUNIT_ASSERT( eres.first->nVal == eres.first->nKey * 2 );
+ eres.first->nVal = 63;
+
+ it = l.find( 33 );
+ CPPUNIT_ASSERT( it == l.end() );
+
+ it = l.find( 50 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == 50 );
+ CPPUNIT_ASSERT( it->nVal == 63 );
+
+ it = l.find_with( 100, lt<value_type>() );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == 100 );
+ CPPUNIT_ASSERT( it->nVal == 33 );
+
+ it = l.find( 150 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == 150 );
+ CPPUNIT_ASSERT( it->nVal == it->nKey * 2 );
+
+ CPPUNIT_ASSERT( !l.empty() );
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+
+ // insert test
+ CPPUNIT_ASSERT( l.emplace( 501 ) != l.end() );
+ CPPUNIT_ASSERT( l.emplace( 251, 152 ) != l.end());
+ CPPUNIT_ASSERT( l.emplace( item( 1001 )) != l.end() );
+
+ // insert failed - such key exists
+ CPPUNIT_ASSERT( l.emplace( 501, 2 ) == l.end() );
+ CPPUNIT_ASSERT( l.emplace( 251, 10) == l.end() );
+
+ it = l.find( 501 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == 501 );
+ CPPUNIT_ASSERT( it->nVal == 501 * 2 );
+
+ it = l.find( 251 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == 251 );
+ CPPUNIT_ASSERT( it->nVal == 152 );
+
+ it = l.find( 1001 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it->nKey == 1001 );
+ CPPUNIT_ASSERT( it->nVal == 1001 * 2 );
+
+ {
+ typename OrdList::iterator it( l.begin() );
+ typename OrdList::const_iterator cit( l.cbegin() );
+ CPPUNIT_CHECK( it == cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ ++it;
+ CPPUNIT_CHECK( it != cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ ++cit;
+ CPPUNIT_CHECK( it == cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ }
+
+
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+ }
+
+ void HP_cmp();
+ void HP_less();
+ void HP_cmpmix();
+ void HP_ic();
+
+ void DHP_cmp();
+ void DHP_less();
+ void DHP_cmpmix();
+ void DHP_ic();
+
+ void RCU_GPI_cmp();
+ void RCU_GPI_less();
+ void RCU_GPI_cmpmix();
+ void RCU_GPI_ic();
+
+ void RCU_GPB_cmp();
+ void RCU_GPB_less();
+ void RCU_GPB_cmpmix();
+ void RCU_GPB_ic();
+
+ void RCU_GPT_cmp();
+ void RCU_GPT_less();
+ void RCU_GPT_cmpmix();
+ void RCU_GPT_ic();
+
+ void RCU_SHB_cmp();
+ void RCU_SHB_less();
+ void RCU_SHB_cmpmix();
+ void RCU_SHB_ic();
+
+ void RCU_SHT_cmp();
+ void RCU_SHT_less();
+ void RCU_SHT_cmpmix();
+ void RCU_SHT_ic();
+
+ void NOGC_cmp();
+ void NOGC_less();
+ void NOGC_cmpmix();
+ void NOGC_ic();
+
+ CPPUNIT_TEST_SUITE(MichaelListTestHeader)
+ CPPUNIT_TEST(HP_cmp)
+ CPPUNIT_TEST(HP_less)
+ CPPUNIT_TEST(HP_cmpmix)
+ CPPUNIT_TEST(HP_ic)
+
+ CPPUNIT_TEST(DHP_cmp)
+ CPPUNIT_TEST(DHP_less)
+ CPPUNIT_TEST(DHP_cmpmix)
+ CPPUNIT_TEST(DHP_ic)
+
+ CPPUNIT_TEST(RCU_GPI_cmp)
+ CPPUNIT_TEST(RCU_GPI_less)
+ CPPUNIT_TEST(RCU_GPI_cmpmix)
+ CPPUNIT_TEST(RCU_GPI_ic)
+
+ CPPUNIT_TEST(RCU_GPB_cmp)
+ CPPUNIT_TEST(RCU_GPB_less)
+ CPPUNIT_TEST(RCU_GPB_cmpmix)
+ CPPUNIT_TEST(RCU_GPB_ic)
+
+ CPPUNIT_TEST(RCU_GPT_cmp)
+ CPPUNIT_TEST(RCU_GPT_less)
+ CPPUNIT_TEST(RCU_GPT_cmpmix)
+ CPPUNIT_TEST(RCU_GPT_ic)
+
+ CPPUNIT_TEST(RCU_SHB_cmp)
+ CPPUNIT_TEST(RCU_SHB_less)
+ CPPUNIT_TEST(RCU_SHB_cmpmix)
+ CPPUNIT_TEST(RCU_SHB_ic)
+
+ CPPUNIT_TEST(RCU_SHT_cmp)
+ CPPUNIT_TEST(RCU_SHT_less)
+ CPPUNIT_TEST(RCU_SHT_cmpmix)
+ CPPUNIT_TEST(RCU_SHT_ic)
+
+ CPPUNIT_TEST(NOGC_cmp)
+ CPPUNIT_TEST(NOGC_less)
+ CPPUNIT_TEST(NOGC_cmpmix)
+ CPPUNIT_TEST(NOGC_ic)
+ CPPUNIT_TEST_SUITE_END()
+ };
+
+} // namespace ordlist
+
+#endif // #ifndef CDSTEST_HDR_MICHAEL_H
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_michael.h"
+#include <cds/container/michael_list_dhp.h>
+
+namespace ordlist {
+ namespace {
+ struct DHP_cmp_traits: public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
+ };
+ }
+ void MichaelListTestHeader::DHP_cmp()
+ {
+ // traits-based version
+ typedef cc::MichaelList< cds::gc::DHP, item, DHP_cmp_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< cds::gc::DHP, item,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+ namespace {
+ struct DHP_less_traits: public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
+ };
+ }
+ void MichaelListTestHeader::DHP_less()
+ {
+ // traits-based version
+ typedef cc::MichaelList< cds::gc::DHP, item, DHP_less_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< cds::gc::DHP, item,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+ namespace {
+ struct DHP_cmpmix_traits: public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
+ typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
+ };
+ }
+ void MichaelListTestHeader::DHP_cmpmix()
+ {
+ // traits-based version
+ typedef cc::MichaelList< cds::gc::DHP, item, DHP_cmpmix_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< cds::gc::DHP, item,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ ,cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+ namespace {
+ struct DHP_ic_traits: public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+ void MichaelListTestHeader::DHP_ic()
+ {
+ // traits-based version
+ typedef cc::MichaelList< cds::gc::DHP, item, DHP_ic_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< cds::gc::DHP, item,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<item> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+} // namespace ordlist
+
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_michael.h"
+#include <cds/container/michael_list_hp.h>
+
+namespace ordlist {
+ namespace {
+ struct HP_cmp_traits: public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
+ };
+
+ }
+ void MichaelListTestHeader::HP_cmp()
+ {
+ // traits-based version
+ typedef cc::MichaelList< cds::gc::HP, item, HP_cmp_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< cds::gc::HP, item,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+ namespace {
+ struct HP_less_traits: public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
+ };
+ }
+ void MichaelListTestHeader::HP_less()
+ {
+ // traits-based version
+ typedef cc::MichaelList< cds::gc::HP, item, HP_less_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< cds::gc::HP, item,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+ namespace {
+ struct HP_cmpmix_traits: public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
+ typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
+ };
+ }
+ void MichaelListTestHeader::HP_cmpmix()
+ {
+ // traits-based version
+ typedef cc::MichaelList< cds::gc::HP, item, HP_cmpmix_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< cds::gc::HP, item,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ ,cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+ namespace {
+ struct HP_ic_traits: public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+ void MichaelListTestHeader::HP_ic()
+ {
+ // traits-based version
+ typedef cc::MichaelList< cds::gc::HP, item, HP_ic_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< cds::gc::HP, item,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<item> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+} // namespace ordlist
+
+CPPUNIT_TEST_SUITE_REGISTRATION(ordlist::MichaelListTestHeader);
--- /dev/null
+//$$CDS-header$$
+
+#ifndef CDSTEST_HDR_MICHAEL_KV_H
+#define CDSTEST_HDR_MICHAEL_KV_H
+
+#include "cppunit/cppunit_proxy.h"
+#include <cds/container/details/michael_list_base.h>
+
+namespace ordlist {
+ namespace cc = cds::container;
+ namespace co = cds::container::opt;
+
+ class MichaelKVListTestHeader: public CppUnitMini::TestCase
+ {
+ public:
+ typedef int key_type;
+ struct value_type {
+ int m_val;
+
+ value_type()
+ : m_val(0)
+ {}
+
+ value_type( int n )
+ : m_val( n )
+ {}
+ };
+
+ template <typename T>
+ struct lt
+ {
+ bool operator ()(const T& v1, const T& v2 ) const
+ {
+ return v1 < v2;
+ }
+ };
+
+ template <typename T>
+ struct cmp {
+ int operator ()(const T& v1, const T& v2 ) const
+ {
+ if ( v1 < v2 )
+ return -1;
+ return v1 > v2 ? 1 : 0;
+ }
+ };
+
+ struct check_value {
+ int m_nExpected;
+
+ check_value( int nExpected )
+ : m_nExpected( nExpected )
+ {}
+
+ template <typename T>
+ void operator ()( T& pair )
+ {
+ CPPUNIT_ASSERT_CURRENT( pair.second.m_val == m_nExpected );
+ }
+ };
+
+ struct insert_functor {
+ template <typename T>
+ void operator()( T& pair )
+ {
+ pair.second.m_val = pair.first * 10;
+ }
+ };
+
+ struct ensure_functor {
+ template <typename T>
+ void operator()( bool /*bNew*/, T& pair )
+ {
+ pair.second.m_val = pair.first * 50;
+ }
+ };
+
+ struct erase_functor {
+ int nKey;
+ int nVal;
+
+ erase_functor()
+ : nKey(0)
+ , nVal(0)
+ {}
+
+ template <typename T>
+ void operator()( T& i )
+ {
+ nKey = i.first;
+ nVal = i.second.m_val;
+ }
+ };
+
+ typedef float other_key;
+ struct other_less {
+ bool operator()( float f, int i ) const
+ {
+ return int(f) < i;
+ }
+ bool operator()( int i, float f ) const
+ {
+ return i < int(f);
+ }
+ };
+
+ protected:
+ template <class OrdList>
+ void test_with( OrdList& l)
+ {
+ typedef typename OrdList::value_type value_type;
+
+ typename OrdList::iterator itTest;
+ typename OrdList::const_iterator citTest;
+
+ CPPUNIT_ASSERT( l.empty() );
+
+ // insert / find test
+ CPPUNIT_ASSERT( !l.find( 100 ));
+ CPPUNIT_ASSERT( l.insert( 100 ));
+ CPPUNIT_ASSERT( !l.empty() );
+ CPPUNIT_ASSERT( l.find( 100 ));
+
+ check_value chk(0);
+ CPPUNIT_ASSERT( l.find( 100, std::ref( chk ) ) );
+
+ CPPUNIT_ASSERT( !l.find_with( 50, lt<key_type>() ));
+ CPPUNIT_ASSERT( l.insert( 50, 500 ));
+ CPPUNIT_ASSERT( l.find_with( 50, lt<key_type>() ));
+ CPPUNIT_ASSERT( !l.insert( 50, 5 ));
+ chk.m_nExpected = 500;
+ CPPUNIT_ASSERT( l.find_with( 50, lt<key_type>(), std::ref( chk ) ) );
+ chk.m_nExpected = 0;
+ CPPUNIT_ASSERT( l.find_with( 100, lt<key_type>(), std::ref( chk ) ) );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ CPPUNIT_ASSERT( !l.find( 150 ));
+ CPPUNIT_ASSERT( l.insert_with( 150, insert_functor() ));
+ CPPUNIT_ASSERT( l.find( 150 ));
+ chk.m_nExpected = 1500;
+ CPPUNIT_ASSERT( l.find( 150, std::ref( chk ) ) );
+ chk.m_nExpected = 0;
+ CPPUNIT_ASSERT( l.find( 100, std::ref( chk ) ) );
+ chk.m_nExpected = 500;
+ CPPUNIT_ASSERT( l.find( 50, std::ref( chk ) ) );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ // erase test
+
+ CPPUNIT_ASSERT( !l.erase( 500 ));
+ CPPUNIT_ASSERT( !l.empty() );
+
+ CPPUNIT_ASSERT( l.find( 50 ));
+ {
+ erase_functor ef;
+ l.erase( 50, std::ref( ef ) );
+ CPPUNIT_ASSERT( ef.nKey == 50 );
+ CPPUNIT_ASSERT( ef.nVal == 500 );
+ }
+ CPPUNIT_ASSERT( !l.find( 50 ));
+
+ // ensure test
+ std::pair<bool, bool> bEnsureResult;
+ bEnsureResult = l.ensure( 100, ensure_functor() );
+ CPPUNIT_ASSERT( bEnsureResult.first );
+ CPPUNIT_ASSERT( !bEnsureResult.second );
+ chk.m_nExpected = 5000;
+ CPPUNIT_ASSERT( l.find( 100, std::ref( chk ) ) );
+
+ {
+ ensure_functor ef;
+ bEnsureResult = l.ensure( 50, std::ref( ef ) );
+ }
+ CPPUNIT_ASSERT( bEnsureResult.first );
+ CPPUNIT_ASSERT( bEnsureResult.second );
+ chk.m_nExpected = 2500;
+ CPPUNIT_ASSERT( l.find( 50, std::ref( chk ) ) );
+
+ // erase test
+ CPPUNIT_ASSERT( !l.empty() );
+ CPPUNIT_ASSERT( l.insert_with( 200, insert_functor() ));
+ CPPUNIT_ASSERT( l.insert( 25 ));
+ CPPUNIT_ASSERT( l.erase( 100 ));
+ CPPUNIT_ASSERT( l.erase( 150 ));
+ {
+ erase_functor ef;
+ CPPUNIT_ASSERT( l.erase_with( 200, lt<key_type>(), std::ref(ef)) );
+ CPPUNIT_ASSERT( ef.nKey == 200 );
+ CPPUNIT_ASSERT( ef.nVal == 2000 );
+ }
+ CPPUNIT_ASSERT( l.erase_with( 25, lt<key_type>()))
+ CPPUNIT_ASSERT( l.erase( 50 ));
+ CPPUNIT_ASSERT( l.empty() );
+
+ // clear empty list
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+
+ // insert test
+ CPPUNIT_ASSERT( l.emplace( 501 ) );
+ CPPUNIT_ASSERT( l.emplace( 251, 152 ));
+
+ // insert failed - such key exists
+ CPPUNIT_ASSERT( !l.emplace( 501, 2 ) );
+ CPPUNIT_ASSERT( !l.emplace( 251, 10) );
+
+ check_value cv(0);
+ CPPUNIT_ASSERT( l.find( 501, std::ref(cv) ));
+ cv.m_nExpected = 152;
+ CPPUNIT_ASSERT( l.find( 251, std::ref(cv) ));
+
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+
+ // Iterator test
+ {
+ int nCount = 100;
+ for ( int i = 0; i < nCount; ++i )
+ CPPUNIT_ASSERT( l.insert(i, i * 2 ) );
+
+ {
+ typename OrdList::iterator it( l.begin() );
+ typename OrdList::const_iterator cit( l.cbegin() );
+ CPPUNIT_CHECK( it == cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ ++it;
+ CPPUNIT_CHECK( it != cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ ++cit;
+ CPPUNIT_CHECK( it == cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ }
+
+ int i = 0;
+ for ( typename OrdList::iterator it = l.begin(), itEnd = l.end(); it != itEnd; ++it, ++i ) {
+ CPPUNIT_ASSERT( it.key() == i );
+ CPPUNIT_ASSERT( it->first == i );
+ CPPUNIT_ASSERT( (*it).first == i );
+
+ CPPUNIT_ASSERT( it.val().m_val == i * 2 );
+ CPPUNIT_ASSERT( it->second.m_val == i * 2 );
+ CPPUNIT_ASSERT( (*it).second.m_val == i * 2 );
+ it.val().m_val = i * 3;
+ }
+
+ // Check that we have visited all items
+ for ( int i = 0; i < nCount; ++i ) {
+ chk.m_nExpected = i * 3;
+ CPPUNIT_ASSERT( l.find( i, std::ref( chk ) ) );
+ }
+
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+
+ // Const iterator
+ for ( int i = 0; i < nCount; ++i )
+ CPPUNIT_ASSERT( l.insert(i, i * 7) );
+
+ i = 0;
+ const OrdList& rl = l;
+ for ( typename OrdList::const_iterator it = rl.begin(), itEnd = rl.end(); it != itEnd; ++it, ++i ) {
+ CPPUNIT_ASSERT( it.key() == i );
+ CPPUNIT_ASSERT( it->first == i );
+ CPPUNIT_ASSERT( (*it).first == i );
+
+ CPPUNIT_ASSERT( it.val().m_val == i * 7 );
+ CPPUNIT_ASSERT( it->second.m_val == i * 7 );
+ CPPUNIT_ASSERT( (*it).second.m_val == i * 7 );
+ }
+
+ // Check that we have visited all items
+ for ( int i = 0; i < nCount; ++i ) {
+ chk.m_nExpected = i * 7;
+ CPPUNIT_ASSERT( l.find_with( i, lt<key_type>(), std::ref( chk ) ) );
+ }
+
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+ }
+ }
+
+ template <class OrdList>
+ void test()
+ {
+ OrdList l;
+ test_with(l);
+
+ typedef typename OrdList::guarded_ptr guarded_ptr;
+
+ static int const nLimit = 20;
+ int arr[nLimit];
+ for ( int i = 0; i < nLimit; i++ )
+ arr[i] = i;
+ std::random_shuffle( arr, arr + nLimit );
+
+ // extract/get
+ for ( int i = 0; i < nLimit; ++i )
+ l.insert( arr[i], arr[i] * 2 );
+ {
+ guarded_ptr gp;
+ for ( int i = 0; i < nLimit; ++i ) {
+ int nKey = arr[i];
+
+ gp = l.get( nKey );
+ CPPUNIT_ASSERT( gp );
+ CPPUNIT_ASSERT( !gp.empty());
+ CPPUNIT_CHECK( gp->first == nKey );
+ CPPUNIT_CHECK( gp->second.m_val == nKey * 2 );
+ gp.release();
+ CPPUNIT_CHECK( gp.empty() );
+
+ gp = l.extract( nKey );
+ CPPUNIT_ASSERT( gp );
+ CPPUNIT_ASSERT( !gp.empty());
+ CPPUNIT_CHECK( gp->first == nKey );
+ CPPUNIT_CHECK( gp->second.m_val == nKey*2 );
+ gp.release();
+
+ gp = l.get( nKey );
+ CPPUNIT_CHECK( !gp );
+ CPPUNIT_CHECK( gp.empty());
+ CPPUNIT_CHECK( !l.extract( nKey));
+ CPPUNIT_CHECK( gp.empty());
+ }
+ CPPUNIT_ASSERT( l.empty());
+ CPPUNIT_CHECK( !l.get(arr[0]));
+ CPPUNIT_CHECK( gp.empty());
+ CPPUNIT_CHECK( !l.extract( arr[0]));
+ CPPUNIT_CHECK( gp.empty());
+ }
+
+ // extract_with/get_with
+ for ( int i = 0; i < nLimit; ++i )
+ l.insert( arr[i], arr[i] * 2 );
+ {
+ guarded_ptr gp;
+ for ( int i = 0; i < nLimit; ++i ) {
+ int nKey = arr[i];
+ other_key key = float(nKey + 0.3);
+
+ gp = l.get_with( key, other_less() );
+ CPPUNIT_ASSERT( gp );
+ CPPUNIT_ASSERT( !gp.empty());
+ CPPUNIT_CHECK( gp->first == nKey );
+ CPPUNIT_CHECK( gp->second.m_val == nKey * 2 );
+ gp.release();
+
+ gp = l.extract_with( key, other_less() );
+ CPPUNIT_ASSERT( gp );
+ CPPUNIT_ASSERT( !gp.empty());
+ CPPUNIT_CHECK( gp->first == nKey );
+ CPPUNIT_CHECK( gp->second.m_val == nKey*2 );
+ gp.release();
+
+ gp = l.get_with( key, other_less() );
+ CPPUNIT_CHECK( !gp );
+ CPPUNIT_CHECK( gp.empty());
+ CPPUNIT_CHECK( !l.extract_with( key, other_less()));
+ CPPUNIT_CHECK( gp.empty());
+ }
+ CPPUNIT_ASSERT( l.empty());
+ CPPUNIT_CHECK( !l.get_with( 3.4f, other_less()));
+ CPPUNIT_CHECK( gp.empty());
+ CPPUNIT_CHECK( !l.extract_with( 3.4f, other_less()));
+ CPPUNIT_CHECK( gp.empty());
+ }
+ }
+
+ template <class OrdList>
+ void test_rcu()
+ {
+ OrdList l;
+ test_with(l);
+
+ static int const nLimit = 20;
+
+ typedef typename OrdList::rcu_lock rcu_lock;
+ typedef typename OrdList::value_type value_type;
+ typedef typename OrdList::gc rcu_type;
+
+ {
+ int a[nLimit];
+ for (int i = 0; i < nLimit; ++i)
+ a[i]=i;
+ std::random_shuffle( a, a + nLimit );
+
+ // extract/get
+ for ( int i = 0; i < nLimit; ++i )
+ CPPUNIT_ASSERT( l.insert( a[i], a[i]*2 ) );
+
+ typename OrdList::exempt_ptr ep;
+
+ for ( int i = 0; i < nLimit; ++i ) {
+ {
+ rcu_lock lock;
+ value_type * pGet = l.get( a[i] );
+ CPPUNIT_ASSERT( pGet != nullptr );
+ CPPUNIT_CHECK( pGet->first == a[i] );
+ CPPUNIT_CHECK( pGet->second.m_val == a[i] * 2 );
+
+ ep = l.extract( a[i] );
+ CPPUNIT_ASSERT( ep );
+ CPPUNIT_ASSERT( !ep.empty() );
+ CPPUNIT_CHECK( ep->first == a[i] );
+ CPPUNIT_CHECK( (*ep).second.m_val == a[i] * 2 );
+ }
+ ep.release();
+ {
+ rcu_lock lock;
+ CPPUNIT_CHECK( l.get( a[i] ) == nullptr );
+ ep = l.extract( a[i] );
+ CPPUNIT_CHECK( !ep );
+ CPPUNIT_CHECK( ep.empty() );
+ }
+ }
+ CPPUNIT_ASSERT( l.empty() );
+
+ {
+ rcu_lock lock;
+ CPPUNIT_CHECK( l.get( a[0] ) == nullptr );
+ CPPUNIT_CHECK( !l.extract( a[0] ) );
+ CPPUNIT_CHECK( ep.empty() );
+ }
+
+ // extract_with/get_with
+ for ( int i = 0; i < nLimit; ++i ) {
+ CPPUNIT_ASSERT( l.insert( a[i], a[i]*2 ) );
+ }
+
+ for ( int i = 0; i < nLimit; ++i ) {
+ float itm = a[i] + 0.3f;
+ {
+ rcu_lock lock;
+ value_type * pGet = l.get_with( itm, other_less() );
+ CPPUNIT_ASSERT( pGet != nullptr );
+ CPPUNIT_CHECK( pGet->first == a[i] );
+ CPPUNIT_CHECK( pGet->second.m_val == a[i] * 2 );
+
+ ep = l.extract_with( itm, other_less() );
+ CPPUNIT_ASSERT( ep );
+ CPPUNIT_ASSERT( !ep.empty() );
+ CPPUNIT_CHECK( ep->first == a[i] );
+ CPPUNIT_CHECK( ep->second.m_val == a[i] * 2 );
+ }
+ ep.release();
+ {
+ rcu_lock lock;
+ CPPUNIT_CHECK( l.get_with( itm, other_less() ) == nullptr );
+ ep = l.extract_with( itm, other_less() );
+ CPPUNIT_CHECK( !ep );
+ CPPUNIT_CHECK( ep.empty() );
+ }
+ }
+ CPPUNIT_ASSERT( l.empty() );
+
+ {
+ rcu_lock lock;
+ CPPUNIT_CHECK( l.get_with( 3.14f, other_less() ) == nullptr );
+ CPPUNIT_CHECK( !l.extract_with( 3.14f, other_less() ));
+ CPPUNIT_CHECK( ep.empty() );
+ }
+ }
+
+ }
+
+ template <class OrdList>
+ void nogc_test()
+ {
+ typedef typename OrdList::value_type value_type;
+ typedef typename OrdList::iterator iterator;
+
+ {
+ OrdList l;
+ iterator it;
+
+ CPPUNIT_ASSERT( l.empty() );
+
+ // insert / find test
+ CPPUNIT_ASSERT( l.find( 100 ) == l.end() );
+ CPPUNIT_ASSERT( l.insert( 100 ) != l.end() );
+ CPPUNIT_ASSERT( !l.empty() );
+ it = l.find_with( 100, lt<key_type>() );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 100 );
+ CPPUNIT_ASSERT( it.val().m_val == 0 );
+
+ CPPUNIT_ASSERT( l.find_with( 50, lt<key_type>() ) == l.end() );
+ CPPUNIT_ASSERT( l.insert( 50, 500 ) != l.end());
+ it = l.find( 50 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 50 );
+ CPPUNIT_ASSERT( it.val().m_val == 500 );
+
+ CPPUNIT_ASSERT( l.insert( 50, 5 ) == l.end() );
+ it = l.find( 50 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 50 );
+ CPPUNIT_ASSERT( it.val().m_val == 500 );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ CPPUNIT_ASSERT( l.find( 150 ) == l.end() );
+ CPPUNIT_ASSERT( l.insert_with( 150, insert_functor() ) != l.end() );
+ it = l.find( 150 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 150 );
+ CPPUNIT_ASSERT( it.val().m_val == 1500 );
+ it = l.find( 100 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 100 );
+ CPPUNIT_ASSERT( it.val().m_val == 0 );
+ it = l.find( 50 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 50 );
+ CPPUNIT_ASSERT( it.val().m_val == 500 );
+ it.val().m_val = 25;
+ it = l.find( 50 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 50 );
+ CPPUNIT_ASSERT( it.val().m_val == 25 );
+ CPPUNIT_ASSERT( !l.empty() );
+
+ // ensure existing item
+ std::pair<iterator, bool> ensureResult;
+ ensureResult = l.ensure( 100 );
+ CPPUNIT_ASSERT( !ensureResult.second );
+ CPPUNIT_ASSERT( ensureResult.first.key() == 100 );
+ CPPUNIT_ASSERT( ensureResult.first.val().m_val == 0 );
+ ensureResult.first.val().m_val = 5;
+ it = l.find( 100 );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == 100 );
+ CPPUNIT_ASSERT( it.val().m_val == 5 );
+
+ CPPUNIT_ASSERT( !l.empty() );
+
+ // ensure new item
+ ensureResult = l.ensure( 1000 );
+ CPPUNIT_ASSERT( ensureResult.second );
+ CPPUNIT_ASSERT( ensureResult.first.key() == 1000 );
+ CPPUNIT_ASSERT( ensureResult.first.val().m_val == 0 );
+ ensureResult.first.val().m_val = 33;
+ ensureResult = l.ensure( 1000 );
+ CPPUNIT_ASSERT( !ensureResult.second );
+ CPPUNIT_ASSERT( ensureResult.first.key() == 1000 );
+ CPPUNIT_ASSERT( ensureResult.first.val().m_val == 33 );
+
+ // clear test
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+
+ // insert test
+ CPPUNIT_ASSERT( l.emplace( 501 ) != l.end());
+ CPPUNIT_ASSERT( l.emplace( 251, 152 ) != l.end());
+
+ // insert failed - such key exists
+ CPPUNIT_ASSERT( l.emplace( 501, 2 ) == l.end());
+ CPPUNIT_ASSERT( l.emplace( 251, 10) == l.end());
+
+ it = l.find( 501 );
+ CPPUNIT_ASSERT( it != l.end());
+ CPPUNIT_ASSERT( it.key() == 501 );
+ CPPUNIT_ASSERT( it.val().m_val == 0 );
+
+ it = l.find( 251 );
+ CPPUNIT_ASSERT( it != l.end());
+ CPPUNIT_ASSERT( it.key() == 251 );
+ CPPUNIT_ASSERT( it.val().m_val == 152 );
+
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+
+ // Iterator test
+ {
+ int nCount = 100;
+ for ( int i = 0; i < nCount; ++i )
+ CPPUNIT_ASSERT( l.insert(i, i * 2 ) != l.end() );
+
+ {
+ typename OrdList::iterator it( l.begin() );
+ typename OrdList::const_iterator cit( l.cbegin() );
+ CPPUNIT_CHECK( it == cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ ++it;
+ CPPUNIT_CHECK( it != cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ ++cit;
+ CPPUNIT_CHECK( it == cit );
+ CPPUNIT_CHECK( it != l.end() );
+ CPPUNIT_CHECK( it != l.cend() );
+ CPPUNIT_CHECK( cit != l.end() );
+ CPPUNIT_CHECK( cit != l.cend() );
+ }
+
+ int i = 0;
+ for ( typename OrdList::iterator iter = l.begin(), itEnd = l.end(); iter != itEnd; ++iter, ++i ) {
+ CPPUNIT_ASSERT( iter.key() == i );
+ CPPUNIT_ASSERT( iter->first == i );
+ CPPUNIT_ASSERT( (*iter).first == i );
+
+ CPPUNIT_ASSERT( iter.val().m_val == i * 2 );
+ CPPUNIT_ASSERT( iter->second.m_val == i * 2 );
+ CPPUNIT_ASSERT( (*iter).second.m_val == i * 2 );
+
+ iter.val().m_val = i * 3;
+ }
+
+ // Check that we have visited all items
+ for ( int i = 0; i < nCount; ++i ) {
+ it = l.find( i );
+ CPPUNIT_ASSERT( it != l.end() );
+ CPPUNIT_ASSERT( it.key() == i );
+ CPPUNIT_ASSERT( it.val().m_val == i * 3 );
+ }
+
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+
+ // Const iterator
+ for ( int i = 0; i < nCount; ++i )
+ CPPUNIT_ASSERT( l.insert(i, i * 7) != l.end() );
+
+ i = 0;
+ const OrdList& rl = l;
+ for ( typename OrdList::const_iterator iter = rl.begin(), itEnd = rl.end(); iter != itEnd; ++iter, ++i ) {
+ CPPUNIT_ASSERT( iter.key() == i );
+ CPPUNIT_ASSERT( iter->first == i );
+ CPPUNIT_ASSERT( (*iter).first == i );
+
+ CPPUNIT_ASSERT( iter.val().m_val == i * 7 );
+ CPPUNIT_ASSERT( iter->second.m_val == i * 7 );
+ CPPUNIT_ASSERT( (*iter).second.m_val == i * 7 );
+
+ // it.val().m_val = i * 3 ; // error: const-iterator
+ }
+
+ l.clear();
+ CPPUNIT_ASSERT( l.empty() );
+ }
+
+ }
+ }
+
+ void HP_cmp();
+ void HP_less();
+ void HP_cmpmix();
+ void HP_ic();
+
+ void DHP_cmp();
+ void DHP_less();
+ void DHP_cmpmix();
+ void DHP_ic();
+
+ void RCU_GPI_cmp();
+ void RCU_GPI_less();
+ void RCU_GPI_cmpmix();
+ void RCU_GPI_ic();
+
+ void RCU_GPB_cmp();
+ void RCU_GPB_less();
+ void RCU_GPB_cmpmix();
+ void RCU_GPB_ic();
+
+ void RCU_GPT_cmp();
+ void RCU_GPT_less();
+ void RCU_GPT_cmpmix();
+ void RCU_GPT_ic();
+
+ void RCU_SHB_cmp();
+ void RCU_SHB_less();
+ void RCU_SHB_cmpmix();
+ void RCU_SHB_ic();
+
+ void RCU_SHT_cmp();
+ void RCU_SHT_less();
+ void RCU_SHT_cmpmix();
+ void RCU_SHT_ic();
+
+ void NOGC_cmp();
+ void NOGC_less();
+ void NOGC_cmpmix();
+ void NOGC_ic();
+
+ CPPUNIT_TEST_SUITE(MichaelKVListTestHeader)
+ CPPUNIT_TEST(HP_cmp)
+ CPPUNIT_TEST(HP_less)
+ CPPUNIT_TEST(HP_cmpmix)
+ CPPUNIT_TEST(HP_ic)
+
+ CPPUNIT_TEST(DHP_cmp)
+ CPPUNIT_TEST(DHP_less)
+ CPPUNIT_TEST(DHP_cmpmix)
+ CPPUNIT_TEST(DHP_ic)
+
+ CPPUNIT_TEST(RCU_GPI_cmp)
+ CPPUNIT_TEST(RCU_GPI_less)
+ CPPUNIT_TEST(RCU_GPI_cmpmix)
+ CPPUNIT_TEST(RCU_GPI_ic)
+
+ CPPUNIT_TEST(RCU_GPB_cmp)
+ CPPUNIT_TEST(RCU_GPB_less)
+ CPPUNIT_TEST(RCU_GPB_cmpmix)
+ CPPUNIT_TEST(RCU_GPB_ic)
+
+ CPPUNIT_TEST(RCU_GPT_cmp)
+ CPPUNIT_TEST(RCU_GPT_less)
+ CPPUNIT_TEST(RCU_GPT_cmpmix)
+ CPPUNIT_TEST(RCU_GPT_ic)
+
+ CPPUNIT_TEST(RCU_SHB_cmp)
+ CPPUNIT_TEST(RCU_SHB_less)
+ CPPUNIT_TEST(RCU_SHB_cmpmix)
+ CPPUNIT_TEST(RCU_SHB_ic)
+
+ CPPUNIT_TEST(RCU_SHT_cmp)
+ CPPUNIT_TEST(RCU_SHT_less)
+ CPPUNIT_TEST(RCU_SHT_cmpmix)
+ CPPUNIT_TEST(RCU_SHT_ic)
+
+ CPPUNIT_TEST(NOGC_cmp)
+ CPPUNIT_TEST(NOGC_less)
+ CPPUNIT_TEST(NOGC_cmpmix)
+ CPPUNIT_TEST(NOGC_ic)
+ CPPUNIT_TEST_SUITE_END()
+ };
+
+} // namespace ordlist
+
+#endif // #ifndef CDSTEST_HDR_MICHAEL_KV_H
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_michael_kv.h"
+#include <cds/container/michael_kvlist_dhp.h>
+
+namespace ordlist {
+ namespace {
+ struct DHP_cmp_traits: public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
+ };
+ }
+ void MichaelKVListTestHeader::DHP_cmp()
+ {
+ // traits-based version
+ typedef cc::MichaelKVList< cds::gc::DHP, key_type, value_type, DHP_cmp_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< cds::gc::DHP, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+ namespace {
+ struct DHP_less_traits: public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
+ };
+ }
+ void MichaelKVListTestHeader::DHP_less()
+ {
+ // traits-based version
+ typedef cc::MichaelKVList< cds::gc::DHP, key_type, value_type, DHP_less_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< cds::gc::DHP, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+ namespace {
+ struct DHP_cmpmix_traits: public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
+ typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
+ };
+ }
+ void MichaelKVListTestHeader::DHP_cmpmix()
+ {
+ // traits-based version
+ typedef cc::MichaelKVList< cds::gc::DHP, key_type, value_type, DHP_cmpmix_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< cds::gc::DHP, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ ,cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+ namespace {
+ struct DHP_ic_traits: public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+ void MichaelKVListTestHeader::DHP_ic()
+ {
+ // traits-based version
+ typedef cc::MichaelKVList< cds::gc::DHP, key_type, value_type, DHP_ic_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< cds::gc::DHP, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+} // namespace ordlist
+
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_michael_kv.h"
+#include <cds/container/michael_kvlist_hp.h>
+
+namespace ordlist {
+ namespace {
+ struct HP_cmp_traits: public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
+ };
+
+ }
+ void MichaelKVListTestHeader::HP_cmp()
+ {
+ // traits-based version
+ typedef cc::MichaelKVList< cds::gc::HP, key_type, value_type, HP_cmp_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< cds::gc::HP,
+ key_type,
+ value_type,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+ namespace {
+ struct HP_less_traits : public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
+ };
+ }
+ void MichaelKVListTestHeader::HP_less()
+ {
+ // traits-based version
+ typedef cc::MichaelKVList< cds::gc::HP, key_type, value_type, HP_less_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< cds::gc::HP, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+ namespace {
+ struct HP_cmpmix_traits : public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
+ typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
+ };
+ }
+ void MichaelKVListTestHeader::HP_cmpmix()
+ {
+ // traits-based version
+ typedef cc::MichaelKVList< cds::gc::HP, key_type, value_type, HP_cmpmix_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< cds::gc::HP, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ ,cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+ namespace {
+ struct HP_ic_traits : public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+ void MichaelKVListTestHeader::HP_ic()
+ {
+ // traits-based version
+ typedef cc::MichaelKVList< cds::gc::HP, key_type, value_type, HP_ic_traits > list;
+ test< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< cds::gc::HP, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test< opt_list >();
+ }
+
+} // namespace ordlist
+
+CPPUNIT_TEST_SUITE_REGISTRATION(ordlist::MichaelKVListTestHeader);
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_michael_kv.h"
+#include <cds/container/michael_kvlist_nogc.h>
+
+namespace ordlist {
+ namespace {
+ struct NOGC_cmp_traits : public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
+ };
+
+ }
+ void MichaelKVListTestHeader::NOGC_cmp()
+ {
+ // traits-based version
+ typedef cc::MichaelKVList< cds::gc::nogc, key_type, value_type, NOGC_cmp_traits > list;
+ nogc_test< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< cds::gc::nogc,
+ key_type,
+ value_type,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ >::type
+ > opt_list;
+ nogc_test< opt_list >();
+ }
+
+ namespace {
+ struct NOGC_less_traits : public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
+ };
+ }
+ void MichaelKVListTestHeader::NOGC_less()
+ {
+ // traits-based version
+ typedef cc::MichaelKVList< cds::gc::nogc, key_type, value_type, NOGC_less_traits > list;
+ nogc_test< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< cds::gc::nogc, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ nogc_test< opt_list >();
+ }
+
+ namespace {
+ struct NOGC_cmpmix_traits : public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
+ typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
+ };
+ }
+ void MichaelKVListTestHeader::NOGC_cmpmix()
+ {
+ // traits-based version
+ typedef cc::MichaelKVList< cds::gc::nogc, key_type, value_type, NOGC_cmpmix_traits > list;
+ nogc_test< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< cds::gc::nogc, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ ,cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ nogc_test< opt_list >();
+ }
+
+ namespace {
+ struct NOGC_ic_traits : public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+ void MichaelKVListTestHeader::NOGC_ic()
+ {
+ // traits-based version
+ typedef cc::MichaelKVList< cds::gc::nogc, key_type, value_type, NOGC_ic_traits > list;
+ nogc_test< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< cds::gc::nogc, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ nogc_test< opt_list >();
+ }
+
+} // namespace ordlist
+
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_michael_kv.h"
+#include <cds/urcu/general_buffered.h>
+#include <cds/container/michael_kvlist_rcu.h>
+
+namespace ordlist {
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type;
+ struct RCU_GPB_cmp_traits : public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
+ };
+ }
+ void MichaelKVListTestHeader::RCU_GPB_cmp()
+ {
+ // traits-based version
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_GPB_cmp_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPB_less_traits : public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
+ };
+ }
+ void MichaelKVListTestHeader::RCU_GPB_less()
+ {
+ // traits-based version
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_GPB_less_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPB_cmpmix_traits : public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
+ typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
+ };
+ }
+ void MichaelKVListTestHeader::RCU_GPB_cmpmix()
+ {
+ // traits-based version
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_GPB_cmpmix_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ ,cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPB_ic_traits : public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+ void MichaelKVListTestHeader::RCU_GPB_ic()
+ {
+ // traits-based version
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_GPB_ic_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+} // namespace ordlist
+
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_michael_kv.h"
+#include <cds/urcu/general_instant.h>
+#include <cds/container/michael_kvlist_rcu.h>
+
+namespace ordlist {
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type;
+ struct RCU_GPI_cmp_traits : public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
+ };
+ }
+ void MichaelKVListTestHeader::RCU_GPI_cmp()
+ {
+ // traits-based version
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_GPI_cmp_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPI_less_traits : public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
+ };
+ }
+ void MichaelKVListTestHeader::RCU_GPI_less()
+ {
+ // traits-based version
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_GPI_less_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPI_cmpmix_traits : public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
+ typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
+ };
+ }
+ void MichaelKVListTestHeader::RCU_GPI_cmpmix()
+ {
+ // traits-based version
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_GPI_cmpmix_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ ,cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPI_ic_traits : public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+ void MichaelKVListTestHeader::RCU_GPI_ic()
+ {
+ // traits-based version
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_GPI_ic_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+} // namespace ordlist
+
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_michael_kv.h"
+#include <cds/urcu/general_threaded.h>
+#include <cds/container/michael_kvlist_rcu.h>
+
+namespace ordlist {
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type;
+ struct RCU_GPT_cmp_traits: public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
+ };
+ }
+ void MichaelKVListTestHeader::RCU_GPT_cmp()
+ {
+ // traits-based version
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_GPT_cmp_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPT_less_traits : public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
+ };
+ }
+ void MichaelKVListTestHeader::RCU_GPT_less()
+ {
+ // traits-based version
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_GPT_less_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPT_cmpmix_traits : public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
+ typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
+ };
+ }
+ void MichaelKVListTestHeader::RCU_GPT_cmpmix()
+ {
+ // traits-based version
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_GPT_cmpmix_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ ,cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPT_ic_traits : public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+ void MichaelKVListTestHeader::RCU_GPT_ic()
+ {
+ // traits-based version
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_GPT_ic_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+} // namespace ordlist
+
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_michael_kv.h"
+#include <cds/urcu/signal_buffered.h>
+#include <cds/container/michael_kvlist_rcu.h>
+
+namespace ordlist {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
+ struct RCU_SHB_cmp_traits: public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
+ };
+ }
+#endif
+ void MichaelKVListTestHeader::RCU_SHB_cmp()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_SHB_cmp_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ struct RCU_SHB_less_traits: public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
+ };
+ }
+#endif
+ void MichaelKVListTestHeader::RCU_SHB_less()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_SHB_less_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ struct RCU_SHB_cmpmix_traits: public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
+ typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
+ };
+ }
+#endif
+ void MichaelKVListTestHeader::RCU_SHB_cmpmix()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_SHB_cmpmix_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ ,cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ struct RCU_SHB_ic_traits: public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+#endif
+ void MichaelKVListTestHeader::RCU_SHB_ic()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_SHB_ic_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+} // namespace ordlist
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_michael_kv.h"
+#include <cds/urcu/signal_threaded.h>
+#include <cds/container/michael_kvlist_rcu.h>
+
+namespace ordlist {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type;
+ struct RCU_SHT_cmp_traits: public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
+ };
+ }
+#endif
+ void MichaelKVListTestHeader::RCU_SHT_cmp()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_SHT_cmp_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ struct RCU_SHT_less_traits: public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
+ };
+ }
+#endif
+ void MichaelKVListTestHeader::RCU_SHT_less()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_SHT_less_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ struct RCU_SHT_cmpmix_traits: public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
+ typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
+ };
+ }
+#endif
+ void MichaelKVListTestHeader::RCU_SHT_cmpmix()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_SHT_cmpmix_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<key_type> >
+ ,cc::opt::less< lt<key_type> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ struct RCU_SHT_ic_traits: public cc::michael_list::traits
+ {
+ typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+#endif
+ void MichaelKVListTestHeader::RCU_SHT_ic()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_SHT_ic_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelKVList< rcu_type, key_type, value_type,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<key_type> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+} // namespace ordlist
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_michael.h"
+#include <cds/container/michael_list_nogc.h>
+
+namespace ordlist {
+ namespace {
+ struct NOGC_cmp_traits: public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
+ };
+ }
+ void MichaelListTestHeader::NOGC_cmp()
+ {
+ // traits-based version
+ typedef cc::MichaelList< cds::gc::nogc, item, NOGC_cmp_traits > list;
+ nogc_test< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< cds::gc::nogc, item,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ >::type
+ > opt_list;
+ nogc_test< opt_list >();
+ }
+
+ namespace {
+ struct NOGC_less_traits: public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
+ };
+ }
+ void MichaelListTestHeader::NOGC_less()
+ {
+ // traits-based version
+ typedef cc::MichaelList< cds::gc::nogc, item, NOGC_less_traits > list;
+ nogc_test< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< cds::gc::nogc, item,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ nogc_test< opt_list >();
+ }
+
+ namespace {
+ struct NOGC_cmpmix_traits: public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
+ typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
+ };
+ }
+ void MichaelListTestHeader::NOGC_cmpmix()
+ {
+ // traits-based version
+ typedef cc::MichaelList< cds::gc::nogc, item, NOGC_cmpmix_traits > list;
+ nogc_test< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< cds::gc::nogc, item,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ ,cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ nogc_test< opt_list >();
+ }
+
+ namespace {
+ struct NOGC_ic_traits: public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+ void MichaelListTestHeader::NOGC_ic()
+ {
+ // traits-based version
+ typedef cc::MichaelList< cds::gc::nogc, item, NOGC_ic_traits > list;
+ nogc_test< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< cds::gc::nogc, item,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<item> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ nogc_test< opt_list >();
+ }
+
+} // namespace ordlist
+
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_michael.h"
+#include <cds/urcu/general_buffered.h>
+#include <cds/container/michael_list_rcu.h>
+
+namespace ordlist {
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type;
+
+ struct RCU_GPB_cmp_traits: public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
+ };
+ }
+
+ void MichaelListTestHeader::RCU_GPB_cmp()
+ {
+ // traits-based version
+ typedef cc::MichaelList< rcu_type, item, RCU_GPB_cmp_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< rcu_type, item,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPB_less_traits: public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
+ };
+ }
+ void MichaelListTestHeader::RCU_GPB_less()
+ {
+ // traits-based version
+ typedef cc::MichaelList< rcu_type, item, RCU_GPB_less_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< rcu_type, item,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPB_cmpmix_traits : public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
+ typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
+ };
+ }
+ void MichaelListTestHeader::RCU_GPB_cmpmix()
+ {
+ // traits-based version
+ typedef cc::MichaelList< rcu_type, item, RCU_GPB_cmpmix_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< rcu_type, item,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ ,cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPB_ic_traits : public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+ void MichaelListTestHeader::RCU_GPB_ic()
+ {
+ // traits-based version
+ typedef cc::MichaelList< rcu_type, item, RCU_GPB_ic_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< rcu_type, item,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<item> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+} // namespace ordlist
+
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_michael.h"
+#include <cds/urcu/general_instant.h>
+#include <cds/container/michael_list_rcu.h>
+
+namespace ordlist {
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type;
+
+ struct RCU_GPI_cmp_traits : public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
+ };
+ }
+
+ void MichaelListTestHeader::RCU_GPI_cmp()
+ {
+ // traits-based version
+ typedef cc::MichaelList< rcu_type, item, RCU_GPI_cmp_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< rcu_type, item,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPI_less_traits : public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
+ };
+ }
+ void MichaelListTestHeader::RCU_GPI_less()
+ {
+ // traits-based version
+ typedef cc::MichaelList< rcu_type, item, RCU_GPI_less_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< rcu_type, item,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPI_cmpmix_traits : public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
+ typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
+ };
+ }
+ void MichaelListTestHeader::RCU_GPI_cmpmix()
+ {
+ // traits-based version
+ typedef cc::MichaelList< rcu_type, item, RCU_GPI_cmpmix_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< rcu_type, item,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ ,cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPI_ic_traits : public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+ void MichaelListTestHeader::RCU_GPI_ic()
+ {
+ // traits-based version
+ typedef cc::MichaelList< rcu_type, item, RCU_GPI_ic_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< rcu_type, item,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<item> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+} // namespace ordlist
+
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_michael.h"
+#include <cds/urcu/general_threaded.h>
+#include <cds/container/michael_list_rcu.h>
+
+namespace ordlist {
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type;
+
+ struct RCU_GPT_cmp_traits : public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
+ };
+ }
+
+ void MichaelListTestHeader::RCU_GPT_cmp()
+ {
+ // traits-based version
+ typedef cc::MichaelList< rcu_type, item, RCU_GPT_cmp_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< rcu_type, item,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPT_less_traits : public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
+ };
+ }
+ void MichaelListTestHeader::RCU_GPT_less()
+ {
+ // traits-based version
+ typedef cc::MichaelList< rcu_type, item, RCU_GPT_less_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< rcu_type, item,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPT_cmpmix_traits : public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
+ typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
+ };
+ }
+ void MichaelListTestHeader::RCU_GPT_cmpmix()
+ {
+ // traits-based version
+ typedef cc::MichaelList< rcu_type, item, RCU_GPT_cmpmix_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< rcu_type, item,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ ,cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+ namespace {
+ struct RCU_GPT_ic_traits : public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+ void MichaelListTestHeader::RCU_GPT_ic()
+ {
+ // traits-based version
+ typedef cc::MichaelList< rcu_type, item, RCU_GPT_ic_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< rcu_type, item,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<item> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+ }
+
+} // namespace ordlist
+
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_michael.h"
+#include <cds/urcu/signal_buffered.h>
+#include <cds/container/michael_list_rcu.h>
+
+namespace ordlist {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
+
+ struct RCU_SHB_cmp_traits : public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
+ };
+ }
+#endif
+
+ void MichaelListTestHeader::RCU_SHB_cmp()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::MichaelList< rcu_type, item, RCU_SHB_cmp_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< rcu_type, item,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ struct RCU_SHB_less_traits : public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
+ };
+ }
+#endif
+ void MichaelListTestHeader::RCU_SHB_less()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::MichaelList< rcu_type, item, RCU_SHB_less_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< rcu_type, item,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ struct RCU_SHB_cmpmix_traits: public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
+ typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
+ };
+ }
+#endif
+ void MichaelListTestHeader::RCU_SHB_cmpmix()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::MichaelList< rcu_type, item, RCU_SHB_cmpmix_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< rcu_type, item,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ ,cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ struct RCU_SHB_ic_traits: public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+#endif
+ void MichaelListTestHeader::RCU_SHB_ic()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::MichaelList< rcu_type, item, RCU_SHB_ic_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< rcu_type, item,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<item> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+} // namespace ordlist
--- /dev/null
+//$$CDS-header$$
+
+#include "list/hdr_michael.h"
+#include <cds/urcu/signal_threaded.h>
+#include <cds/container/michael_list_rcu.h>
+
+namespace ordlist {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type;
+
+ struct RCU_SHT_cmp_traits : public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
+ };
+ }
+#endif
+
+ void MichaelListTestHeader::RCU_SHT_cmp()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::MichaelList< rcu_type, item, RCU_SHT_cmp_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< rcu_type, item,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ struct RCU_SHT_less_traits: public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
+ };
+ }
+#endif
+ void MichaelListTestHeader::RCU_SHT_less()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::MichaelList< rcu_type, item, RCU_SHT_less_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< rcu_type, item,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ struct RCU_SHT_cmpmix_traits: public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
+ typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
+ };
+ }
+#endif
+ void MichaelListTestHeader::RCU_SHT_cmpmix()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::MichaelList< rcu_type, item, RCU_SHT_cmpmix_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< rcu_type, item,
+ cc::michael_list::make_traits<
+ cc::opt::compare< cmp<item> >
+ ,cc::opt::less< lt<item> >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ namespace {
+ struct RCU_SHT_ic_traits: public cc::michael_list::traits
+ {
+ typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
+ typedef cds::atomicity::item_counter item_counter;
+ };
+ }
+#endif
+ void MichaelListTestHeader::RCU_SHT_ic()
+ {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+ // traits-based version
+ typedef cc::MichaelList< rcu_type, item, RCU_SHT_ic_traits > list;
+ test_rcu< list >();
+
+ // option-based version
+
+ typedef cc::MichaelList< rcu_type, item,
+ cc::michael_list::make_traits<
+ cc::opt::less< lt<item> >
+ ,cc::opt::item_counter< cds::atomicity::item_counter >
+ >::type
+ > opt_list;
+ test_rcu< opt_list >();
+#endif
+ }
+
+} // namespace ordlist
+++ /dev/null
-//$$CDS-header$$
-
-#ifndef CDSTEST_HDR_INTRUSIVE_LAZY_H
-#define CDSTEST_HDR_INTRUSIVE_LAZY_H
-
-#include "cppunit/cppunit_proxy.h"
-#include <cds/intrusive/details/lazy_list_base.h>
-
-namespace ordlist {
- namespace ci = cds::intrusive;
- namespace co = cds::opt;
-
- class IntrusiveLazyListHeaderTest: public CppUnitMini::TestCase
- {
- public:
-
- struct stat {
- int nDisposeCount;
- int nEnsureExistsCall;
- int nEnsureNewCall;
- int nFindCall;
- int nEraseCall;
-
- stat()
- : nDisposeCount(0)
- , nEnsureExistsCall(0)
- , nEnsureNewCall(0)
- , nFindCall(0)
- , nEraseCall(0)
- {}
-
- stat( const stat& s )
- {
- *this = s;
- }
-
- stat& operator =(const stat& s)
- {
- memcpy( this, &s, sizeof(s));
- return *this;
- }
- };
-
- template <typename GC>
- struct base_int_item: public ci::lazy_list::node< GC >
- {
- int nKey;
- int nVal;
-
- mutable stat s;
-
- base_int_item()
- {}
-
- base_int_item(int key, int val)
- : nKey( key )
- , nVal(val)
- , s()
- {}
-
- base_int_item(const base_int_item& v )
- : nKey( v.nKey )
- , nVal( v.nVal )
- , s()
- {}
-
- const int& key() const
- {
- return nKey;
- }
- };
-
- template <typename GC>
- struct member_int_item
- {
- int nKey;
- int nVal;
-
- ci::lazy_list::node< GC > hMember;
-
- mutable stat s;
-
- member_int_item()
- {}
-
- member_int_item(int key, int val)
- : nKey( key )
- , nVal(val)
- , s()
- {}
-
- member_int_item(const member_int_item& v )
- : nKey( v.nKey )
- , nVal( v.nVal )
- , s()
- {}
-
- const int& key() const
- {
- return nKey;
- }
- };
-
- template <typename T>
- struct less
- {
- bool operator ()(const T& v1, const T& v2 ) const
- {
- return v1.key() < v2.key();
- }
-
- template <typename Q>
- bool operator ()(const T& v1, const Q& v2 ) const
- {
- return v1.key() < v2;
- }
-
- template <typename Q>
- bool operator ()(const Q& v1, const T& v2 ) const
- {
- return v1 < v2.key();
- }
- };
-
- template <typename T>
- struct cmp {
- int operator ()(const T& v1, const T& v2 ) const
- {
- if ( v1.key() < v2.key() )
- return -1;
- return v1.key() > v2.key() ? 1 : 0;
- }
-
- template <typename Q>
- int operator ()(const T& v1, const Q& v2 ) const
- {
- if ( v1.key() < v2 )
- return -1;
- return v1.key() > v2 ? 1 : 0;
- }
-
- template <typename Q>
- int operator ()(const Q& v1, const T& v2 ) const
- {
- if ( v1 < v2.key() )
- return -1;
- return v1 > v2.key() ? 1 : 0;
- }
- };
-
- template <typename T>
- struct equal {
- bool operator ()(const T& v1, const T& v2 ) const
- {
- return v1.key() == v2.key();
- }
-
- template <typename Q>
- bool operator ()(const T& v1, const Q& v2 ) const
- {
- return v1.key() == v2;
- }
-
- template <typename Q>
- bool operator ()(const Q& v1, const T& v2 ) const
- {
- return v1 == v2.key();
- }
- };
-
- struct other_item {
- int nKey;
-
- other_item( int n )
- : nKey(n)
- {}
- };
-
- struct other_less {
- template <typename T, typename Q>
- bool operator()( T const& i1, Q const& i2) const
- {
- return i1.nKey < i2.nKey;
- }
- };
-
- struct other_equal {
- template <typename T, typename Q>
- bool operator()( T const& i1, Q const& i2) const
- {
- return i1.nKey == i2.nKey;
- }
- };
-
- struct faked_disposer
- {
- template <typename T>
- void operator ()( T * p )
- {
- ++p->s.nDisposeCount;
- }
- };
-
- struct ensure_functor
- {
- template <typename T>
- void operator ()(bool bNew, T& item, T& /*val*/ )
- {
- if ( bNew )
- ++item.s.nEnsureNewCall;
- else
- ++item.s.nEnsureExistsCall;
- }
- };
-
- struct find_functor
- {
- template <typename T, typename Q>
- void operator ()( T& item, Q& /*val*/ )
- {
- ++item.s.nFindCall;
- }
- };
-
- struct erase_functor
- {
- template <typename T>
- void operator()( T const& item )
- {
- item.s.nEraseCall++;
- }
- };
-
- template <class OrdList>
- void test_int_common()
- {
- typedef typename OrdList::value_type value_type;
-
- value_type v1( 10, 50 );
- value_type v2( 5, 25 );
- value_type v3( 20, 100 );
- {
- OrdList l;
- CPPUNIT_ASSERT( l.empty() );
-
- CPPUNIT_ASSERT( l.insert( v1 )) ; // true
- CPPUNIT_ASSERT( l.find( v1.key() ));
-
- CPPUNIT_ASSERT( v1.s.nFindCall == 0 );
- CPPUNIT_ASSERT( l.find( v1.key(), find_functor() ));
- CPPUNIT_ASSERT( v1.s.nFindCall == 1 );
-
- CPPUNIT_ASSERT( !l.find_with( v2.key(), less<value_type>() ));
- CPPUNIT_ASSERT( !l.find( v3.key(), find_functor() ));
- CPPUNIT_ASSERT( !l.empty() );
-
- //CPPUNIT_ASSERT( !l.insert( v1 )) ; // assertion "is_empty" is raised
-
- {
- value_type v( v1 );
- CPPUNIT_ASSERT( !l.insert( v )) ; // false
- }
-
- std::pair<bool, bool> ret = l.ensure( v2, ensure_functor() );
- CPPUNIT_ASSERT( ret.first );
- CPPUNIT_ASSERT( ret.second );
- CPPUNIT_ASSERT( v2.s.nEnsureNewCall == 1 );
- CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == 0 );
-
- //CPPUNIT_ASSERT( !l.insert( v2 )) ; // assertion "is_empty"
-
- CPPUNIT_ASSERT( l.find( v1.key() )) ; // true
-
- CPPUNIT_ASSERT( v1.s.nFindCall == 1 );
- CPPUNIT_ASSERT( l.find( v1.key(), find_functor() ));
- CPPUNIT_ASSERT( v1.s.nFindCall == 2 );
-
- CPPUNIT_ASSERT( l.find( v2.key() ));
-
- CPPUNIT_ASSERT( v2.s.nFindCall == 0 );
- CPPUNIT_ASSERT( l.find_with( v2.key(), less<value_type>(), find_functor() ));
- CPPUNIT_ASSERT( v2.s.nFindCall == 1 );
-
- CPPUNIT_ASSERT( !l.find( v3.key() ));
-
- {
- CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == 0 );
- CPPUNIT_ASSERT( v2.s.nEnsureNewCall == 1 );
-
- value_type v( v2 );
- ret = l.ensure( v, ensure_functor() );
-
- CPPUNIT_ASSERT( ret.first );
- CPPUNIT_ASSERT( !ret.second );
- CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == 1 );
- CPPUNIT_ASSERT( v2.s.nEnsureNewCall == 1 );
- CPPUNIT_ASSERT( v.s.nEnsureExistsCall == 0 );
- CPPUNIT_ASSERT( v.s.nEnsureNewCall == 0 );
- }
-
- CPPUNIT_ASSERT( !l.empty() );
-
- CPPUNIT_ASSERT( l.insert( v3 )) ; // true
- CPPUNIT_ASSERT( l.find( v3.key() ));
-
- CPPUNIT_ASSERT( v3.s.nFindCall == 0 );
- CPPUNIT_ASSERT( l.find( v3.key(), find_functor() ));
- CPPUNIT_ASSERT( v3.s.nFindCall == 1 );
-
- CPPUNIT_ASSERT( l.unlink( v2 ) );
- CPPUNIT_ASSERT( l.find( v1.key() )) ; // true
- CPPUNIT_ASSERT( !l.find( v2.key() )) ; // true
- CPPUNIT_ASSERT( l.find( v3.key() )) ; // true
- CPPUNIT_ASSERT( !l.empty() );
- CPPUNIT_ASSERT( !l.unlink( v2 ) );
-
- {
- // v1 key is in the list but v NODE is not in the list
- value_type v( v1 );
- CPPUNIT_ASSERT( !l.unlink( v ) );
- }
-
- CPPUNIT_ASSERT( l.unlink( v1 ) );
- CPPUNIT_ASSERT( !l.unlink( v1 ) );
- CPPUNIT_ASSERT( !l.find( v1.key() ));
- CPPUNIT_ASSERT( !l.find( v2.key() ));
- CPPUNIT_ASSERT( l.find( v3.key() ));
- CPPUNIT_ASSERT( !l.empty() );
- CPPUNIT_ASSERT( !l.unlink( v1 ) );
- CPPUNIT_ASSERT( !l.unlink( v2 ) );
-
- CPPUNIT_ASSERT( l.unlink( v3 ) );
- CPPUNIT_ASSERT( !l.find( v1.key() ));
- CPPUNIT_ASSERT( !l.find_with( v2.key(), less<value_type>() ));
- CPPUNIT_ASSERT( !l.find( v3.key() ));
- CPPUNIT_ASSERT( l.empty() );
- CPPUNIT_ASSERT( !l.unlink( v1 ) );
- CPPUNIT_ASSERT( !l.unlink( v2 ) );
- CPPUNIT_ASSERT( !l.unlink( v3 ) );
-
- // Apply retired pointer to clean links
- OrdList::gc::force_dispose();
-
- stat s( v3.s );
- ret = l.ensure( v3, ensure_functor() );
- CPPUNIT_ASSERT( ret.first );
- CPPUNIT_ASSERT( ret.second );
- CPPUNIT_ASSERT( v3.s.nEnsureNewCall == s.nEnsureNewCall + 1);
- CPPUNIT_ASSERT( v3.s.nEnsureExistsCall == s.nEnsureExistsCall );
- CPPUNIT_ASSERT( !l.empty() );
-
- s = v2.s;
- ret = l.ensure( v2, ensure_functor() );
- CPPUNIT_ASSERT( ret.first );
- CPPUNIT_ASSERT( ret.second );
- CPPUNIT_ASSERT( v2.s.nEnsureNewCall == s.nEnsureNewCall + 1);
- CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == s.nEnsureExistsCall );
- CPPUNIT_ASSERT( !l.empty() );
-
- s = v1.s;
- ret = l.ensure( v1, ensure_functor() );
- CPPUNIT_ASSERT( ret.first );
- CPPUNIT_ASSERT( ret.second );
- CPPUNIT_ASSERT( v1.s.nEnsureNewCall == s.nEnsureNewCall + 1);
- CPPUNIT_ASSERT( v1.s.nEnsureExistsCall == s.nEnsureExistsCall );
- CPPUNIT_ASSERT( !l.empty() );
-
- // Erase test
- CPPUNIT_ASSERT( l.erase( v1.key()) );
- //CPPUNIT_ASSERT( v1.s.nDisposeCount == 0 );
- CPPUNIT_ASSERT( !l.empty() );
-
- CPPUNIT_ASSERT( v2.s.nEraseCall == 0 );
- CPPUNIT_ASSERT( l.erase_with( v2.key(), less<value_type>(), erase_functor()) );
- CPPUNIT_ASSERT( v2.s.nEraseCall == 1 );
- CPPUNIT_ASSERT( !l.erase_with( v2.key(), less<value_type>()));
- CPPUNIT_ASSERT( v2.s.nEraseCall == 1 );
- //CPPUNIT_ASSERT( v2.s.nDisposeCount == 0 );
- CPPUNIT_ASSERT( !l.empty() );
-
- CPPUNIT_ASSERT( !l.erase( v2 ));
- CPPUNIT_ASSERT( !l.erase( v1 ));
- //CPPUNIT_ASSERT( v2.s.nDisposeCount == 0 );
- CPPUNIT_ASSERT( !l.empty() );
-
- CPPUNIT_ASSERT( v3.s.nEraseCall == 0 );
- CPPUNIT_ASSERT( l.erase( v3, erase_functor() ));
- CPPUNIT_ASSERT( v3.s.nEraseCall == 1 );
- //CPPUNIT_ASSERT( v3.s.nDisposeCount == 0 );
- CPPUNIT_ASSERT( l.empty() );
-
- // Apply retired pointer to clean links
- OrdList::gc::force_dispose();
-
- // Unlink test
- CPPUNIT_ASSERT( l.insert( v1 ));
- CPPUNIT_ASSERT( l.insert( v3 ));
- CPPUNIT_ASSERT( !l.empty() );
- CPPUNIT_ASSERT( !l.unlink( v2 ));
- CPPUNIT_ASSERT( l.unlink( v1 ));
- CPPUNIT_ASSERT( !l.unlink( v1 ));
- CPPUNIT_ASSERT( l.unlink( v3 ));
- CPPUNIT_ASSERT( !l.unlink( v3 ));
- CPPUNIT_ASSERT( l.empty() );
-
- // Apply retired pointer
- OrdList::gc::force_dispose();
- CPPUNIT_ASSERT( v1.s.nDisposeCount == 3 );
- CPPUNIT_ASSERT( v2.s.nDisposeCount == 2 );
- CPPUNIT_ASSERT( v3.s.nDisposeCount == 3 );
-
- // Destructor test (call disposer)
- CPPUNIT_ASSERT( l.insert( v1 ));
- CPPUNIT_ASSERT( l.insert( v3 ));
- CPPUNIT_ASSERT( l.insert( v2 ));
-
- // Iterator test
- {
- typename OrdList::iterator it = l.begin();
- typename OrdList::const_iterator cit = l.cbegin();
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it != l.cend() );
- CPPUNIT_ASSERT( cit != l.end() );
- CPPUNIT_ASSERT( cit != l.cend() );
- CPPUNIT_ASSERT( cit == it );
-
- CPPUNIT_ASSERT( it->nKey == v2.nKey );
- CPPUNIT_ASSERT( it->nVal == v2.nVal );
- CPPUNIT_ASSERT( ++it != l.end() );
- CPPUNIT_ASSERT( it->nKey == v1.nKey );
- CPPUNIT_ASSERT( it->nVal == v1.nVal );
- CPPUNIT_ASSERT( ++it != l.end() );
- CPPUNIT_ASSERT( it->nKey == v3.nKey );
- CPPUNIT_ASSERT( it->nVal == v3.nVal );
- CPPUNIT_ASSERT( ++it == l.end() );
- }
-
- {
- OrdList const & lref = l;
- typename OrdList::const_iterator it = lref.begin();
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it->nKey == v2.nKey );
- CPPUNIT_ASSERT( it->nVal == v2.nVal );
- CPPUNIT_ASSERT( ++it != lref.end() );
- CPPUNIT_ASSERT( it->nKey == v1.nKey );
- CPPUNIT_ASSERT( it->nVal == v1.nVal );
- CPPUNIT_ASSERT( ++it != l.end() );
- CPPUNIT_ASSERT( it->nKey == v3.nKey );
- CPPUNIT_ASSERT( it->nVal == v3.nVal );
- CPPUNIT_ASSERT( ++it == l.end() );
- }
- }
-
- // Apply retired pointer
- OrdList::gc::force_dispose();
-
- CPPUNIT_ASSERT( v1.s.nDisposeCount == 4 );
- CPPUNIT_ASSERT( v2.s.nDisposeCount == 3 );
- CPPUNIT_ASSERT( v3.s.nDisposeCount == 4 );
- }
-
- template <class OrdList>
- void test_int()
- {
- test_int_common<OrdList>();
-
- OrdList l;
- typename OrdList::guarded_ptr gp;
-
- static int const nLimit = 20;
- typename OrdList::value_type arrItem[nLimit];
-
- {
- int a[nLimit];
- for (int i = 0; i < nLimit; ++i)
- a[i]=i;
- std::random_shuffle( a, a + nLimit );
-
- for (int i = 0; i < nLimit; ++i) {
- arrItem[i].nKey = a[i];
- arrItem[i].nVal = a[i] * 2;
- }
-
- // extract/get
- for ( int i = 0; i < nLimit; ++i )
- CPPUNIT_ASSERT( l.insert( arrItem[i] ) );
-
- for ( int i=0; i < nLimit; ++i ) {
- gp = l.get( arrItem[i].nKey );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_ASSERT( gp->nKey == arrItem[i].nKey );
- CPPUNIT_ASSERT( gp->nVal == arrItem[i].nVal );
-
- gp = l.extract( arrItem[i].nKey );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_ASSERT( gp->nKey == arrItem[i].nKey );
- CPPUNIT_ASSERT( gp->nVal == arrItem[i].nVal );
-
- gp = l.get( arrItem[i].nKey );
- CPPUNIT_ASSERT( !gp );
- CPPUNIT_ASSERT( gp.empty());
- CPPUNIT_ASSERT( !l.extract( arrItem[i].nKey ));
- CPPUNIT_ASSERT( gp.empty());
- }
- CPPUNIT_ASSERT( l.empty() );
- CPPUNIT_ASSERT( !l.get( nLimit/2 ));
- CPPUNIT_ASSERT( !l.extract( nLimit/2 ));
-
- // Apply retired pointer
- OrdList::gc::force_dispose();
-
- // extract_with/get_with
- for ( int i = 0; i < nLimit; ++i )
- CPPUNIT_ASSERT( l.insert( arrItem[i] ) );
-
- for ( int i=0; i < nLimit; ++i ) {
- other_item itm( arrItem[i].nKey );
- gp = l.get_with( itm, other_less() );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_ASSERT( gp->nKey == arrItem[i].nKey );
- CPPUNIT_ASSERT( gp->nVal == arrItem[i].nVal );
-
- gp = l.extract_with( itm, other_less() );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_ASSERT( gp->nKey == arrItem[i].nKey );
- CPPUNIT_ASSERT( gp->nVal == arrItem[i].nVal );
-
- gp = l.get_with( itm, other_less() );
- CPPUNIT_ASSERT( !gp );
- CPPUNIT_ASSERT( gp.empty());
- CPPUNIT_ASSERT( !l.extract_with( itm, other_less() ));
- CPPUNIT_ASSERT( gp.empty());
- }
- CPPUNIT_ASSERT( l.empty() );
- CPPUNIT_ASSERT( !l.get_with( other_item(nLimit/2), other_less() ));
- CPPUNIT_ASSERT( gp.empty());
- CPPUNIT_ASSERT( !l.extract_with( other_item(nLimit/2), other_less() ));
- CPPUNIT_ASSERT( gp.empty());
-
- // Apply retired pointer
- OrdList::gc::force_dispose();
-
- for ( int i=0; i < nLimit; i++ ) {
- CPPUNIT_ASSERT( arrItem[i].s.nDisposeCount == 2 );
- }
- }
- }
-
- template <class OrdList>
- void test_rcu_int()
- {
- test_int_common<OrdList>();
-
- OrdList l;
- static int const nLimit = 20;
- typename OrdList::value_type arrItem[nLimit];
-
- typedef typename OrdList::rcu_lock rcu_lock;
- typedef typename OrdList::value_type value_type;
- typedef typename OrdList::gc rcu_type;
-
- {
- int a[nLimit];
- for (int i = 0; i < nLimit; ++i)
- a[i]=i;
- std::random_shuffle( a, a + nLimit );
-
- for (int i = 0; i < nLimit; ++i) {
- arrItem[i].nKey = a[i];
- arrItem[i].nVal = a[i] * 2;
- }
-
- typename OrdList::exempt_ptr ep;
-
- // extract/get
- for ( int i = 0; i < nLimit; ++i )
- CPPUNIT_ASSERT( l.insert( arrItem[i] ) );
-
- for ( int i = 0; i < nLimit; ++i ) {
- {
- rcu_lock lock;
- value_type * pGet = l.get( a[i] );
- CPPUNIT_ASSERT( pGet != nullptr );
- CPPUNIT_CHECK( pGet->nKey == a[i] );
- CPPUNIT_CHECK( pGet->nVal == a[i] * 2 );
-
- ep = l.extract( a[i] );
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty() );
- CPPUNIT_CHECK( ep->nKey == a[i] );
- CPPUNIT_CHECK( (*ep).nVal == a[i] * 2 );
- }
- ep.release();
- {
- rcu_lock lock;
- CPPUNIT_CHECK( l.get( a[i] ) == nullptr );
- CPPUNIT_CHECK( !l.extract( a[i] ) );
- CPPUNIT_CHECK( ep.empty() );
- }
- }
- CPPUNIT_ASSERT( l.empty() );
-
- {
- rcu_lock lock;
- CPPUNIT_CHECK( l.get( a[0] ) == nullptr );
- ep = l.extract( a[0] );
- CPPUNIT_CHECK( !ep );
- CPPUNIT_CHECK( ep.empty() );
- }
- // Apply retired pointer
- OrdList::gc::force_dispose();
-
- // extract_with/get_with
- for ( int i = 0; i < nLimit; ++i ) {
- CPPUNIT_ASSERT( l.insert( arrItem[i] ) );
- }
-
- for ( int i = 0; i < nLimit; ++i ) {
- other_item itm( a[i] );
- {
- rcu_lock lock;
- value_type * pGet = l.get_with( itm, other_less() );
- CPPUNIT_ASSERT( pGet != nullptr );
- CPPUNIT_CHECK( pGet->nKey == a[i] );
- CPPUNIT_CHECK( pGet->nVal == a[i] * 2 );
-
- ep = l.extract_with( itm, other_less() );
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty() );
- CPPUNIT_CHECK( ep->nKey == a[i] );
- CPPUNIT_CHECK( ep->nVal == a[i] * 2 );
- }
- ep.release();
- {
- rcu_lock lock;
- CPPUNIT_CHECK( l.get_with( itm, other_less() ) == nullptr );
- ep = l.extract_with( itm, other_less() );
- CPPUNIT_CHECK( !ep );
- CPPUNIT_CHECK( ep.empty() );
- }
- }
- CPPUNIT_ASSERT( l.empty() );
-
- {
- rcu_lock lock;
- CPPUNIT_CHECK( l.get_with( other_item( 0 ), other_less() ) == nullptr );
- CPPUNIT_CHECK( !l.extract_with( other_item(0), other_less() ));
- CPPUNIT_CHECK( ep.empty() );
- }
- // Apply retired pointer
- OrdList::gc::force_dispose();
- }
- }
-
- template <class OrdList>
- void test_nogc_int()
- {
- typedef typename OrdList::value_type value_type;
- typedef typename std::conditional< OrdList::c_bSort, less<value_type>, equal<value_type>>::type find_predicate;
-
- {
- value_type v1( 10, 50 );
- value_type v2( 5, 25 );
- value_type v3( 20, 100 );
- {
- OrdList l;
- CPPUNIT_ASSERT( l.empty() );
-
- CPPUNIT_ASSERT( l.insert( v1 )) ; // true
- CPPUNIT_ASSERT( l.find( v1.key() ) == &v1 );
-
- CPPUNIT_ASSERT( v1.s.nFindCall == 0 );
- CPPUNIT_ASSERT( l.find( v1.key(), find_functor() ));
- CPPUNIT_ASSERT( v1.s.nFindCall == 1 );
-
- CPPUNIT_ASSERT( l.find_with( v2.key(), find_predicate() ) == nullptr );
- CPPUNIT_ASSERT( l.find( v3.key() ) == nullptr );
- CPPUNIT_ASSERT( !l.empty() );
-
- //CPPUNIT_ASSERT( !l.insert( v1 )) ; // assertion "is_empty" is raised
-
- {
- value_type v( v1 );
- CPPUNIT_ASSERT( !l.insert( v )) ; // false
- }
-
- std::pair<bool, bool> ret = l.ensure( v2, ensure_functor() );
- CPPUNIT_ASSERT( ret.first );
- CPPUNIT_ASSERT( ret.second );
- CPPUNIT_ASSERT( v2.s.nEnsureNewCall == 1 );
- CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == 0 );
-
- //CPPUNIT_ASSERT( !l.insert( v2 )) ; // assertion "is_empty"
-
- CPPUNIT_ASSERT( l.find( v1.key() ) == &v1 ) ; // true
-
- CPPUNIT_ASSERT( v1.s.nFindCall == 1 );
- CPPUNIT_ASSERT( l.find( v1.key(), find_functor() ));
- CPPUNIT_ASSERT( v1.s.nFindCall == 2 );
-
- CPPUNIT_ASSERT( l.find_with( v2.key(), find_predicate() ) == &v2 );
-
- CPPUNIT_ASSERT( v2.s.nFindCall == 0 );
- CPPUNIT_ASSERT( l.find_with( v2.key(), find_predicate(), find_functor() ));
- CPPUNIT_ASSERT( v2.s.nFindCall == 1 );
-
- CPPUNIT_ASSERT( !l.find( v3.key() ));
-
- {
- value_type v( v2 );
- ret = l.ensure( v, ensure_functor() );
-
- CPPUNIT_ASSERT( ret.first );
- CPPUNIT_ASSERT( !ret.second );
- CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == 1 );
- CPPUNIT_ASSERT( v.s.nEnsureExistsCall == 0 && v.s.nEnsureNewCall == 0 );
- }
-
- CPPUNIT_ASSERT( !l.empty() );
-
- CPPUNIT_ASSERT( l.insert( v3 )) ; // true
- CPPUNIT_ASSERT( l.find( v3.key() ) == &v3 );
-
- CPPUNIT_ASSERT( v3.s.nFindCall == 0 );
- CPPUNIT_ASSERT( l.find( v3.key(), find_functor() ));
- CPPUNIT_ASSERT( v3.s.nFindCall == 1 );
-
- {
- typename OrdList::iterator it = l.begin();
- typename OrdList::const_iterator cit = l.cbegin();
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it != l.cend() );
- CPPUNIT_ASSERT( cit != l.end() );
- CPPUNIT_ASSERT( cit != l.cend() );
- CPPUNIT_ASSERT( cit == it );
-
- CPPUNIT_ASSERT( it->nKey == v2.nKey );
- CPPUNIT_ASSERT( it->nVal == v2.nVal );
- CPPUNIT_ASSERT( ++it != l.end() );
- CPPUNIT_ASSERT( it->nKey == v1.nKey );
- CPPUNIT_ASSERT( it->nVal == v1.nVal );
- CPPUNIT_ASSERT( it++ != l.end() );
- CPPUNIT_ASSERT( it->nKey == v3.nKey );
- CPPUNIT_ASSERT( it->nVal == v3.nVal );
- CPPUNIT_ASSERT( it++ != l.end() );
- CPPUNIT_ASSERT( it == l.end() );
- }
-
- {
- OrdList const & lref = l;
- typename OrdList::const_iterator it = lref.begin();
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it->nKey == v2.nKey );
- CPPUNIT_ASSERT( it->nVal == v2.nVal );
- CPPUNIT_ASSERT( ++it != lref.end() );
- CPPUNIT_ASSERT( it->nKey == v1.nKey );
- CPPUNIT_ASSERT( it->nVal == v1.nVal );
- CPPUNIT_ASSERT( it++ != l.end() );
- CPPUNIT_ASSERT( it->nKey == v3.nKey );
- CPPUNIT_ASSERT( it->nVal == v3.nVal );
- CPPUNIT_ASSERT( it++ != lref.end() );
- CPPUNIT_ASSERT( it == l.end() );
- }
- }
-
- // Disposer called on list destruction
- CPPUNIT_ASSERT( v1.s.nDisposeCount == 1 );
- CPPUNIT_ASSERT( v2.s.nDisposeCount == 1 );
- CPPUNIT_ASSERT( v3.s.nDisposeCount == 1 );
- }
- }
-
- void HP_base_cmp();
- void HP_base_less();
- void HP_base_cmpmix();
- void HP_base_ic();
- void HP_member_cmp();
- void HP_member_less();
- void HP_member_cmpmix();
- void HP_member_ic();
-
- void DHP_base_cmp();
- void DHP_base_less();
- void DHP_base_cmpmix();
- void DHP_base_ic();
- void DHP_member_cmp();
- void DHP_member_less();
- void DHP_member_cmpmix();
- void DHP_member_ic();
-
- void RCU_GPI_base_cmp();
- void RCU_GPI_base_less();
- void RCU_GPI_base_cmpmix();
- void RCU_GPI_base_ic();
- void RCU_GPI_member_cmp();
- void RCU_GPI_member_less();
- void RCU_GPI_member_cmpmix();
- void RCU_GPI_member_ic();
-
- void RCU_GPB_base_cmp();
- void RCU_GPB_base_less();
- void RCU_GPB_base_cmpmix();
- void RCU_GPB_base_ic();
- void RCU_GPB_member_cmp();
- void RCU_GPB_member_less();
- void RCU_GPB_member_cmpmix();
- void RCU_GPB_member_ic();
-
- void RCU_GPT_base_cmp();
- void RCU_GPT_base_less();
- void RCU_GPT_base_cmpmix();
- void RCU_GPT_base_ic();
- void RCU_GPT_member_cmp();
- void RCU_GPT_member_less();
- void RCU_GPT_member_cmpmix();
- void RCU_GPT_member_ic();
-
- void RCU_SHB_base_cmp();
- void RCU_SHB_base_less();
- void RCU_SHB_base_cmpmix();
- void RCU_SHB_base_ic();
- void RCU_SHB_member_cmp();
- void RCU_SHB_member_less();
- void RCU_SHB_member_cmpmix();
- void RCU_SHB_member_ic();
-
- void RCU_SHT_base_cmp();
- void RCU_SHT_base_less();
- void RCU_SHT_base_cmpmix();
- void RCU_SHT_base_ic();
- void RCU_SHT_member_cmp();
- void RCU_SHT_member_less();
- void RCU_SHT_member_cmpmix();
- void RCU_SHT_member_ic();
-
- void nogc_base_cmp();
- void nogc_base_less();
- void nogc_base_cmpmix();
- void nogc_base_ic();
- void nogc_member_cmp();
- void nogc_member_less();
- void nogc_member_cmpmix();
- void nogc_member_ic();
- void nogc_base_unord_equal();
- void nogc_base_unord_cmp();
- void nogc_base_unord_less();
- void nogc_member_unord_equal();
- void nogc_member_unord_cmp();
- void nogc_member_unord_less();
-
-
- CPPUNIT_TEST_SUITE(IntrusiveLazyListHeaderTest)
- CPPUNIT_TEST(HP_base_cmp)
- CPPUNIT_TEST(HP_base_less)
- CPPUNIT_TEST(HP_base_cmpmix)
- CPPUNIT_TEST(HP_base_ic)
- CPPUNIT_TEST(HP_member_cmp)
- CPPUNIT_TEST(HP_member_less)
- CPPUNIT_TEST(HP_member_cmpmix)
- CPPUNIT_TEST(HP_member_ic)
-
- CPPUNIT_TEST(DHP_base_cmp)
- CPPUNIT_TEST(DHP_base_less)
- CPPUNIT_TEST(DHP_base_cmpmix)
- CPPUNIT_TEST(DHP_base_ic)
- CPPUNIT_TEST(DHP_member_cmp)
- CPPUNIT_TEST(DHP_member_less)
- CPPUNIT_TEST(DHP_member_cmpmix)
- CPPUNIT_TEST(DHP_member_ic)
-
- CPPUNIT_TEST(RCU_GPI_base_cmp)
- CPPUNIT_TEST(RCU_GPI_base_less)
- CPPUNIT_TEST(RCU_GPI_base_cmpmix)
- CPPUNIT_TEST(RCU_GPI_base_ic)
- CPPUNIT_TEST(RCU_GPI_member_cmp)
- CPPUNIT_TEST(RCU_GPI_member_less)
- CPPUNIT_TEST(RCU_GPI_member_cmpmix)
- CPPUNIT_TEST(RCU_GPI_member_ic)
-
- CPPUNIT_TEST(RCU_GPB_base_cmp)
- CPPUNIT_TEST(RCU_GPB_base_less)
- CPPUNIT_TEST(RCU_GPB_base_cmpmix)
- CPPUNIT_TEST(RCU_GPB_base_ic)
- CPPUNIT_TEST(RCU_GPB_member_cmp)
- CPPUNIT_TEST(RCU_GPB_member_less)
- CPPUNIT_TEST(RCU_GPB_member_cmpmix)
- CPPUNIT_TEST(RCU_GPB_member_ic)
-
- CPPUNIT_TEST(RCU_GPT_base_cmp)
- CPPUNIT_TEST(RCU_GPT_base_less)
- CPPUNIT_TEST(RCU_GPT_base_cmpmix)
- CPPUNIT_TEST(RCU_GPT_base_ic)
- CPPUNIT_TEST(RCU_GPT_member_cmp)
- CPPUNIT_TEST(RCU_GPT_member_less)
- CPPUNIT_TEST(RCU_GPT_member_cmpmix)
- CPPUNIT_TEST(RCU_GPT_member_ic)
-
- CPPUNIT_TEST(RCU_SHB_base_cmp)
- CPPUNIT_TEST(RCU_SHB_base_less)
- CPPUNIT_TEST(RCU_SHB_base_cmpmix)
- CPPUNIT_TEST(RCU_SHB_base_ic)
- CPPUNIT_TEST(RCU_SHB_member_cmp)
- CPPUNIT_TEST(RCU_SHB_member_less)
- CPPUNIT_TEST(RCU_SHB_member_cmpmix)
- CPPUNIT_TEST(RCU_SHB_member_ic)
-
- CPPUNIT_TEST(RCU_SHT_base_cmp)
- CPPUNIT_TEST(RCU_SHT_base_less)
- CPPUNIT_TEST(RCU_SHT_base_cmpmix)
- CPPUNIT_TEST(RCU_SHT_base_ic)
- CPPUNIT_TEST(RCU_SHT_member_cmp)
- CPPUNIT_TEST(RCU_SHT_member_less)
- CPPUNIT_TEST(RCU_SHT_member_cmpmix)
- CPPUNIT_TEST(RCU_SHT_member_ic)
-
- CPPUNIT_TEST(nogc_base_cmp)
- CPPUNIT_TEST(nogc_base_less)
- CPPUNIT_TEST(nogc_base_cmpmix)
- CPPUNIT_TEST(nogc_base_ic)
- CPPUNIT_TEST(nogc_base_unord_equal)
- CPPUNIT_TEST(nogc_base_unord_cmp)
- CPPUNIT_TEST(nogc_base_unord_less)
- CPPUNIT_TEST(nogc_member_cmp)
- CPPUNIT_TEST(nogc_member_less)
- CPPUNIT_TEST(nogc_member_cmpmix)
- CPPUNIT_TEST(nogc_member_ic)
- CPPUNIT_TEST(nogc_member_unord_equal)
- CPPUNIT_TEST(nogc_member_unord_cmp)
- CPPUNIT_TEST(nogc_member_unord_less)
-
- CPPUNIT_TEST_SUITE_END()
- };
-} // namespace ordlist
-
-#endif // #ifndef CDSTEST_HDR_INTRUSIVE_LAZY_H
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_intrusive_lazy.h"
-#include <cds/intrusive/lazy_list_dhp.h>
-
-namespace ordlist {
- void IntrusiveLazyListHeaderTest::DHP_base_cmp()
- {
- typedef base_int_item< cds::gc::DHP > item;
- struct traits : public ci::lazy_list::traits
- {
- typedef ci::lazy_list::base_hook< co::gc<cds::gc::DHP> > hook;
- typedef cmp<item> compare;
- typedef faked_disposer disposer;
- };
- typedef ci::LazyList< cds::gc::DHP, item, traits > list;
- test_int<list>();
- }
- void IntrusiveLazyListHeaderTest::DHP_base_less()
- {
- typedef base_int_item< cds::gc::DHP > item;
- typedef ci::LazyList< cds::gc::DHP
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::DHP> > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_int<list>();
- }
- void IntrusiveLazyListHeaderTest::DHP_base_cmpmix()
- {
- typedef base_int_item< cds::gc::DHP > item;
- typedef ci::LazyList< cds::gc::DHP
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::DHP> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_int<list>();
- }
- void IntrusiveLazyListHeaderTest::DHP_base_ic()
- {
- typedef base_int_item< cds::gc::DHP > item;
- typedef ci::LazyList< cds::gc::DHP
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::DHP> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_int<list>();
- }
- void IntrusiveLazyListHeaderTest::DHP_member_cmp()
- {
- typedef member_int_item< cds::gc::DHP > item;
- typedef ci::LazyList< cds::gc::DHP
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::DHP>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_int<list>();
- }
- void IntrusiveLazyListHeaderTest::DHP_member_less()
- {
- typedef member_int_item< cds::gc::DHP > item;
- typedef ci::LazyList< cds::gc::DHP
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::DHP>
- > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_int<list>();
- }
- void IntrusiveLazyListHeaderTest::DHP_member_cmpmix()
- {
- typedef member_int_item< cds::gc::DHP > item;
- typedef ci::LazyList< cds::gc::DHP
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::DHP>
- > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_int<list>();
- }
- void IntrusiveLazyListHeaderTest::DHP_member_ic()
- {
- typedef member_int_item< cds::gc::DHP > item;
- typedef ci::LazyList< cds::gc::DHP
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::DHP>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_int<list>();
- }
-
-} // namespace ordlist
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_intrusive_lazy.h"
-#include <cds/intrusive/lazy_list_hp.h>
-
-namespace ordlist {
- void IntrusiveLazyListHeaderTest::HP_base_cmp()
- {
- typedef base_int_item< cds::gc::HP > item;
- struct traits : public ci::lazy_list::traits
- {
- typedef ci::lazy_list::base_hook< co::gc<cds::gc::HP> > hook;
- typedef cmp<item> compare;
- typedef faked_disposer disposer;
- };
- typedef ci::LazyList< cds::gc::HP, item, traits > list;
- test_int<list>();
- }
- void IntrusiveLazyListHeaderTest::HP_base_less()
- {
- typedef base_int_item< cds::gc::HP > item;
- typedef ci::LazyList< cds::gc::HP
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::HP> > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_int<list>();
- }
- void IntrusiveLazyListHeaderTest::HP_base_cmpmix()
- {
- typedef base_int_item< cds::gc::HP > item;
- typedef ci::LazyList< cds::gc::HP
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::HP> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_int<list>();
- }
- void IntrusiveLazyListHeaderTest::HP_base_ic()
- {
- typedef base_int_item< cds::gc::HP > item;
- typedef ci::LazyList< cds::gc::HP
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::HP> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_int<list>();
- }
- void IntrusiveLazyListHeaderTest::HP_member_cmp()
- {
- typedef member_int_item< cds::gc::HP > item;
- typedef ci::LazyList< cds::gc::HP
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::HP>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_int<list>();
- }
- void IntrusiveLazyListHeaderTest::HP_member_less()
- {
- typedef member_int_item< cds::gc::HP > item;
- struct traits : public ci::lazy_list::traits
- {
- typedef ci::lazy_list::member_hook< offsetof( item, hMember ), co::gc<cds::gc::HP>> hook;
- typedef IntrusiveLazyListHeaderTest::less<item> less;
- typedef faked_disposer disposer;
- };
- typedef ci::LazyList< cds::gc::HP, item, traits > list;
- test_int<list>();
- }
- void IntrusiveLazyListHeaderTest::HP_member_cmpmix()
- {
- typedef member_int_item< cds::gc::HP > item;
- typedef ci::LazyList< cds::gc::HP
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::HP>
- > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_int<list>();
- }
- void IntrusiveLazyListHeaderTest::HP_member_ic()
- {
- typedef member_int_item< cds::gc::HP > item;
- typedef ci::LazyList< cds::gc::HP
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::HP>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_int<list>();
- }
-} // namespace ordlist
-
-CPPUNIT_TEST_SUITE_REGISTRATION(ordlist::IntrusiveLazyListHeaderTest);
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_intrusive_lazy.h"
-#include <cds/intrusive/lazy_list_nogc.h>
-
-namespace ordlist {
- void IntrusiveLazyListHeaderTest::nogc_base_cmp()
- {
- typedef base_int_item< cds::gc::nogc > item;
- struct traits : public ci::lazy_list::traits {
- typedef ci::lazy_list::base_hook< co::gc<cds::gc::nogc> > hook;
- typedef cmp<item> compare;
- typedef faked_disposer disposer;
- };
- typedef ci::LazyList< cds::gc::nogc, item, traits > list;
- test_nogc_int<list>();
- }
-
- void IntrusiveLazyListHeaderTest::nogc_base_less()
- {
- typedef base_int_item< cds::gc::nogc > item;
- struct traits: public
- ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::nogc> > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- {};
- typedef ci::LazyList< cds::gc::nogc, item, traits > list;
- test_nogc_int<list>();
- }
-
- void IntrusiveLazyListHeaderTest::nogc_base_cmpmix()
- {
- typedef base_int_item< cds::gc::nogc > item;
- typedef ci::LazyList< cds::gc::nogc
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::nogc> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_nogc_int<list>();
- }
-
- void IntrusiveLazyListHeaderTest::nogc_base_ic()
- {
- typedef base_int_item< cds::gc::nogc > item;
- typedef ci::LazyList< cds::gc::nogc
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::nogc> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_nogc_int<list>();
- }
-
- void IntrusiveLazyListHeaderTest::nogc_base_unord_equal()
- {
- typedef base_int_item< cds::gc::nogc > item;
- struct traits: public
- ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::nogc> > >
- ,co::sort< false >
- ,co::equal_to< equal<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- {};
- typedef ci::LazyList< cds::gc::nogc, item, traits > list;
- test_nogc_int<list>();
- }
-
- void IntrusiveLazyListHeaderTest::nogc_base_unord_cmp()
- {
- typedef base_int_item< cds::gc::nogc > item;
- struct traits: public
- ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::nogc> > >
- ,co::sort< false >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- {};
- typedef ci::LazyList< cds::gc::nogc, item, traits > list;
- test_nogc_int<list>();
- }
-
- void IntrusiveLazyListHeaderTest::nogc_base_unord_less()
- {
- typedef base_int_item< cds::gc::nogc > item;
- struct traits: public
- ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::nogc> > >
- ,co::sort< false >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- {};
- typedef ci::LazyList< cds::gc::nogc, item, traits > list;
- test_nogc_int<list>();
- }
-
- void IntrusiveLazyListHeaderTest::nogc_member_cmp()
- {
- typedef member_int_item< cds::gc::nogc > item;
- typedef ci::LazyList< cds::gc::nogc
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::nogc>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_nogc_int<list>();
- }
-
- void IntrusiveLazyListHeaderTest::nogc_member_less()
- {
- typedef member_int_item< cds::gc::nogc > item;
- typedef ci::LazyList< cds::gc::nogc
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::nogc>
- > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_nogc_int<list>();
- }
-
- void IntrusiveLazyListHeaderTest::nogc_member_cmpmix()
- {
- typedef member_int_item< cds::gc::nogc > item;
- typedef ci::LazyList< cds::gc::nogc
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::nogc>
- > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_nogc_int<list>();
- }
-
- void IntrusiveLazyListHeaderTest::nogc_member_ic()
- {
- typedef member_int_item< cds::gc::nogc > item;
- typedef ci::LazyList< cds::gc::nogc
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::nogc>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_nogc_int<list>();
- }
-
- void IntrusiveLazyListHeaderTest::nogc_member_unord_equal()
- {
- typedef member_int_item< cds::gc::nogc > item;
- typedef ci::LazyList< cds::gc::nogc
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::nogc>
- > >
- ,co::sort< false >
- ,co::equal_to< equal<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_nogc_int<list>();
- }
-
- void IntrusiveLazyListHeaderTest::nogc_member_unord_cmp()
- {
- typedef member_int_item< cds::gc::nogc > item;
- typedef ci::LazyList< cds::gc::nogc
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::nogc>
- > >
- ,co::sort< false >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_nogc_int<list>();
- }
-
- void IntrusiveLazyListHeaderTest::nogc_member_unord_less()
- {
- typedef member_int_item< cds::gc::nogc > item;
- typedef ci::LazyList< cds::gc::nogc
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::nogc>
- > >
- ,co::sort< false >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_nogc_int<list>();
- }
-
-} // namespace ordlist
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_intrusive_lazy.h"
-#include <cds/urcu/general_buffered.h>
-#include <cds/intrusive/lazy_list_rcu.h>
-
-namespace ordlist {
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_buffered<> > RCU;
- }
-
- void IntrusiveLazyListHeaderTest::RCU_GPB_base_cmp()
- {
- typedef base_int_item< RCU > item;
- typedef ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type list_traits;
- typedef ci::LazyList< RCU, item, list_traits > list;
-
- test_rcu_int<list>();
- }
- void IntrusiveLazyListHeaderTest::RCU_GPB_base_less()
- {
- typedef base_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveLazyListHeaderTest::RCU_GPB_base_cmpmix()
- {
- typedef base_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveLazyListHeaderTest::RCU_GPB_base_ic()
- {
- typedef base_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveLazyListHeaderTest::RCU_GPB_member_cmp()
- {
- typedef member_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveLazyListHeaderTest::RCU_GPB_member_less()
- {
- typedef member_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveLazyListHeaderTest::RCU_GPB_member_cmpmix()
- {
- typedef member_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveLazyListHeaderTest::RCU_GPB_member_ic()
- {
- typedef member_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_rcu_int<list>();
- }
-} // namespace ordlist
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_intrusive_lazy.h"
-#include <cds/urcu/general_instant.h>
-#include <cds/intrusive/lazy_list_rcu.h>
-
-namespace ordlist {
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_instant<> > RCU;
- }
-
- void IntrusiveLazyListHeaderTest::RCU_GPI_base_cmp()
- {
- typedef base_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveLazyListHeaderTest::RCU_GPI_base_less()
- {
- typedef base_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveLazyListHeaderTest::RCU_GPI_base_cmpmix()
- {
- typedef base_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveLazyListHeaderTest::RCU_GPI_base_ic()
- {
- typedef base_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveLazyListHeaderTest::RCU_GPI_member_cmp()
- {
- typedef member_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveLazyListHeaderTest::RCU_GPI_member_less()
- {
- typedef member_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveLazyListHeaderTest::RCU_GPI_member_cmpmix()
- {
- typedef member_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveLazyListHeaderTest::RCU_GPI_member_ic()
- {
- typedef member_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_rcu_int<list>();
- }
-} // namespace ordlist
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_intrusive_lazy.h"
-#include <cds/urcu/general_threaded.h>
-#include <cds/intrusive/lazy_list_rcu.h>
-
-namespace ordlist {
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_threaded<> > RCU;
- }
-
- void IntrusiveLazyListHeaderTest::RCU_GPT_base_cmp()
- {
- typedef base_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveLazyListHeaderTest::RCU_GPT_base_less()
- {
- typedef base_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveLazyListHeaderTest::RCU_GPT_base_cmpmix()
- {
- typedef base_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveLazyListHeaderTest::RCU_GPT_base_ic()
- {
- typedef base_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveLazyListHeaderTest::RCU_GPT_member_cmp()
- {
- typedef member_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveLazyListHeaderTest::RCU_GPT_member_less()
- {
- typedef member_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveLazyListHeaderTest::RCU_GPT_member_cmpmix()
- {
- typedef member_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveLazyListHeaderTest::RCU_GPT_member_ic()
- {
- typedef member_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_rcu_int<list>();
- }
-} // namespace ordlist
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_intrusive_lazy.h"
-#include <cds/urcu/signal_buffered.h>
-#include <cds/intrusive/lazy_list_rcu.h>
-
-namespace ordlist {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_buffered<> > RCU;
- }
-#endif
-
- void IntrusiveLazyListHeaderTest::RCU_SHB_base_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef base_int_item< RCU > item;
- typedef ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type list_traits;
- typedef ci::LazyList< RCU, item, list_traits > list;
-
- test_rcu_int<list>();
-#endif
- }
-
- void IntrusiveLazyListHeaderTest::RCU_SHB_base_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef base_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
-
- void IntrusiveLazyListHeaderTest::RCU_SHB_base_cmpmix()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef base_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
-
- void IntrusiveLazyListHeaderTest::RCU_SHB_base_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef base_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
-
- void IntrusiveLazyListHeaderTest::RCU_SHB_member_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef member_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
-
- void IntrusiveLazyListHeaderTest::RCU_SHB_member_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef member_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
-
- void IntrusiveLazyListHeaderTest::RCU_SHB_member_cmpmix()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef member_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
-
- void IntrusiveLazyListHeaderTest::RCU_SHB_member_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef member_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
-
-} // namespace ordlist
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_intrusive_lazy.h"
-#include <cds/urcu/signal_threaded.h>
-#include <cds/intrusive/lazy_list_rcu.h>
-
-namespace ordlist {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_threaded<> > RCU;
- }
-#endif
-
- void IntrusiveLazyListHeaderTest::RCU_SHT_base_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef base_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
- void IntrusiveLazyListHeaderTest::RCU_SHT_base_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef base_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
- void IntrusiveLazyListHeaderTest::RCU_SHT_base_cmpmix()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef base_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
- void IntrusiveLazyListHeaderTest::RCU_SHT_base_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef base_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
- void IntrusiveLazyListHeaderTest::RCU_SHT_member_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef member_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
- void IntrusiveLazyListHeaderTest::RCU_SHT_member_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef member_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
- void IntrusiveLazyListHeaderTest::RCU_SHT_member_cmpmix()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef member_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
- void IntrusiveLazyListHeaderTest::RCU_SHT_member_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef member_int_item< RCU > item;
- typedef ci::LazyList< RCU
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
-} // namespace ordlist
+++ /dev/null
-//$$CDS-header$$
-
-#ifndef CDSTEST_HDR_INTRUSIVE_MICHAEL_H
-#define CDSTEST_HDR_INTRUSIVE_MICHAEL_H
-
-#include "cppunit/cppunit_proxy.h"
-#include <cds/intrusive/details/michael_list_base.h>
-
-namespace ordlist {
- namespace ci = cds::intrusive;
- namespace co = cds::opt;
-
- class IntrusiveMichaelListHeaderTest: public CppUnitMini::TestCase
- {
- public:
-
- struct stat {
- int nDisposeCount;
- int nEnsureExistsCall;
- int nEnsureNewCall;
- int nFindCall;
- int nEraseCall;
-
- stat()
- : nDisposeCount(0)
- , nEnsureExistsCall(0)
- , nEnsureNewCall(0)
- , nFindCall(0)
- , nEraseCall(0)
- {}
-
- stat( const stat& s )
- {
- *this = s;
- }
-
- stat& operator =(const stat& s)
- {
- memcpy( this, &s, sizeof(s));
- return *this;
- }
- };
-
- template <typename GC>
- struct base_int_item: public ci::michael_list::node< GC >
- {
- int nKey;
- int nVal;
-
- mutable stat s;
-
- base_int_item()
- {}
-
- base_int_item(int key, int val)
- : nKey( key )
- , nVal(val)
- , s()
- {}
-
- base_int_item(const base_int_item& v )
- : nKey( v.nKey )
- , nVal( v.nVal )
- , s()
- {}
-
- const int& key() const
- {
- return nKey;
- }
- };
-
- template <typename GC>
- struct member_int_item
- {
- int nKey;
- int nVal;
-
- ci::michael_list::node< GC > hMember;
-
- mutable stat s;
-
- member_int_item()
- {}
-
- member_int_item(int key, int val)
- : nKey( key )
- , nVal(val)
- , s()
- {}
-
- member_int_item(const member_int_item& v )
- : nKey( v.nKey )
- , nVal( v.nVal )
- , s()
- {}
-
- const int& key() const
- {
- return nKey;
- }
- };
-
- template <typename T>
- struct less
- {
- bool operator ()(const T& v1, const T& v2 ) const
- {
- return v1.key() < v2.key();
- }
-
- template <typename Q>
- bool operator ()(const T& v1, const Q& v2 ) const
- {
- return v1.key() < v2;
- }
-
- template <typename Q>
- bool operator ()(const Q& v1, const T& v2 ) const
- {
- return v1 < v2.key();
- }
- };
-
- struct other_item {
- int nKey;
-
- other_item( int n )
- : nKey(n)
- {}
- };
-
- struct other_less {
- template <typename T, typename Q>
- bool operator()( T const& i1, Q const& i2) const
- {
- return i1.nKey < i2.nKey;
- }
- };
-
- template <typename T>
- struct cmp {
- int operator ()(const T& v1, const T& v2 ) const
- {
- if ( v1.key() < v2.key() )
- return -1;
- return v1.key() > v2.key() ? 1 : 0;
- }
-
- template <typename Q>
- int operator ()(const T& v1, const Q& v2 ) const
- {
- if ( v1.key() < v2 )
- return -1;
- return v1.key() > v2 ? 1 : 0;
- }
-
- template <typename Q>
- int operator ()(const Q& v1, const T& v2 ) const
- {
- if ( v1 < v2.key() )
- return -1;
- return v1 > v2.key() ? 1 : 0;
- }
- };
-
- struct faked_disposer
- {
- template <typename T>
- void operator ()( T * p )
- {
- ++p->s.nDisposeCount;
- }
- };
-
- struct ensure_functor
- {
- template <typename T>
- void operator ()(bool bNew, T& item, T& /*val*/ )
- {
- if ( bNew )
- ++item.s.nEnsureNewCall;
- else
- ++item.s.nEnsureExistsCall;
- }
- };
-
- struct find_functor
- {
- template <typename T, typename Q>
- void operator ()( T& item, Q& /*val*/ )
- {
- ++item.s.nFindCall;
- }
- };
-
- struct erase_functor
- {
- template <typename T>
- void operator()( T const& item )
- {
- item.s.nEraseCall++;
- }
- };
-
- template <class OrdList>
- void test_int_common()
- {
- typedef typename OrdList::value_type value_type;
-
- value_type v1( 10, 50 );
- value_type v2( 5, 25 );
- value_type v3( 20, 100 );
- {
- OrdList l;
- CPPUNIT_ASSERT( l.empty() );
-
- CPPUNIT_ASSERT( l.insert( v1 )) ; // true
- CPPUNIT_ASSERT( l.find( v1.key() ));
-
- CPPUNIT_ASSERT( v1.s.nFindCall == 0 );
- CPPUNIT_ASSERT( l.find( v1.key(), find_functor() ));
- CPPUNIT_ASSERT( v1.s.nFindCall == 1 );
-
- CPPUNIT_ASSERT( !l.find( v2.key() ));
- CPPUNIT_ASSERT( !l.find_with( v3.key(), less<value_type>() ));
- CPPUNIT_ASSERT( !l.empty() );
-
- CPPUNIT_ASSERT( !l.insert( v1 )) ; // assertion "is_empty" is not raised since pNext is nullptr
-
- {
- value_type v( v1 );
- CPPUNIT_ASSERT( !l.insert( v )) ; // false
- }
-
- std::pair<bool, bool> ret = l.ensure( v2, ensure_functor() );
- CPPUNIT_ASSERT( ret.first );
- CPPUNIT_ASSERT( ret.second );
- CPPUNIT_ASSERT( v2.s.nEnsureNewCall == 1 );
- CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == 0 );
-
- //CPPUNIT_ASSERT( !l.insert( v2 )) ; // assertion "is_empty"
-
- CPPUNIT_ASSERT( l.find_with( v1.key(), less<value_type>() )) ; // true
-
- CPPUNIT_ASSERT( v1.s.nFindCall == 1 );
- CPPUNIT_ASSERT( l.find_with( v1.key(), less<value_type>(), find_functor() ));
- CPPUNIT_ASSERT( v1.s.nFindCall == 2 );
-
- CPPUNIT_ASSERT( l.find( v2.key() ));
-
- CPPUNIT_ASSERT( v2.s.nFindCall == 0 );
- CPPUNIT_ASSERT( l.find( v2.key(), find_functor() ));
- CPPUNIT_ASSERT( v2.s.nFindCall == 1 );
-
- CPPUNIT_ASSERT( !l.find( v3.key() ));
-
- {
- CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == 0 );
- CPPUNIT_ASSERT( v2.s.nEnsureNewCall == 1 );
-
- value_type v( v2 );
- ret = l.ensure( v, ensure_functor() );
-
- CPPUNIT_ASSERT( ret.first );
- CPPUNIT_ASSERT( !ret.second );
- CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == 1 );
- CPPUNIT_ASSERT( v2.s.nEnsureNewCall == 1 );
- CPPUNIT_ASSERT( v.s.nEnsureExistsCall == 0 );
- CPPUNIT_ASSERT( v.s.nEnsureNewCall == 0 );
- }
-
- CPPUNIT_ASSERT( !l.empty() );
-
- CPPUNIT_ASSERT( l.insert( v3 )) ; // true
- CPPUNIT_ASSERT( l.find( v3.key() ));
-
- CPPUNIT_ASSERT( v3.s.nFindCall == 0 );
- CPPUNIT_ASSERT( l.find( v3.key(), find_functor() ));
- CPPUNIT_ASSERT( v3.s.nFindCall == 1 );
-
- CPPUNIT_ASSERT( l.unlink( v2 ) );
- CPPUNIT_ASSERT( l.find( v1.key() )) ; // true
- CPPUNIT_ASSERT( !l.find( v2.key() )) ; // true
- CPPUNIT_ASSERT( l.find( v3.key() )) ; // true
- CPPUNIT_ASSERT( !l.empty() );
- CPPUNIT_ASSERT( !l.unlink( v2 ) );
-
- {
- // v1 key is in the list but v NODE is not in the list
- value_type v( v1 );
- CPPUNIT_ASSERT( !l.unlink( v ) );
- }
-
- CPPUNIT_ASSERT( l.unlink( v1 ) );
- CPPUNIT_ASSERT( !l.unlink( v1 ) );
- CPPUNIT_ASSERT( !l.find( v1.key() ));
- CPPUNIT_ASSERT( !l.find( v2.key() ));
- CPPUNIT_ASSERT( l.find( v3.key() ));
- CPPUNIT_ASSERT( !l.empty() );
- CPPUNIT_ASSERT( !l.unlink( v1 ) );
- CPPUNIT_ASSERT( !l.unlink( v2 ) );
-
- CPPUNIT_ASSERT( l.unlink( v3 ) );
- CPPUNIT_ASSERT( !l.find_with( v1.key(), less<value_type>() ));
- CPPUNIT_ASSERT( !l.find_with( v2.key(), less<value_type>(), find_functor() ));
- CPPUNIT_ASSERT( !l.find( v3.key(), find_functor() ));
- CPPUNIT_ASSERT( l.empty() );
- CPPUNIT_ASSERT( !l.unlink( v1 ) );
- CPPUNIT_ASSERT( !l.unlink( v2 ) );
- CPPUNIT_ASSERT( !l.unlink( v3 ) );
-
- // Apply retired pointer to clean links
- OrdList::gc::force_dispose();
-
- stat s( v3.s );
- ret = l.ensure( v3, ensure_functor() );
- CPPUNIT_ASSERT( ret.first );
- CPPUNIT_ASSERT( ret.second );
- CPPUNIT_ASSERT( v3.s.nEnsureNewCall == s.nEnsureNewCall + 1);
- CPPUNIT_ASSERT( v3.s.nEnsureExistsCall == s.nEnsureExistsCall );
- CPPUNIT_ASSERT( !l.empty() );
-
- s = v2.s;
- ret = l.ensure( v2, ensure_functor() );
- CPPUNIT_ASSERT( ret.first );
- CPPUNIT_ASSERT( ret.second );
- CPPUNIT_ASSERT( v2.s.nEnsureNewCall == s.nEnsureNewCall + 1);
- CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == s.nEnsureExistsCall );
- CPPUNIT_ASSERT( !l.empty() );
-
- s = v1.s;
- ret = l.ensure( v1, ensure_functor() );
- CPPUNIT_ASSERT( ret.first );
- CPPUNIT_ASSERT( ret.second );
- CPPUNIT_ASSERT( v1.s.nEnsureNewCall == s.nEnsureNewCall + 1);
- CPPUNIT_ASSERT( v1.s.nEnsureExistsCall == s.nEnsureExistsCall );
- CPPUNIT_ASSERT( !l.empty() );
-
- // Erase test
- CPPUNIT_ASSERT( v1.s.nEraseCall == 0 );
- CPPUNIT_ASSERT( l.erase( v1.key(), erase_functor()) );
- CPPUNIT_ASSERT( v1.s.nEraseCall == 1 );
- //CPPUNIT_ASSERT( v1.s.nDisposeCount == 0 );
- CPPUNIT_ASSERT( !l.empty() );
-
- CPPUNIT_ASSERT( l.erase_with( v2.key(), less<value_type>() ) );
- CPPUNIT_ASSERT( !l.erase( v2.key()));
- //CPPUNIT_ASSERT( v2.s.nDisposeCount == 0 );
- CPPUNIT_ASSERT( !l.empty() );
-
- CPPUNIT_ASSERT( v2.s.nEraseCall == 0 );
- CPPUNIT_ASSERT( !l.erase( v2, erase_functor() ));
- CPPUNIT_ASSERT( v2.s.nEraseCall == 0 );
- CPPUNIT_ASSERT( !l.erase( v1 ));
- //CPPUNIT_ASSERT( v2.s.nDisposeCount == 0 );
- CPPUNIT_ASSERT( !l.empty() );
-
- CPPUNIT_ASSERT( v3.s.nEraseCall == 0 );
- CPPUNIT_ASSERT( l.erase_with( v3, less<value_type>(), erase_functor() ));
- CPPUNIT_ASSERT( v3.s.nEraseCall == 1 );
- //CPPUNIT_ASSERT( v3.s.nDisposeCount == 0 );
- CPPUNIT_ASSERT( l.empty() );
-
- // Apply retired pointer to clean links
- OrdList::gc::force_dispose();
-
- // Unlink test
- CPPUNIT_ASSERT( l.insert( v1 ));
- CPPUNIT_ASSERT( l.insert( v3 ));
- CPPUNIT_ASSERT( !l.empty() );
- CPPUNIT_ASSERT( !l.unlink( v2 ));
- CPPUNIT_ASSERT( l.unlink( v1 ));
- CPPUNIT_ASSERT( !l.unlink( v1 ));
- CPPUNIT_ASSERT( l.unlink( v3 ));
- CPPUNIT_ASSERT( !l.unlink( v3 ));
- CPPUNIT_ASSERT( l.empty() );
-
- // Apply retired pointer
- OrdList::gc::force_dispose();
- CPPUNIT_ASSERT( v1.s.nDisposeCount == 3 );
- CPPUNIT_ASSERT( v2.s.nDisposeCount == 2 );
- CPPUNIT_ASSERT( v3.s.nDisposeCount == 3 );
-
- // Destructor test (call disposer)
- CPPUNIT_ASSERT( l.insert( v1 ));
- CPPUNIT_ASSERT( l.insert( v3 ));
- CPPUNIT_ASSERT( l.insert( v2 ));
-
- // Iterator test
- // begin/end
- {
- typename OrdList::iterator it = l.begin();
- typename OrdList::const_iterator cit = l.cbegin();
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it != l.cend() );
- CPPUNIT_ASSERT( cit != l.end() );
- CPPUNIT_ASSERT( cit != l.cend() );
- CPPUNIT_ASSERT( cit == it );
-
- CPPUNIT_ASSERT( it->nKey == v2.nKey );
- CPPUNIT_ASSERT( it->nVal == v2.nVal );
- CPPUNIT_ASSERT( ++it != l.end() );
- CPPUNIT_ASSERT( it->nKey == v1.nKey );
- CPPUNIT_ASSERT( it->nVal == v1.nVal );
- CPPUNIT_ASSERT( ++it != l.end() );
- CPPUNIT_ASSERT( it->nKey == v3.nKey );
- CPPUNIT_ASSERT( it->nVal == v3.nVal );
- CPPUNIT_ASSERT( ++it == l.end() );
- }
-
- // cbegin/cend
- {
- typename OrdList::const_iterator it = l.cbegin();
- CPPUNIT_ASSERT( it != l.cend() );
- CPPUNIT_ASSERT( it->nKey == v2.nKey );
- CPPUNIT_ASSERT( it->nVal == v2.nVal );
- CPPUNIT_ASSERT( ++it != l.cend() );
- CPPUNIT_ASSERT( it->nKey == v1.nKey );
- CPPUNIT_ASSERT( it->nVal == v1.nVal );
- CPPUNIT_ASSERT( ++it != l.cend() );
- CPPUNIT_ASSERT( it->nKey == v3.nKey );
- CPPUNIT_ASSERT( it->nVal == v3.nVal );
- CPPUNIT_ASSERT( ++it == l.cend() );
- }
-
- // const begin/end
- {
- OrdList const & lref = l;
- typename OrdList::const_iterator it = lref.begin();
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it->nKey == v2.nKey );
- CPPUNIT_ASSERT( it->nVal == v2.nVal );
- CPPUNIT_ASSERT( ++it != lref.end() );
- CPPUNIT_ASSERT( it->nKey == v1.nKey );
- CPPUNIT_ASSERT( it->nVal == v1.nVal );
- CPPUNIT_ASSERT( ++it != l.end() );
- CPPUNIT_ASSERT( it->nKey == v3.nKey );
- CPPUNIT_ASSERT( it->nVal == v3.nVal );
- CPPUNIT_ASSERT( ++it == l.end() );
- }
- }
-
- // Apply retired pointer
- OrdList::gc::force_dispose();
-
- CPPUNIT_ASSERT( v1.s.nDisposeCount == 4 );
- CPPUNIT_ASSERT( v2.s.nDisposeCount == 3 );
- CPPUNIT_ASSERT( v3.s.nDisposeCount == 4 );
- }
-
- template <class OrdList>
- void test_int()
- {
- test_int_common<OrdList>();
-
- OrdList l;
- typename OrdList::guarded_ptr gp;
-
- static int const nLimit = 20;
- typename OrdList::value_type arrItem[nLimit];
-
- {
- int a[nLimit];
- for (int i = 0; i < nLimit; ++i)
- a[i]=i;
- std::random_shuffle( a, a + nLimit );
-
- for (int i = 0; i < nLimit; ++i) {
- arrItem[i].nKey = a[i];
- arrItem[i].nVal = a[i] * 2;
- }
-
- // extract/get
- for ( int i = 0; i < nLimit; ++i )
- CPPUNIT_ASSERT( l.insert( arrItem[i] ) );
-
- for ( int i=0; i < nLimit; ++i ) {
- gp = l.get( arrItem[i].nKey );
- CPPUNIT_ASSERT_EX( gp, "i=" << i );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->nKey == arrItem[i].nKey );
- CPPUNIT_CHECK( gp->nVal == arrItem[i].nVal );
- gp.release();
-
- gp = l.extract( arrItem[i].nKey );
- CPPUNIT_ASSERT_EX( gp, "i=" << i );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->nKey == arrItem[i].nKey );
- CPPUNIT_CHECK( gp->nVal == arrItem[i].nVal );
- gp.release();
-
- gp = l.get( arrItem[i].nKey );
- CPPUNIT_CHECK( !gp );
- CPPUNIT_CHECK( gp.empty());
- CPPUNIT_CHECK( !l.extract( arrItem[i].nKey ));
- CPPUNIT_CHECK( gp.empty());
- }
- CPPUNIT_ASSERT( l.empty() );
- CPPUNIT_ASSERT( !l.get( nLimit/2 ));
- CPPUNIT_ASSERT( gp.empty());
- CPPUNIT_ASSERT( !l.extract( nLimit/2 ));
- CPPUNIT_ASSERT( gp.empty());
-
- // Apply retired pointer
- OrdList::gc::force_dispose();
-
- // extract_with/get_with
- for ( int i = 0; i < nLimit; ++i )
- CPPUNIT_ASSERT( l.insert( arrItem[i] ) );
-
- for ( int i=0; i < nLimit; ++i ) {
- other_item itm( arrItem[i].nKey );
- gp = l.get_with( itm, other_less() );
- CPPUNIT_ASSERT_EX( gp, "i=" << i );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->nKey == arrItem[i].nKey );
- CPPUNIT_CHECK( gp->nVal == arrItem[i].nVal );
- gp.release();
-
- gp = l.extract_with( itm, other_less() );
- CPPUNIT_ASSERT_EX( gp, "i=" << i );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->nKey == arrItem[i].nKey );
- CPPUNIT_CHECK( gp->nVal == arrItem[i].nVal );
- gp.release();
-
- gp = l.get_with( itm, other_less() );
- CPPUNIT_CHECK( !gp );
- CPPUNIT_CHECK( gp.empty());
- CPPUNIT_CHECK( !l.extract_with( itm, other_less() ));
- CPPUNIT_CHECK( gp.empty());
- }
- CPPUNIT_ASSERT( l.empty() );
- CPPUNIT_ASSERT( !l.get_with( other_item(nLimit/2), other_less() ));
- CPPUNIT_ASSERT( gp.empty());
- CPPUNIT_ASSERT( !l.extract_with( other_item(nLimit/2), other_less() ));
- CPPUNIT_ASSERT( gp.empty());
-
- // Apply retired pointer
- OrdList::gc::force_dispose();
-
- for ( int i=0; i < nLimit; i++ ) {
- CPPUNIT_ASSERT( arrItem[i].s.nDisposeCount == 2 );
- }
- }
- }
-
- template <class OrdList>
- void test_rcu_int()
- {
- test_int_common<OrdList>();
-
- OrdList l;
- static int const nLimit = 20;
- typename OrdList::value_type arrItem[nLimit];
-
- typedef typename OrdList::rcu_lock rcu_lock;
- typedef typename OrdList::value_type value_type;
- typedef typename OrdList::gc rcu_type;
-
- {
- int a[nLimit];
- for (int i = 0; i < nLimit; ++i)
- a[i]=i;
- std::random_shuffle( a, a + nLimit );
-
- for (int i = 0; i < nLimit; ++i) {
- arrItem[i].nKey = a[i];
- arrItem[i].nVal = a[i] * 2;
- }
-
- // extract/get
- for ( int i = 0; i < nLimit; ++i )
- CPPUNIT_ASSERT( l.insert( arrItem[i] ) );
-
- typename OrdList::exempt_ptr ep;
-
- for ( int i = 0; i < nLimit; ++i ) {
- {
- rcu_lock lock;
- value_type * pGet = l.get( a[i] );
- CPPUNIT_ASSERT( pGet != nullptr );
- CPPUNIT_CHECK( pGet->nKey == a[i] );
- CPPUNIT_CHECK( pGet->nVal == a[i] * 2 );
- }
-
- {
- rcu_lock lock;
- ep = l.extract( a[i] );
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty() );
- CPPUNIT_CHECK( ep->nKey == a[i] );
- CPPUNIT_CHECK( (*ep).nVal == a[i] * 2 );
- }
- ep.release();
-
- {
- rcu_lock lock;
- CPPUNIT_CHECK( l.get( a[i] ) == nullptr );
- CPPUNIT_CHECK( !l.extract( a[i] ));
- CPPUNIT_CHECK( ep.empty() );
- }
- }
- CPPUNIT_ASSERT( l.empty() );
-
- {
- rcu_lock lock;
- CPPUNIT_CHECK( l.get( a[0] ) == nullptr );
- ep = l.extract( a[0] );
- CPPUNIT_CHECK( !ep );
- CPPUNIT_CHECK( ep.empty() );
- }
- // Apply retired pointer
- OrdList::gc::force_dispose();
-
- // extract_with/get_with
- for ( int i = 0; i < nLimit; ++i ) {
- CPPUNIT_ASSERT( l.insert( arrItem[i] ) );
- }
-
- for ( int i = 0; i < nLimit; ++i ) {
- other_item itm( a[i] );
- {
- rcu_lock lock;
- value_type * pGet = l.get_with( itm, other_less() );
- CPPUNIT_ASSERT( pGet != nullptr );
- CPPUNIT_CHECK( pGet->nKey == a[i] );
- CPPUNIT_CHECK( pGet->nVal == a[i] * 2 );
- }
-
- {
- rcu_lock lock;
- ep = l.extract_with( itm, other_less() );
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty() );
- CPPUNIT_CHECK( ep->nKey == a[i] );
- CPPUNIT_CHECK( ep->nVal == a[i] * 2 );
- }
- ep.release();
-
- {
- rcu_lock lock;
- CPPUNIT_CHECK( l.get_with( itm, other_less() ) == nullptr );
- ep = l.extract_with( itm, other_less() );
- CPPUNIT_CHECK( !ep );
- CPPUNIT_CHECK( ep.empty() );
- }
- }
- CPPUNIT_ASSERT( l.empty() );
-
- {
- rcu_lock lock;
- CPPUNIT_CHECK( l.get_with( other_item( 0 ), other_less() ) == nullptr );
- CPPUNIT_CHECK( !l.extract_with( other_item(0), other_less() ));
- CPPUNIT_CHECK( ep.empty() );
- }
- // Apply retired pointer
- OrdList::gc::force_dispose();
- }
- }
-
- template <class OrdList>
- void test_nogc_int()
- {
- typedef typename OrdList::value_type value_type;
- {
- value_type v1( 10, 50 );
- value_type v2( 5, 25 );
- value_type v3( 20, 100 );
- {
- OrdList l;
- CPPUNIT_ASSERT( l.empty() );
-
- CPPUNIT_ASSERT( l.insert( v1 )) ; // true
- CPPUNIT_ASSERT( l.find( v1.key() ) == &v1 );
-
- CPPUNIT_ASSERT( v1.s.nFindCall == 0 );
- CPPUNIT_ASSERT( l.find( v1.key(), find_functor() ));
- CPPUNIT_ASSERT( v1.s.nFindCall == 1 );
-
- CPPUNIT_ASSERT( l.find_with( v2.key(), less<value_type>() ) == nullptr );
- CPPUNIT_ASSERT( !l.find_with( v3.key(), less<value_type>(), find_functor() ));
- CPPUNIT_ASSERT( !l.empty() );
-
- CPPUNIT_ASSERT( !l.insert( v1 )) ; // assertion "is_empty" is not raised since pNext is nullptr
-
- {
- value_type v( v1 );
- CPPUNIT_ASSERT( !l.insert( v )) ; // false
- }
-
- std::pair<bool, bool> ret = l.ensure( v2, ensure_functor() );
- CPPUNIT_ASSERT( ret.first );
- CPPUNIT_ASSERT( ret.second );
- CPPUNIT_ASSERT( v2.s.nEnsureNewCall == 1 );
- CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == 0 );
-
- //CPPUNIT_ASSERT( !l.insert( v2 )) ; // assertion "is_empty"
-
- CPPUNIT_ASSERT( l.find( v1.key() ) == &v1 ) ; // true
-
- CPPUNIT_ASSERT( v1.s.nFindCall == 1 );
- CPPUNIT_ASSERT( l.find( v1.key(), find_functor() ));
- CPPUNIT_ASSERT( v1.s.nFindCall == 2 );
-
- CPPUNIT_ASSERT( l.find( v2.key() ) == &v2 );
-
- CPPUNIT_ASSERT( v2.s.nFindCall == 0 );
- CPPUNIT_ASSERT( l.find( v2.key(), find_functor() ));
- CPPUNIT_ASSERT( v2.s.nFindCall == 1 );
-
- CPPUNIT_ASSERT( !l.find( v3.key() ));
-
- {
- value_type v( v2 );
- ret = l.ensure( v, ensure_functor() );
-
- CPPUNIT_ASSERT( ret.first );
- CPPUNIT_ASSERT( !ret.second );
- CPPUNIT_ASSERT( v2.s.nEnsureExistsCall == 1 );
- CPPUNIT_ASSERT( v.s.nEnsureExistsCall == 0 && v.s.nEnsureNewCall == 0 );
- }
-
- CPPUNIT_ASSERT( !l.empty() );
-
- CPPUNIT_ASSERT( l.insert( v3 )) ; // true
- CPPUNIT_ASSERT( l.find( v3.key() ) == &v3 );
-
- CPPUNIT_ASSERT( v3.s.nFindCall == 0 );
- CPPUNIT_ASSERT( l.find( v3.key(), find_functor() ));
- CPPUNIT_ASSERT( v3.s.nFindCall == 1 );
-
- {
- typename OrdList::iterator it = l.begin();
- typename OrdList::const_iterator cit = l.cbegin();
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it != l.cend() );
- CPPUNIT_ASSERT( cit != l.end() );
- CPPUNIT_ASSERT( cit != l.cend() );
- CPPUNIT_ASSERT( cit == it );
-
- CPPUNIT_ASSERT( it->nKey == v2.nKey );
- CPPUNIT_ASSERT( it->nVal == v2.nVal );
- CPPUNIT_ASSERT( ++it != l.end() );
- CPPUNIT_ASSERT( it->nKey == v1.nKey );
- CPPUNIT_ASSERT( it->nVal == v1.nVal );
- CPPUNIT_ASSERT( it++ != l.end() );
- CPPUNIT_ASSERT( it->nKey == v3.nKey );
- CPPUNIT_ASSERT( it->nVal == v3.nVal );
- CPPUNIT_ASSERT( it++ != l.end() );
- CPPUNIT_ASSERT( it == l.end() );
- }
-
- {
- OrdList const & lref = l;
- typename OrdList::const_iterator it = lref.begin();
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it->nKey == v2.nKey );
- CPPUNIT_ASSERT( it->nVal == v2.nVal );
- CPPUNIT_ASSERT( ++it != lref.end() );
- CPPUNIT_ASSERT( it->nKey == v1.nKey );
- CPPUNIT_ASSERT( it->nVal == v1.nVal );
- CPPUNIT_ASSERT( it++ != l.end() );
- CPPUNIT_ASSERT( it->nKey == v3.nKey );
- CPPUNIT_ASSERT( it->nVal == v3.nVal );
- CPPUNIT_ASSERT( it++ != lref.end() );
- CPPUNIT_ASSERT( it == l.end() );
- }
- }
-
- // Disposer called on list destruction
- CPPUNIT_ASSERT( v1.s.nDisposeCount == 1 );
- CPPUNIT_ASSERT( v2.s.nDisposeCount == 1 );
- CPPUNIT_ASSERT( v3.s.nDisposeCount == 1 );
- }
- }
-
- void HP_base_cmp();
- void HP_base_less();
- void HP_base_cmpmix();
- void HP_base_ic();
- void HP_member_cmp();
- void HP_member_less();
- void HP_member_cmpmix();
- void HP_member_ic();
-
- void DHP_base_cmp();
- void DHP_base_less();
- void DHP_base_cmpmix();
- void DHP_base_ic();
- void DHP_member_cmp();
- void DHP_member_less();
- void DHP_member_cmpmix();
- void DHP_member_ic();
-
- void RCU_GPI_base_cmp();
- void RCU_GPI_base_less();
- void RCU_GPI_base_cmpmix();
- void RCU_GPI_base_ic();
- void RCU_GPI_member_cmp();
- void RCU_GPI_member_less();
- void RCU_GPI_member_cmpmix();
- void RCU_GPI_member_ic();
-
- void RCU_GPB_base_cmp();
- void RCU_GPB_base_less();
- void RCU_GPB_base_cmpmix();
- void RCU_GPB_base_ic();
- void RCU_GPB_member_cmp();
- void RCU_GPB_member_less();
- void RCU_GPB_member_cmpmix();
- void RCU_GPB_member_ic();
-
- void RCU_GPT_base_cmp();
- void RCU_GPT_base_less();
- void RCU_GPT_base_cmpmix();
- void RCU_GPT_base_ic();
- void RCU_GPT_member_cmp();
- void RCU_GPT_member_less();
- void RCU_GPT_member_cmpmix();
- void RCU_GPT_member_ic();
-
- void RCU_SHB_base_cmp();
- void RCU_SHB_base_less();
- void RCU_SHB_base_cmpmix();
- void RCU_SHB_base_ic();
- void RCU_SHB_member_cmp();
- void RCU_SHB_member_less();
- void RCU_SHB_member_cmpmix();
- void RCU_SHB_member_ic();
-
- void RCU_SHT_base_cmp();
- void RCU_SHT_base_less();
- void RCU_SHT_base_cmpmix();
- void RCU_SHT_base_ic();
- void RCU_SHT_member_cmp();
- void RCU_SHT_member_less();
- void RCU_SHT_member_cmpmix();
- void RCU_SHT_member_ic();
-
- void nogc_base_cmp();
- void nogc_base_less();
- void nogc_base_cmpmix();
- void nogc_base_ic();
- void nogc_member_cmp();
- void nogc_member_less();
- void nogc_member_cmpmix();
- void nogc_member_ic();
-
-
- CPPUNIT_TEST_SUITE(IntrusiveMichaelListHeaderTest)
- CPPUNIT_TEST(HP_base_cmp)
- CPPUNIT_TEST(HP_base_less)
- CPPUNIT_TEST(HP_base_cmpmix)
- CPPUNIT_TEST(HP_base_ic)
- CPPUNIT_TEST(HP_member_cmp)
- CPPUNIT_TEST(HP_member_less)
- CPPUNIT_TEST(HP_member_cmpmix)
- CPPUNIT_TEST(HP_member_ic)
-
- CPPUNIT_TEST(DHP_base_cmp)
- CPPUNIT_TEST(DHP_base_less)
- CPPUNIT_TEST(DHP_base_cmpmix)
- CPPUNIT_TEST(DHP_base_ic)
- CPPUNIT_TEST(DHP_member_cmp)
- CPPUNIT_TEST(DHP_member_less)
- CPPUNIT_TEST(DHP_member_cmpmix)
- CPPUNIT_TEST(DHP_member_ic)
-
- CPPUNIT_TEST(RCU_GPI_base_cmp)
- CPPUNIT_TEST(RCU_GPI_base_less)
- CPPUNIT_TEST(RCU_GPI_base_cmpmix)
- CPPUNIT_TEST(RCU_GPI_base_ic)
- CPPUNIT_TEST(RCU_GPI_member_cmp)
- CPPUNIT_TEST(RCU_GPI_member_less)
- CPPUNIT_TEST(RCU_GPI_member_cmpmix)
- CPPUNIT_TEST(RCU_GPI_member_ic)
-
- CPPUNIT_TEST(RCU_GPB_base_cmp)
- CPPUNIT_TEST(RCU_GPB_base_less)
- CPPUNIT_TEST(RCU_GPB_base_cmpmix)
- CPPUNIT_TEST(RCU_GPB_base_ic)
- CPPUNIT_TEST(RCU_GPB_member_cmp)
- CPPUNIT_TEST(RCU_GPB_member_less)
- CPPUNIT_TEST(RCU_GPB_member_cmpmix)
- CPPUNIT_TEST(RCU_GPB_member_ic)
-
- CPPUNIT_TEST(RCU_GPT_base_cmp)
- CPPUNIT_TEST(RCU_GPT_base_less)
- CPPUNIT_TEST(RCU_GPT_base_cmpmix)
- CPPUNIT_TEST(RCU_GPT_base_ic)
- CPPUNIT_TEST(RCU_GPT_member_cmp)
- CPPUNIT_TEST(RCU_GPT_member_less)
- CPPUNIT_TEST(RCU_GPT_member_cmpmix)
- CPPUNIT_TEST(RCU_GPT_member_ic)
-
- CPPUNIT_TEST(nogc_base_cmp)
- CPPUNIT_TEST(nogc_base_less)
- CPPUNIT_TEST(nogc_base_cmpmix)
- CPPUNIT_TEST(nogc_base_ic)
- CPPUNIT_TEST(nogc_member_cmp)
- CPPUNIT_TEST(nogc_member_less)
- CPPUNIT_TEST(nogc_member_cmpmix)
- CPPUNIT_TEST(nogc_member_ic)
-
- CPPUNIT_TEST_SUITE_END()
- };
-} // namespace ordlist
-
-#endif // CDSTEST_HDR_INTRUSIVE_MICHAEL_H
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_intrusive_michael.h"
-#include <cds/intrusive/michael_list_dhp.h>
-
-namespace ordlist {
- void IntrusiveMichaelListHeaderTest::DHP_base_cmp()
- {
- typedef base_int_item< cds::gc::DHP > item;
- struct traits : public ci::michael_list::traits {
- typedef ci::michael_list::base_hook< co::gc<cds::gc::DHP> > hook;
- typedef cmp<item> compare;
- typedef faked_disposer disposer;
- };
- typedef ci::MichaelList< cds::gc::DHP, item, traits > list;
- test_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::DHP_base_less()
- {
- typedef base_int_item< cds::gc::DHP > item;
- typedef ci::MichaelList< cds::gc::DHP
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::DHP> > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::DHP_base_cmpmix()
- {
- typedef base_int_item< cds::gc::DHP > item;
- typedef ci::MichaelList< cds::gc::DHP
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::DHP> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::DHP_base_ic()
- {
- typedef base_int_item< cds::gc::DHP > item;
- typedef ci::MichaelList< cds::gc::DHP
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::DHP> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::DHP_member_cmp()
- {
- typedef member_int_item< cds::gc::DHP > item;
- typedef ci::MichaelList< cds::gc::DHP
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::DHP>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::DHP_member_less()
- {
- typedef member_int_item< cds::gc::DHP > item;
- typedef ci::MichaelList< cds::gc::DHP
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::DHP>
- > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::DHP_member_cmpmix()
- {
- typedef member_int_item< cds::gc::DHP > item;
- typedef ci::MichaelList< cds::gc::DHP
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::DHP>
- > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::DHP_member_ic()
- {
- typedef member_int_item< cds::gc::DHP > item;
- typedef ci::MichaelList< cds::gc::DHP
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::DHP>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_int<list>();
- }
-
-} // namespace ordlist
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_intrusive_michael.h"
-#include <cds/intrusive/michael_list_hp.h>
-
-namespace ordlist {
- void IntrusiveMichaelListHeaderTest::HP_base_cmp()
- {
- typedef base_int_item< cds::gc::HP > item;
- struct traits : public ci::michael_list::traits {
- typedef ci::michael_list::base_hook< co::gc<cds::gc::HP> > hook;
- typedef cmp<item> compare;
- typedef faked_disposer disposer;
- };
- typedef ci::MichaelList< cds::gc::HP, item, traits > list;
- test_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::HP_base_less()
- {
- typedef base_int_item< cds::gc::HP > item;
- typedef ci::MichaelList< cds::gc::HP
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::HP> > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::HP_base_cmpmix()
- {
- typedef base_int_item< cds::gc::HP > item;
- typedef ci::MichaelList< cds::gc::HP
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::HP> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::HP_base_ic()
- {
- typedef base_int_item< cds::gc::HP > item;
- typedef ci::MichaelList< cds::gc::HP
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::HP> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::HP_member_cmp()
- {
- typedef member_int_item< cds::gc::HP > item;
- typedef ci::MichaelList< cds::gc::HP
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::HP>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::HP_member_less()
- {
- typedef member_int_item< cds::gc::HP > item;
- typedef ci::MichaelList< cds::gc::HP
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::HP>
- > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::HP_member_cmpmix()
- {
- typedef member_int_item< cds::gc::HP > item;
- typedef ci::MichaelList< cds::gc::HP
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::HP>
- > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::HP_member_ic()
- {
- typedef member_int_item< cds::gc::HP > item;
- typedef ci::MichaelList< cds::gc::HP
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::HP>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_int<list>();
- }
-} // namespace ordlist
-
-CPPUNIT_TEST_SUITE_REGISTRATION(ordlist::IntrusiveMichaelListHeaderTest);
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_intrusive_michael.h"
-#include <cds/urcu/general_buffered.h>
-#include <cds/intrusive/michael_list_rcu.h>
-
-namespace ordlist {
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_buffered<> > RCU;
- }
-
- void IntrusiveMichaelListHeaderTest::RCU_GPB_base_cmp()
- {
- typedef base_int_item< RCU > item;
- struct traits : public ci::michael_list::traits
- {
- typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
- typedef cmp<item> compare;
- typedef faked_disposer disposer;
- };
- typedef ci::MichaelList< RCU, item, traits > list;
- test_rcu_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::RCU_GPB_base_less()
- {
- typedef base_int_item< RCU > item;
- struct traits : public ci::michael_list::traits
- {
- typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
- typedef IntrusiveMichaelListHeaderTest::less<item> less;
- typedef faked_disposer disposer;
- };
- typedef ci::MichaelList< RCU, item, traits > list;
- test_rcu_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::RCU_GPB_base_cmpmix()
- {
- typedef base_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::RCU_GPB_base_ic()
- {
- typedef base_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::RCU_GPB_member_cmp()
- {
- typedef member_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::RCU_GPB_member_less()
- {
- typedef member_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::RCU_GPB_member_cmpmix()
- {
- typedef member_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::RCU_GPB_member_ic()
- {
- typedef member_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_rcu_int<list>();
- }
-
-}
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_intrusive_michael.h"
-#include <cds/urcu/general_instant.h>
-#include <cds/intrusive/michael_list_rcu.h>
-
-namespace ordlist {
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_instant<> > RCU;
- }
-
- void IntrusiveMichaelListHeaderTest::RCU_GPI_base_cmp()
- {
- typedef base_int_item< RCU > item;
- struct traits : public ci::michael_list::traits
- {
- typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
- typedef cmp<item> compare;
- typedef faked_disposer disposer;
- };
- typedef ci::MichaelList< RCU, item, traits > list;
- test_rcu_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::RCU_GPI_base_less()
- {
- typedef base_int_item< RCU > item;
- struct traits : public ci::michael_list::traits
- {
- typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
- typedef IntrusiveMichaelListHeaderTest::less<item> less;
- typedef faked_disposer disposer;
- };
- typedef ci::MichaelList< RCU, item, traits > list;
- test_rcu_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::RCU_GPI_base_cmpmix()
- {
- typedef base_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::RCU_GPI_base_ic()
- {
- typedef base_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::RCU_GPI_member_cmp()
- {
- typedef member_int_item< RCU > item;
- struct traits: public
- ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- {};
- typedef ci::MichaelList< RCU, item, traits > list;
- test_rcu_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::RCU_GPI_member_less()
- {
- typedef member_int_item< RCU > item;
- struct traits: public
- ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- {};
- typedef ci::MichaelList< RCU, item, traits > list;
- test_rcu_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::RCU_GPI_member_cmpmix()
- {
- typedef member_int_item< RCU > item;
- struct traits: public
- ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- {};
- typedef ci::MichaelList< RCU, item, traits > list;
- test_rcu_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::RCU_GPI_member_ic()
- {
- typedef member_int_item< RCU > item;
- struct traits: public
- ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- {};
- typedef ci::MichaelList< RCU, item, traits > list;
- test_rcu_int<list>();
- }
-} // namespace ordlist
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_intrusive_michael.h"
-#include <cds/urcu/general_threaded.h>
-#include <cds/intrusive/michael_list_rcu.h>
-
-namespace ordlist {
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_threaded<> > RCU;
- }
-
- void IntrusiveMichaelListHeaderTest::RCU_GPT_base_cmp()
- {
- typedef base_int_item< RCU > item;
- struct traits : public ci::michael_list::traits
- {
- typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
- typedef cmp<item> compare;
- typedef faked_disposer disposer;
- };
- typedef ci::MichaelList< RCU, item, traits > list;
- test_rcu_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::RCU_GPT_base_less()
- {
- typedef base_int_item< RCU > item;
- struct traits : public ci::michael_list::traits
- {
- typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
- typedef IntrusiveMichaelListHeaderTest::less<item> less;
- typedef faked_disposer disposer;
- };
- typedef ci::MichaelList< RCU, item, traits > list;
- test_rcu_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::RCU_GPT_base_cmpmix()
- {
- typedef base_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::RCU_GPT_base_ic()
- {
- typedef base_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::RCU_GPT_member_cmp()
- {
- typedef member_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::RCU_GPT_member_less()
- {
- typedef member_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::RCU_GPT_member_cmpmix()
- {
- typedef member_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::RCU_GPT_member_ic()
- {
- typedef member_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_rcu_int<list>();
- }
-
-}
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_intrusive_michael.h"
-#include <cds/urcu/signal_buffered.h>
-#include <cds/intrusive/michael_list_rcu.h>
-
-namespace ordlist {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_buffered<> > RCU;
- }
-#endif
-
- void IntrusiveMichaelListHeaderTest::RCU_SHB_base_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef base_int_item< RCU > item;
- struct traits : public ci::michael_list::traits
- {
- typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
- typedef cmp<item> compare;
- typedef faked_disposer disposer;
- };
- typedef ci::MichaelList< RCU, item, traits > list;
- test_rcu_int<list>();
-#endif
- }
- void IntrusiveMichaelListHeaderTest::RCU_SHB_base_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef base_int_item< RCU > item;
- struct traits : public ci::michael_list::traits
- {
- typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
- typedef IntrusiveMichaelListHeaderTest::less<item> less;
- typedef faked_disposer disposer;
- };
- typedef ci::MichaelList< RCU, item, traits > list;
- test_rcu_int<list>();
-#endif
- }
- void IntrusiveMichaelListHeaderTest::RCU_SHB_base_cmpmix()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef base_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
- void IntrusiveMichaelListHeaderTest::RCU_SHB_base_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef base_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
- void IntrusiveMichaelListHeaderTest::RCU_SHB_member_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef member_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
- void IntrusiveMichaelListHeaderTest::RCU_SHB_member_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef member_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
- void IntrusiveMichaelListHeaderTest::RCU_SHB_member_cmpmix()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef member_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
- void IntrusiveMichaelListHeaderTest::RCU_SHB_member_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef member_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
-
-}
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_intrusive_michael.h"
-#include <cds/urcu/signal_threaded.h>
-#include <cds/intrusive/michael_list_rcu.h>
-
-namespace ordlist {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_threaded<> > RCU;
- }
-#endif
-
- void IntrusiveMichaelListHeaderTest::RCU_SHT_base_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef base_int_item< RCU > item;
- struct traits : public ci::michael_list::traits
- {
- typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
- typedef cmp<item> compare;
- typedef faked_disposer disposer;
- };
- typedef ci::MichaelList< RCU, item, traits > list;
- test_rcu_int<list>();
-#endif
- }
- void IntrusiveMichaelListHeaderTest::RCU_SHT_base_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef base_int_item< RCU > item;
- struct traits : public ci::michael_list::traits
- {
- typedef ci::michael_list::base_hook< co::gc<RCU> > hook;
- typedef IntrusiveMichaelListHeaderTest::less<item> less;
- typedef faked_disposer disposer;
- };
- typedef ci::MichaelList< RCU, item, traits > list;
- test_rcu_int<list>();
-#endif
- }
- void IntrusiveMichaelListHeaderTest::RCU_SHT_base_cmpmix()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef base_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
- void IntrusiveMichaelListHeaderTest::RCU_SHT_base_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef base_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::base_hook< co::gc<RCU> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
- void IntrusiveMichaelListHeaderTest::RCU_SHT_member_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef member_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
- void IntrusiveMichaelListHeaderTest::RCU_SHT_member_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef member_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
- void IntrusiveMichaelListHeaderTest::RCU_SHT_member_cmpmix()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef member_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
- void IntrusiveMichaelListHeaderTest::RCU_SHT_member_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef member_int_item< RCU > item;
- typedef ci::MichaelList< RCU
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<RCU>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_rcu_int<list>();
-#endif
- }
-
-}
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_intrusive_michael.h"
-#include <cds/intrusive/michael_list_nogc.h>
-
-namespace ordlist {
- void IntrusiveMichaelListHeaderTest::nogc_base_cmp()
- {
- typedef base_int_item< cds::gc::nogc > item;
- struct traits : public ci::michael_list::traits
- {
- typedef ci::michael_list::base_hook< co::gc<cds::gc::nogc> > hook;
- typedef cmp<item> compare;
- typedef faked_disposer disposer;
- };
- typedef ci::MichaelList< cds::gc::nogc, item, traits > list;
- test_nogc_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::nogc_base_less()
- {
- typedef base_int_item< cds::gc::nogc > item;
- struct traits : public ci::michael_list::traits
- {
- typedef ci::michael_list::base_hook< co::gc<cds::gc::nogc> > hook;
- typedef IntrusiveMichaelListHeaderTest::less<item> less;
- typedef faked_disposer disposer;
- };
- typedef ci::MichaelList< cds::gc::nogc, item, traits > list;
- test_nogc_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::nogc_base_cmpmix()
- {
- typedef base_int_item< cds::gc::nogc > item;
- typedef ci::MichaelList< cds::gc::nogc
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::nogc> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_nogc_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::nogc_base_ic()
- {
- typedef base_int_item< cds::gc::nogc > item;
- typedef ci::MichaelList< cds::gc::nogc
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::nogc> > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_nogc_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::nogc_member_cmp()
- {
- typedef member_int_item< cds::gc::nogc > item;
- typedef ci::MichaelList< cds::gc::nogc
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::nogc>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_nogc_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::nogc_member_less()
- {
- typedef member_int_item< cds::gc::nogc > item;
- typedef ci::MichaelList< cds::gc::nogc
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::nogc>
- > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_nogc_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::nogc_member_cmpmix()
- {
- typedef member_int_item< cds::gc::nogc > item;
- typedef ci::MichaelList< cds::gc::nogc
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::nogc>
- > >
- ,co::less< less<item> >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
- test_nogc_int<list>();
- }
- void IntrusiveMichaelListHeaderTest::nogc_member_ic()
- {
- typedef member_int_item< cds::gc::nogc > item;
- typedef ci::MichaelList< cds::gc::nogc
- ,item
- ,ci::michael_list::make_traits<
- ci::opt::hook< ci::michael_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::nogc>
- > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > list;
- test_nogc_int<list>();
- }
-
-} // namespace ordlist
+++ /dev/null
-//$$CDS-header$$
-
-#ifndef CDSTEST_HDR_LAZY_H
-#define CDSTEST_HDR_LAZY_H
-
-#include "cppunit/cppunit_proxy.h"
-#include <cds/container/details/lazy_list_base.h>
-
-namespace ordlist {
- namespace cc = cds::container;
- namespace co = cds::container::opt;
-
- class LazyListTestHeader: public CppUnitMini::TestCase
- {
- public:
- struct stat {
- int nEnsureExistsCall;
- int nEnsureNewCall;
-
- stat()
- {
- nEnsureExistsCall
- = nEnsureNewCall
- = 0;
- }
- };
-
- struct item {
- int nKey;
- int nVal;
-
- stat s;
-
- item(int key)
- : nKey( key )
- , nVal( key * 2 )
- , s()
- {}
-
- item(int key, int val)
- : nKey( key )
- , nVal(val)
- , s()
- {}
-
- item( item const& v )
- : nKey( v.nKey )
- , nVal( v.nVal )
- , s()
- {}
-
- int key() const
- {
- return nKey;
- }
- };
-
- template <typename T>
- struct lt
- {
- bool operator ()(const T& v1, const T& v2 ) const
- {
- return v1.key() < v2.key();
- }
-
- template <typename Q>
- bool operator ()(const T& v1, const Q& v2 ) const
- {
- return v1.key() < v2;
- }
-
- template <typename Q>
- bool operator ()(const Q& v1, const T& v2 ) const
- {
- return v1 < v2.key();
- }
- };
-
- template <typename T>
- struct cmp {
- int operator ()(const T& v1, const T& v2 ) const
- {
- if ( v1.key() < v2.key() )
- return -1;
- return v1.key() > v2.key() ? 1 : 0;
- }
-
- template <typename Q>
- int operator ()(const T& v1, const Q& v2 ) const
- {
- if ( v1.key() < v2 )
- return -1;
- return v1.key() > v2 ? 1 : 0;
- }
-
- template <typename Q>
- int operator ()(const Q& v1, const T& v2 ) const
- {
- if ( v1 < v2.key() )
- return -1;
- return v1 > v2.key() ? 1 : 0;
- }
- };
-
- struct insert_functor {
- void operator ()( item& i )
- {
- i.nVal = i.nKey * 1033;
- }
- };
- struct dummy_insert_functor {
- void operator ()( item& /*i*/ )
- {
- // This functor should not be called
- TestCase::current_test()->error( "CPPUNIT_ASSERT", "dummy_insert_functor should not be called", __FILE__, __LINE__ );
- }
- };
-
- static void insert_function( item& i )
- {
- i.nVal = i.nKey * 1024;
- }
- static void dummy_insert_function( item& /*i*/ )
- {
- // This function should not be called
- TestCase::current_test()->error( "CPPUNIT_ASSERT", "dummy_insert_function should not be called", __FILE__, __LINE__ );
- }
-
- struct erase_functor {
- unsigned int nEraseCall;
-
- erase_functor()
- : nEraseCall(0)
- {}
-
- void operator()( item const& /*i*/)
- {
- ++nEraseCall;
- }
- };
-
- struct check_value {
- unsigned int m_nMultiplier;
-
- check_value( unsigned int nMultiplier )
- : m_nMultiplier( nMultiplier )
- {}
-
- check_value( const check_value& s )
- : m_nMultiplier( s.m_nMultiplier )
- {}
-
- void operator()( item& i, int )
- {
- CPPUNIT_ASSERT_CURRENT( int(i.nKey * m_nMultiplier) == i.nVal );
- }
- };
-
- struct check_exact_value {
- int m_nExpected;
-
- check_exact_value( int nExpected )
- : m_nExpected( nExpected )
- {}
-
- check_exact_value( check_exact_value const& s)
- : m_nExpected( s.m_nExpected )
- {}
-
- void operator()( item& i, int )
- {
- CPPUNIT_ASSERT_CURRENT( i.nVal == m_nExpected );
- }
- };
-
- struct dummy_check_value {
- void operator()( item& /*i*/, int )
- {
- // This functor should not be called
- TestCase::current_test()->error( "CPPUNIT_ASSERT", "dummy_check_value should not be called", __FILE__, __LINE__ );
- }
- };
-
- struct ensure_functor {
- void operator()( bool /*bNew*/, item& i, int /*n*/ )
- {
- i.nVal = i.nKey * 1024;
- }
- };
-
- static void ensure_func( bool /*bNew*/, item& i, int n )
- {
- i.nVal = n * 1033;
- }
-
- struct other_item
- {
- int nKey;
-
- other_item()
- {}
-
- other_item(int n)
- : nKey(n)
- {}
- };
-
- struct other_less
- {
- template <typename T1, typename T2>
- bool operator()( T1 const& t1, T2 const& t2 ) const
- {
- return t1.nKey < t2.nKey;
- }
- };
-
- protected:
- template <class OrdList>
- void test_with( OrdList& l )
- {
- typedef typename OrdList::value_type value_type;
-
- // The list should be empty
- CPPUNIT_ASSERT( l.empty() );
-
- // insert test
- CPPUNIT_ASSERT( l.insert( 50 ) );
- CPPUNIT_ASSERT( l.insert( item( 25 )) );
- CPPUNIT_ASSERT( l.insert( item( 100 )) );
-
- // insert failed - such key exists
- CPPUNIT_ASSERT( !l.insert( 50 ) );
- CPPUNIT_ASSERT( !l.insert( item( 100 )) );
-
- // clear test
-
- // The list should not be empty
- CPPUNIT_ASSERT( !l.empty() );
- l.clear();
- // and now the list is empty
- CPPUNIT_ASSERT( l.empty() );
-
- // Test insert with functor
-
- CPPUNIT_ASSERT( l.insert( 100, insert_functor() ) );
- // passed by ref
- {
- insert_functor f;
- CPPUNIT_ASSERT( l.insert( item( 25 ), std::ref( f ) ) );
- CPPUNIT_ASSERT( !l.insert( item( 100 ), std::ref( f ) ) );
- }
- // Test insert with function
- CPPUNIT_ASSERT( l.insert( 50, insert_function ));
- CPPUNIT_ASSERT( !l.insert( 25, dummy_insert_function ));
- CPPUNIT_ASSERT( !l.insert( 100, dummy_insert_functor() ));
-
- // The list should not be empty
- CPPUNIT_ASSERT( !l.empty() );
-
- // Check inserted values
- {
- int i;
- i = 100;
-
- CPPUNIT_ASSERT( l.find( 100 ));
- CPPUNIT_ASSERT( l.find( i, check_value(1033) ));
- {
- check_value f(1033);
- i = 25;
- CPPUNIT_ASSERT( l.find_with( 25, lt<value_type>() ));
- CPPUNIT_ASSERT( l.find_with( i, lt<value_type>(), std::ref( f ) ) );
- }
- i = 50;
- CPPUNIT_ASSERT( l.find( 50 ));
- CPPUNIT_ASSERT( l.find( i, check_value(1024) ));
-
- i = 10;
- CPPUNIT_ASSERT( !l.find_with( 10, lt<value_type>() ));
- CPPUNIT_ASSERT( !l.find_with( i, lt<value_type>(), dummy_check_value() ));
- i = 75;
- CPPUNIT_ASSERT( !l.find( 75 ));
- CPPUNIT_ASSERT( !l.find( i, dummy_check_value() ));
- i = 150;
- CPPUNIT_ASSERT( !l.find( 150 ));
- CPPUNIT_ASSERT( !l.find( i, dummy_check_value() ));
- }
-
- // The list should not be empty
- CPPUNIT_ASSERT( !l.empty() );
- l.clear();
- // and now the list is empty
- CPPUNIT_ASSERT( l.empty() );
-
- // Ensure test
- {
- std::pair<bool, bool> ensureResult;
- ensure_functor f;
- ensureResult = l.ensure( 100, ensure_functor() );
- CPPUNIT_ASSERT( ensureResult.first );
- CPPUNIT_ASSERT( ensureResult.second );
-
- ensureResult = l.ensure( 200, std::ref( f ) );
- CPPUNIT_ASSERT( ensureResult.first );
- CPPUNIT_ASSERT( ensureResult.second );
-
- ensureResult = l.ensure( 50, ensure_func );
- CPPUNIT_ASSERT( ensureResult.first );
- CPPUNIT_ASSERT( ensureResult.second );
-
- int i;
- i = 100;
- CPPUNIT_ASSERT( l.find( i, check_value(1024) ));
- i = 50;
- CPPUNIT_ASSERT( l.find( i, check_value(1033) ));
- i = 200;
- CPPUNIT_ASSERT( l.find( i, check_value(1024) ));
-
- // ensure existing key
- ensureResult = l.ensure( 200, ensure_func );
- CPPUNIT_ASSERT( ensureResult.first );
- CPPUNIT_ASSERT( !ensureResult.second );
- i = 200;
- CPPUNIT_ASSERT( l.find( i, check_value(1033) ));
-
- ensureResult = l.ensure( 50, ensure_functor() );
- CPPUNIT_ASSERT( ensureResult.first );
- CPPUNIT_ASSERT( !ensureResult.second );
- i = 50;
- CPPUNIT_ASSERT( l.find( i, check_value(1024) ));
- }
-
- // erase test (list: 50, 100, 200)
- CPPUNIT_ASSERT( !l.empty() );
- CPPUNIT_ASSERT( l.insert(160));
- CPPUNIT_ASSERT( l.insert(250));
- CPPUNIT_ASSERT( !l.empty() );
-
- CPPUNIT_ASSERT( !l.erase( 150 ));
-
- CPPUNIT_ASSERT( l.erase( 100 ));
- CPPUNIT_ASSERT( !l.erase( 100 ));
-
- CPPUNIT_ASSERT( l.erase_with( 200, lt<value_type>() ));
- CPPUNIT_ASSERT( !l.erase_with( 200, lt<value_type>() ));
-
- {
- erase_functor ef;
- CPPUNIT_ASSERT( ef.nEraseCall == 0 );
- CPPUNIT_ASSERT( l.erase_with( 160, lt<value_type>(), std::ref(ef) ));
- CPPUNIT_ASSERT( ef.nEraseCall == 1 );
- CPPUNIT_ASSERT( !l.erase_with( 160, lt<value_type>(), std::ref(ef) ));
- CPPUNIT_ASSERT( ef.nEraseCall == 1 );
-
- CPPUNIT_ASSERT( l.erase( 250, std::ref(ef) ));
- CPPUNIT_ASSERT( ef.nEraseCall == 2 );
- CPPUNIT_ASSERT( !l.erase( 250, std::ref(ef) ));
- CPPUNIT_ASSERT( ef.nEraseCall == 2 );
- }
-
- CPPUNIT_ASSERT( l.erase( 50 ));
- CPPUNIT_ASSERT( !l.erase( 50 ));
-
- CPPUNIT_ASSERT( l.empty() );
-
- // clear empty list
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
-
- {
- int i;
- // insert test
- CPPUNIT_ASSERT( l.emplace( 501 ) );
- CPPUNIT_ASSERT( l.emplace( 251, 152 ));
- CPPUNIT_ASSERT( l.emplace( item( 1001 )) );
-
- // insert failed - such key exists
- CPPUNIT_ASSERT( !l.emplace( 501, 2 ) );
- CPPUNIT_ASSERT( !l.emplace( 251, 10) );
-
- i = 501;
- CPPUNIT_ASSERT( l.find( i, check_exact_value(501*2) ));
- i = 251;
- CPPUNIT_ASSERT( l.find( i, check_exact_value(152) ));
- i = 1001;
- CPPUNIT_ASSERT( l.find( i, check_exact_value(1001*2) ));
-
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
- }
-
- // Iterator test
- {
- int nCount = 100;
- for ( int i = 0; i < nCount; ++i )
- CPPUNIT_ASSERT( l.insert( i ) );
-
- {
- typename OrdList::iterator it( l.begin() );
- typename OrdList::const_iterator cit( l.cbegin() );
- CPPUNIT_CHECK( it == cit );
- CPPUNIT_CHECK( it != l.end() );
- CPPUNIT_CHECK( it != l.cend() );
- CPPUNIT_CHECK( cit != l.end() );
- CPPUNIT_CHECK( cit != l.cend() );
- ++it;
- CPPUNIT_CHECK( it != cit );
- CPPUNIT_CHECK( it != l.end() );
- CPPUNIT_CHECK( it != l.cend() );
- CPPUNIT_CHECK( cit != l.end() );
- CPPUNIT_CHECK( cit != l.cend() );
- ++cit;
- CPPUNIT_CHECK( it == cit );
- CPPUNIT_CHECK( it != l.end() );
- CPPUNIT_CHECK( it != l.cend() );
- CPPUNIT_CHECK( cit != l.end() );
- CPPUNIT_CHECK( cit != l.cend() );
- }
-
- int i = 0;
- for ( typename OrdList::iterator it = l.begin(), itEnd = l.end(); it != itEnd; ++it, ++i ) {
- it->nVal = i * 2;
- CPPUNIT_ASSERT( it->nKey == i );
- }
-
- // Check that we have visited all items
- for ( int i = 0; i < nCount; ++i )
- CPPUNIT_ASSERT( l.find( i, check_value(2) ));
-
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
-
- // Const iterator
- for ( int i = 0; i < nCount; ++i )
- CPPUNIT_ASSERT( l.insert(i) );
-
- i = 0;
- const OrdList& rl = l;
- for ( typename OrdList::const_iterator it = rl.begin(), itEnd = rl.end(); it != itEnd; ++it, ++i ) {
- // it->nVal = i * 2 ; // not!
- CPPUNIT_ASSERT( it->nKey == i );
- }
-
- // Check that we have visited all items
- for ( int i = 0; i < nCount; ++i )
- CPPUNIT_ASSERT( l.find_with( i, lt<value_type>(), check_value(2) ));
-
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
- }
- }
-
- template <class OrdList>
- void test()
- {
- typedef typename OrdList::guarded_ptr guarded_ptr;
- typedef typename OrdList::value_type value_type;
-
- OrdList l;
- test_with( l );
-
- static int const nLimit = 20;
- int arr[nLimit];
- for ( int i = 0; i < nLimit; i++ )
- arr[i] = i;
- std::random_shuffle( arr, arr + nLimit );
-
- // extract/get
- for ( int i = 0; i < nLimit; ++i )
- l.insert( arr[i] );
- {
- guarded_ptr gp;
- for ( int i = 0; i < nLimit; ++i ) {
- int nKey = arr[i];
-
- gp = l.get( nKey );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->nKey == nKey );
- CPPUNIT_CHECK( gp->nVal == nKey * 2 );
- gp.release();
-
- gp = l.extract( nKey );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->nKey == nKey );
- CPPUNIT_CHECK( gp->nVal == nKey*2 );
- gp.release();
-
- gp = l.get( nKey );
- CPPUNIT_CHECK( !gp );
- CPPUNIT_CHECK( gp.empty());
- CPPUNIT_CHECK( !l.extract( nKey));
- CPPUNIT_CHECK( gp.empty());
- }
- CPPUNIT_ASSERT( l.empty());
- CPPUNIT_CHECK( !l.get(arr[0]));
- CPPUNIT_CHECK( gp.empty());
- CPPUNIT_CHECK( !l.extract( arr[0]));
- CPPUNIT_CHECK( gp.empty());
- }
-
- // extract_with/get_with
- for ( int i = 0; i < nLimit; ++i )
- l.insert( arr[i] );
- {
- guarded_ptr gp;
- for ( int i = 0; i < nLimit; ++i ) {
- int nKey = arr[i];
- other_item key( nKey );
-
- gp = l.get_with( key, other_less() );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->nKey == nKey );
- CPPUNIT_CHECK( gp->nVal == nKey * 2 );
- gp.release();
-
- gp = l.extract_with( key, other_less() );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->nKey == nKey );
- CPPUNIT_CHECK( gp->nVal == nKey*2 );
- gp.release();
-
- gp = l.get_with( key, other_less() );
- CPPUNIT_CHECK( !gp );
- CPPUNIT_CHECK( gp.empty());
- CPPUNIT_CHECK( !l.extract_with( key, other_less()));
- CPPUNIT_CHECK( gp.empty());
- }
- CPPUNIT_ASSERT( l.empty());
- CPPUNIT_CHECK( !l.get_with(other_item(arr[0]), other_less()));
- CPPUNIT_CHECK( gp.empty());
- CPPUNIT_CHECK( !l.extract_with( other_item(arr[0]), other_less()));
- CPPUNIT_CHECK( gp.empty());
- }
-
- }
-
- template <class OrdList>
- void test_rcu()
- {
- OrdList l;
- test_with( l );
-
- static int const nLimit = 20;
-
- typedef typename OrdList::rcu_lock rcu_lock;
- typedef typename OrdList::value_type value_type;
- typedef typename OrdList::gc rcu_type;
-
- {
- int a[nLimit];
- for (int i = 0; i < nLimit; ++i)
- a[i]=i;
- std::random_shuffle( a, a + nLimit );
-
- // extract/get
- for ( int i = 0; i < nLimit; ++i )
- CPPUNIT_ASSERT( l.insert( a[i] ) );
-
- typename OrdList::exempt_ptr ep;
-
- for ( int i = 0; i < nLimit; ++i ) {
- {
- rcu_lock lock;
- value_type * pGet = l.get( a[i] );
- CPPUNIT_ASSERT( pGet != nullptr );
- CPPUNIT_CHECK( pGet->nKey == a[i] );
- CPPUNIT_CHECK( pGet->nVal == a[i] * 2 );
-
- ep = l.extract( a[i] );
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty() );
- CPPUNIT_CHECK( ep->nKey == a[i] );
- CPPUNIT_CHECK( (*ep).nVal == a[i] * 2 );
- }
- ep.release();
- {
- rcu_lock lock;
- CPPUNIT_CHECK( l.get( a[i] ) == nullptr );
- CPPUNIT_CHECK( !l.extract( a[i] ));
- }
- }
- CPPUNIT_ASSERT( l.empty() );
-
- {
- rcu_lock lock;
- CPPUNIT_CHECK( l.get( a[0] ) == nullptr );
- ep = l.extract( a[0] );
- CPPUNIT_CHECK( !ep );
- CPPUNIT_CHECK( ep.empty() );
- }
-
- // extract_with/get_with
- for ( int i = 0; i < nLimit; ++i ) {
- CPPUNIT_ASSERT( l.insert( a[i] ) );
- }
-
- for ( int i = 0; i < nLimit; ++i ) {
- other_item itm( a[i] );
- {
- rcu_lock lock;
- value_type * pGet = l.get_with( itm, other_less() );
- CPPUNIT_ASSERT( pGet != nullptr );
- CPPUNIT_CHECK( pGet->nKey == a[i] );
- CPPUNIT_CHECK( pGet->nVal == a[i] * 2 );
-
- ep = l.extract_with( itm, other_less() );
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty() );
- CPPUNIT_CHECK( ep->nKey == a[i] );
- CPPUNIT_CHECK( ep->nVal == a[i] * 2 );
- }
- ep.release();
- {
- rcu_lock lock;
- CPPUNIT_CHECK( l.get_with( itm, other_less() ) == nullptr );
- ep = l.extract_with( itm, other_less() );
- CPPUNIT_CHECK( !ep );
- CPPUNIT_CHECK( ep.empty() );
- }
- }
- CPPUNIT_ASSERT( l.empty() );
-
- {
- rcu_lock lock;
- CPPUNIT_CHECK( l.get_with( other_item( 0 ), other_less() ) == nullptr );
- CPPUNIT_CHECK( !l.extract_with( other_item(0), other_less() ));
- CPPUNIT_CHECK( ep.empty() );
- }
- }
- }
-
- template <class OrdList>
- void nogc_test()
- {
- typedef OrdList list;
- typedef typename list::value_type value_type;
- typedef std::pair<typename list::iterator, bool> ensure_result;
-
- typename list::iterator it;
-
- list l;
- CPPUNIT_ASSERT( l.empty() );
- CPPUNIT_ASSERT( l.insert(50) != l.end() );
- CPPUNIT_ASSERT( !l.empty() );
-
- ensure_result eres = l.ensure( item(100, 33) );
- CPPUNIT_ASSERT( eres.second );
- CPPUNIT_ASSERT( eres.first != l.end() );
- CPPUNIT_ASSERT( l.insert( item(150) ) != l.end() );
-
- CPPUNIT_ASSERT( l.insert(100) == l.end() );
- eres = l.ensure( item(50, 33) );
- CPPUNIT_ASSERT( !eres.second );
- CPPUNIT_ASSERT( eres.first->nVal == eres.first->nKey * 2 );
- eres.first->nVal = 63;
-
- it = l.find( 33 );
- CPPUNIT_ASSERT( it == l.end() );
-
- it = l.find( 50 );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it->nKey == 50 );
- CPPUNIT_ASSERT( it->nVal == 63 );
-
- it = l.find( 100 );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it->nKey == 100 );
- CPPUNIT_ASSERT( it->nVal == 33 );
-
- it = l.find_with( 150, lt<value_type>() );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it->nKey == 150 );
- CPPUNIT_ASSERT( it->nVal == it->nKey * 2 );
-
- CPPUNIT_ASSERT( !l.empty() );
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
-
- // insert test
- CPPUNIT_ASSERT( l.emplace( 501 ) != l.end());
- CPPUNIT_ASSERT( l.emplace( 251, 152 ) != l.end());
- CPPUNIT_ASSERT( l.emplace( item( 1001 )) != l.end());
-
- // insert failed - such key exists
- CPPUNIT_ASSERT( l.emplace( 501, 2 ) == l.end());
- CPPUNIT_ASSERT( l.emplace( 251, 10) == l.end());
-
- it = l.find( 501 );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it->nKey == 501 );
- CPPUNIT_ASSERT( it->nVal == 501 * 2 );
-
- it = l.find_with( 251, lt<value_type>() );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it->nKey == 251 );
- CPPUNIT_ASSERT( it->nVal == 152 );
-
- it = l.find( 1001 );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it->nKey == 1001 );
- CPPUNIT_ASSERT( it->nVal == 1001 * 2 );
-
- {
- typename OrdList::iterator it( l.begin() );
- typename OrdList::const_iterator cit( l.cbegin() );
- CPPUNIT_CHECK( it == cit );
- CPPUNIT_CHECK( it != l.end() );
- CPPUNIT_CHECK( it != l.cend() );
- CPPUNIT_CHECK( cit != l.end() );
- CPPUNIT_CHECK( cit != l.cend() );
- ++it;
- CPPUNIT_CHECK( it != cit );
- CPPUNIT_CHECK( it != l.end() );
- CPPUNIT_CHECK( it != l.cend() );
- CPPUNIT_CHECK( cit != l.end() );
- CPPUNIT_CHECK( cit != l.cend() );
- ++cit;
- CPPUNIT_CHECK( it == cit );
- CPPUNIT_CHECK( it != l.end() );
- CPPUNIT_CHECK( it != l.cend() );
- CPPUNIT_CHECK( cit != l.end() );
- CPPUNIT_CHECK( cit != l.cend() );
- }
-
-
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
- }
-
- void HP_cmp();
- void HP_less();
- void HP_cmpmix();
- void HP_ic();
-
- void DHP_cmp();
- void DHP_less();
- void DHP_cmpmix();
- void DHP_ic();
-
- void RCU_GPI_cmp();
- void RCU_GPI_less();
- void RCU_GPI_cmpmix();
- void RCU_GPI_ic();
-
- void RCU_GPB_cmp();
- void RCU_GPB_less();
- void RCU_GPB_cmpmix();
- void RCU_GPB_ic();
-
- void RCU_GPT_cmp();
- void RCU_GPT_less();
- void RCU_GPT_cmpmix();
- void RCU_GPT_ic();
-
- void RCU_SHB_cmp();
- void RCU_SHB_less();
- void RCU_SHB_cmpmix();
- void RCU_SHB_ic();
-
- void RCU_SHT_cmp();
- void RCU_SHT_less();
- void RCU_SHT_cmpmix();
- void RCU_SHT_ic();
-
- void NOGC_cmp();
- void NOGC_less();
- void NOGC_cmpmix();
- void NOGC_ic();
-
- CPPUNIT_TEST_SUITE(LazyListTestHeader)
- CPPUNIT_TEST(HP_cmp)
- CPPUNIT_TEST(HP_less)
- CPPUNIT_TEST(HP_cmpmix)
- CPPUNIT_TEST(HP_ic)
-
- CPPUNIT_TEST(DHP_cmp)
- CPPUNIT_TEST(DHP_less)
- CPPUNIT_TEST(DHP_cmpmix)
- CPPUNIT_TEST(DHP_ic)
-
- CPPUNIT_TEST(RCU_GPI_cmp)
- CPPUNIT_TEST(RCU_GPI_less)
- CPPUNIT_TEST(RCU_GPI_cmpmix)
- CPPUNIT_TEST(RCU_GPI_ic)
-
- CPPUNIT_TEST(RCU_GPB_cmp)
- CPPUNIT_TEST(RCU_GPB_less)
- CPPUNIT_TEST(RCU_GPB_cmpmix)
- CPPUNIT_TEST(RCU_GPB_ic)
-
- CPPUNIT_TEST(RCU_GPT_cmp)
- CPPUNIT_TEST(RCU_GPT_less)
- CPPUNIT_TEST(RCU_GPT_cmpmix)
- CPPUNIT_TEST(RCU_GPT_ic)
-
- CPPUNIT_TEST(RCU_SHB_cmp)
- CPPUNIT_TEST(RCU_SHB_less)
- CPPUNIT_TEST(RCU_SHB_cmpmix)
- CPPUNIT_TEST(RCU_SHB_ic)
-
- CPPUNIT_TEST(RCU_SHT_cmp)
- CPPUNIT_TEST(RCU_SHT_less)
- CPPUNIT_TEST(RCU_SHT_cmpmix)
- CPPUNIT_TEST(RCU_SHT_ic)
-
- CPPUNIT_TEST(NOGC_cmp)
- CPPUNIT_TEST(NOGC_less)
- CPPUNIT_TEST(NOGC_cmpmix)
- CPPUNIT_TEST(NOGC_ic)
- CPPUNIT_TEST_SUITE_END()
- };
-
-} // namespace ordlist
-
-#endif // #ifndef CDSTEST_HDR_LAZY_H
\ No newline at end of file
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_lazy.h"
-#include <cds/container/lazy_list_dhp.h>
-
-namespace ordlist {
- namespace {
- struct DHP_cmp_traits: public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
- };
- }
- void LazyListTestHeader::DHP_cmp()
- {
- // traits-based version
- typedef cc::LazyList< cds::gc::DHP, item, DHP_cmp_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::LazyList< cds::gc::DHP, item,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<item> >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
- namespace {
- struct DHP_less_traits: public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
- };
- }
- void LazyListTestHeader::DHP_less()
- {
- // traits-based version
- typedef cc::LazyList< cds::gc::DHP, item, DHP_less_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::LazyList< cds::gc::DHP, item,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
- namespace {
- struct DHP_cmpmix_traits: public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
- typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
- };
- }
- void LazyListTestHeader::DHP_cmpmix()
- {
- // traits-based version
- typedef cc::LazyList< cds::gc::DHP, item, DHP_cmpmix_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::LazyList< cds::gc::DHP, item,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<item> >
- ,cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
- namespace {
- struct DHP_ic_traits: public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
- void LazyListTestHeader::DHP_ic()
- {
- // traits-based version
- typedef cc::LazyList< cds::gc::DHP, item, DHP_ic_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::LazyList< cds::gc::DHP, item,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<item> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
-} // namespace ordlist
-
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_lazy.h"
-#include <cds/container/lazy_list_hp.h>
-
-namespace ordlist {
- namespace {
- struct HP_cmp_traits: public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
- };
-
- }
- void LazyListTestHeader::HP_cmp()
- {
- // traits-based version
- typedef cc::LazyList< cds::gc::HP, item, HP_cmp_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::LazyList< cds::gc::HP, item,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<item> >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
- namespace {
- struct HP_less_traits: public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
- };
- }
- void LazyListTestHeader::HP_less()
- {
- // traits-based version
- typedef cc::LazyList< cds::gc::HP, item, HP_less_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::LazyList< cds::gc::HP, item,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
- namespace {
- struct HP_cmpmix_traits: public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
- typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
- };
- }
- void LazyListTestHeader::HP_cmpmix()
- {
- // traits-based version
- typedef cc::LazyList< cds::gc::HP, item, HP_cmpmix_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::LazyList< cds::gc::HP, item,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<item> >
- ,cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
- namespace {
- struct HP_ic_traits: public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
- void LazyListTestHeader::HP_ic()
- {
- // traits-based version
- typedef cc::LazyList< cds::gc::HP, item, HP_ic_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::LazyList< cds::gc::HP, item,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<item> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
-} // namespace ordlist
-
-CPPUNIT_TEST_SUITE_REGISTRATION(ordlist::LazyListTestHeader);
+++ /dev/null
-//$$CDS-header$$
-
-#ifndef CDSTEST_HDR_LAZY_KV_H
-#define CDSTEST_HDR_LAZY_KV_H
-
-#include "cppunit/cppunit_proxy.h"
-#include <cds/container/details/lazy_list_base.h>
-
-namespace ordlist {
- namespace cc = cds::container;
- namespace co = cds::container::opt;
-
- class LazyKVListTestHeader: public CppUnitMini::TestCase
- {
- public:
- typedef int key_type;
- struct value_type {
- int m_val;
-
- value_type()
- : m_val(0)
- {}
-
- value_type( int n )
- : m_val( n )
- {}
- };
-
- template <typename T>
- struct lt
- {
- bool operator ()(const T& v1, const T& v2 ) const
- {
- return v1 < v2;
- }
- };
-
- template <typename T>
- struct cmp {
- int operator ()(const T& v1, const T& v2 ) const
- {
- if ( v1 < v2 )
- return -1;
- return v1 > v2 ? 1 : 0;
- }
- };
-
- struct check_value {
- int m_nExpected;
-
- check_value( int nExpected )
- : m_nExpected( nExpected )
- {}
-
- template <typename T>
- void operator ()( T& pair )
- {
- CPPUNIT_ASSERT_CURRENT( pair.second.m_val == m_nExpected );
- }
- };
-
- struct insert_functor {
- template <typename T>
- void operator()( T& pair )
- {
- pair.second.m_val = pair.first * 10;
- }
- };
-
- struct ensure_functor {
- template <typename T>
- void operator()( bool /*bNew*/, T& pair )
- {
- pair.second.m_val = pair.first * 50;
- }
- };
-
- struct erase_functor {
- int nKey;
- int nVal;
-
- erase_functor()
- : nKey(0)
- , nVal(0)
- {}
-
- template <typename T>
- void operator()( T& i )
- {
- nKey = i.first;
- nVal = i.second.m_val;
- }
- };
-
- typedef float other_key;
- struct other_less {
- bool operator()( float f, int i ) const
- {
- return int(f) < i;
- }
- bool operator()( int i, float f ) const
- {
- return i < int(f);
- }
- };
-
- protected:
- template <class OrdList>
- void test_with( OrdList& l)
- {
- typedef typename OrdList::value_type value_type;
-
- typename OrdList::iterator itTest;
- typename OrdList::const_iterator citTest;
-
- CPPUNIT_ASSERT( l.empty() );
-
- // insert / find test
- CPPUNIT_ASSERT( !l.find( 100 ));
- CPPUNIT_ASSERT( l.insert( 100 ));
- CPPUNIT_ASSERT( !l.empty() );
- CPPUNIT_ASSERT( l.find( 100 ));
-
- check_value chk(0);
- CPPUNIT_ASSERT( l.find( 100, std::ref( chk ) ) );
-
- CPPUNIT_ASSERT( !l.find_with( 50, lt<key_type>() ));
- CPPUNIT_ASSERT( l.insert( 50, 500 ));
- CPPUNIT_ASSERT( l.find_with( 50, lt<key_type>() ));
- CPPUNIT_ASSERT( !l.insert( 50, 5 ));
- chk.m_nExpected = 500;
- CPPUNIT_ASSERT( l.find( 50, std::ref( chk ) ) );
- chk.m_nExpected = 0;
- CPPUNIT_ASSERT( l.find( 100, std::ref( chk ) ) );
- CPPUNIT_ASSERT( !l.empty() );
-
- CPPUNIT_ASSERT( !l.find( 150 ));
- CPPUNIT_ASSERT( l.insert_with( 150, insert_functor() ));
- CPPUNIT_ASSERT( l.find( 150 ));
- chk.m_nExpected = 1500;
- CPPUNIT_ASSERT( l.find_with( 150, lt<key_type>(), std::ref( chk ) ) );
- chk.m_nExpected = 0;
- CPPUNIT_ASSERT( l.find( 100, std::ref( chk ) ) );
- chk.m_nExpected = 500;
- CPPUNIT_ASSERT( l.find( 50, std::ref( chk ) ) );
- CPPUNIT_ASSERT( !l.empty() );
-
- // erase test
-
- CPPUNIT_ASSERT( !l.erase( 500 ));
- CPPUNIT_ASSERT( !l.empty() );
-
- CPPUNIT_ASSERT( l.find( 50 ));
- {
- erase_functor ef;
- l.erase( 50, std::ref( ef ) );
- CPPUNIT_ASSERT( ef.nKey == 50 );
- CPPUNIT_ASSERT( ef.nVal == 500 );
- }
- CPPUNIT_ASSERT( !l.find( 50 ));
-
- // ensure test
- std::pair<bool, bool> bEnsureResult;
- bEnsureResult = l.ensure( 100, ensure_functor() );
- CPPUNIT_ASSERT( bEnsureResult.first );
- CPPUNIT_ASSERT( !bEnsureResult.second );
- chk.m_nExpected = 5000;
- CPPUNIT_ASSERT( l.find( 100, std::ref( chk ) ) );
-
- {
- ensure_functor ef;
- bEnsureResult = l.ensure( 50, std::ref( ef ) );
- }
- CPPUNIT_ASSERT( bEnsureResult.first );
- CPPUNIT_ASSERT( bEnsureResult.second );
- chk.m_nExpected = 2500;
- CPPUNIT_ASSERT( l.find( 50, std::ref( chk ) ) );
-
- // erase test
- CPPUNIT_ASSERT( !l.empty() );
- CPPUNIT_ASSERT( l.insert_with( 200, insert_functor() ));
- CPPUNIT_ASSERT( l.insert( 25 ));
- CPPUNIT_ASSERT( l.erase( 100 ));
- CPPUNIT_ASSERT( l.erase( 150 ));
- {
- erase_functor ef;
- CPPUNIT_ASSERT( l.erase_with( 200, lt<key_type>(), std::ref(ef)) );
- CPPUNIT_ASSERT( ef.nKey == 200 );
- CPPUNIT_ASSERT( ef.nVal == 2000 );
- }
- CPPUNIT_ASSERT( l.erase_with( 25, lt<key_type>()))
- CPPUNIT_ASSERT( l.erase( 50 ));
- CPPUNIT_ASSERT( l.empty() );
-
- // clear empty list
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
-
- // insert test
- CPPUNIT_ASSERT( l.emplace( 501 ) );
- CPPUNIT_ASSERT( l.emplace( 251, 152 ));
-
- // insert failed - such key exists
- CPPUNIT_ASSERT( !l.emplace( 501, 2 ) );
- CPPUNIT_ASSERT( !l.emplace( 251, 10) );
-
- check_value cv(0);
- CPPUNIT_ASSERT( l.find( 501, std::ref(cv) ));
- cv.m_nExpected = 152;
- CPPUNIT_ASSERT( l.find( 251, std::ref(cv) ));
-
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
-
- // Iterator test
- {
- int nCount = 100;
- for ( int i = 0; i < nCount; ++i )
- CPPUNIT_ASSERT( l.insert(i, i * 2 ) );
-
- {
- typename OrdList::iterator it( l.begin() );
- typename OrdList::const_iterator cit( l.cbegin() );
- CPPUNIT_CHECK( it == cit );
- CPPUNIT_CHECK( it != l.end() );
- CPPUNIT_CHECK( it != l.cend() );
- CPPUNIT_CHECK( cit != l.end() );
- CPPUNIT_CHECK( cit != l.cend() );
- ++it;
- CPPUNIT_CHECK( it != cit );
- CPPUNIT_CHECK( it != l.end() );
- CPPUNIT_CHECK( it != l.cend() );
- CPPUNIT_CHECK( cit != l.end() );
- CPPUNIT_CHECK( cit != l.cend() );
- ++cit;
- CPPUNIT_CHECK( it == cit );
- CPPUNIT_CHECK( it != l.end() );
- CPPUNIT_CHECK( it != l.cend() );
- CPPUNIT_CHECK( cit != l.end() );
- CPPUNIT_CHECK( cit != l.cend() );
- }
-
- int i = 0;
- for ( typename OrdList::iterator it = l.begin(), itEnd = l.end(); it != itEnd; ++it, ++i ) {
- CPPUNIT_ASSERT( it.key() == i );
- CPPUNIT_ASSERT( it.val().m_val == i * 2 );
- it.val().m_val = i * 3;
- }
-
- // Check that we have visited all items
- for ( int i = 0; i < nCount; ++i ) {
- chk.m_nExpected = i * 3;
- CPPUNIT_ASSERT( l.find( i, std::ref( chk ) ) );
- }
-
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
-
- // Const iterator
- for ( int i = 0; i < nCount; ++i )
- CPPUNIT_ASSERT( l.insert(i, i * 7) );
-
- i = 0;
- const OrdList& rl = l;
- for ( typename OrdList::const_iterator it = rl.begin(), itEnd = rl.end(); it != itEnd; ++it, ++i ) {
- CPPUNIT_ASSERT( it.key() == i );
- CPPUNIT_ASSERT( it.val().m_val == i * 7 );
- }
-
- // Check that we have visited all items
- for ( int i = nCount; i > 0; --i ) {
- chk.m_nExpected = (i - 1) * 7;
- CPPUNIT_ASSERT( l.find_with( i - 1, lt<key_type>(), std::ref( chk ) ) );
- }
-
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
- }
- }
-
- template <class OrdList>
- void test()
- {
- OrdList l;
- test_with(l);
-
- typedef typename OrdList::guarded_ptr guarded_ptr;
-
- static int const nLimit = 20;
- int arr[nLimit];
- for ( int i = 0; i < nLimit; i++ )
- arr[i] = i;
- std::random_shuffle( arr, arr + nLimit );
-
- // extract/get
- for ( int i = 0; i < nLimit; ++i )
- l.insert( arr[i], arr[i] * 2 );
- {
- guarded_ptr gp;
- for ( int i = 0; i < nLimit; ++i ) {
- int nKey = arr[i];
-
- gp = l.get( nKey );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->first == nKey );
- CPPUNIT_CHECK( gp->second.m_val == nKey * 2 );
- gp.release();
-
- gp = l.extract( nKey );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->first == nKey );
- CPPUNIT_CHECK( gp->second.m_val == nKey*2 );
- gp.release();
-
- gp = l.get( nKey );
- CPPUNIT_CHECK( !gp );
- CPPUNIT_CHECK( gp.empty());
- CPPUNIT_CHECK( !l.extract( nKey));
- CPPUNIT_CHECK( gp.empty());
- }
- CPPUNIT_ASSERT( l.empty());
- CPPUNIT_CHECK( !l.get(arr[0]));
- CPPUNIT_CHECK( gp.empty());
- CPPUNIT_CHECK( !l.extract( arr[0]));
- CPPUNIT_CHECK( gp.empty());
- }
-
- // extract_with/get_with
- for ( int i = 0; i < nLimit; ++i )
- l.insert( arr[i], arr[i] * 2 );
- {
- guarded_ptr gp;
- for ( int i = 0; i < nLimit; ++i ) {
- int nKey = arr[i];
- other_key key = float(nKey + 0.3);
-
- gp = l.get_with( key, other_less() );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->first == nKey );
- CPPUNIT_CHECK( gp->second.m_val == nKey * 2 );
- gp.release();
-
- gp = l.extract_with( key, other_less() );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->first == nKey );
- CPPUNIT_CHECK( gp->second.m_val == nKey*2 );
- gp.release();
-
- gp = l.get_with( key, other_less() );
- CPPUNIT_CHECK( !gp );
- CPPUNIT_CHECK( gp.empty());
- CPPUNIT_CHECK( !l.extract_with( key, other_less()));
- CPPUNIT_CHECK( gp.empty());
- }
- CPPUNIT_ASSERT( l.empty());
- CPPUNIT_CHECK( !l.get_with(3.4f, other_less()));
- CPPUNIT_CHECK( gp.empty());
- CPPUNIT_CHECK( !l.extract_with( 3.4f, other_less()));
- CPPUNIT_CHECK( gp.empty());
- }
- }
-
- template <class OrdList>
- void test_rcu()
- {
- OrdList l;
- test_with(l);
-
- static int const nLimit = 20;
-
- typedef typename OrdList::rcu_lock rcu_lock;
- typedef typename OrdList::value_type value_type;
- typedef typename OrdList::gc rcu_type;
-
- {
- int a[nLimit];
- for (int i = 0; i < nLimit; ++i)
- a[i]=i;
- std::random_shuffle( a, a + nLimit );
-
- // extract/get
- for ( int i = 0; i < nLimit; ++i )
- CPPUNIT_ASSERT( l.insert( a[i], a[i]*2 ) );
-
- typename OrdList::exempt_ptr ep;
-
- for ( int i = 0; i < nLimit; ++i ) {
- {
- rcu_lock lock;
- value_type * pGet = l.get( a[i] );
- CPPUNIT_ASSERT( pGet != nullptr );
- CPPUNIT_CHECK( pGet->first == a[i] );
- CPPUNIT_CHECK( pGet->second.m_val == a[i] * 2 );
-
- ep = l.extract( a[i] );
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty() );
- CPPUNIT_CHECK( ep->first == a[i] );
- CPPUNIT_CHECK( (*ep).second.m_val == a[i] * 2 );
- }
- ep.release();
- {
- rcu_lock lock;
- CPPUNIT_CHECK( l.get( a[i] ) == nullptr );
- ep = l.extract( a[i] );
- CPPUNIT_CHECK( !ep );
- CPPUNIT_CHECK( ep.empty() );
- }
- }
- CPPUNIT_ASSERT( l.empty() );
-
- {
- rcu_lock lock;
- CPPUNIT_CHECK( l.get( a[0] ) == nullptr );
- CPPUNIT_CHECK( !l.extract( a[0] ) );
- }
-
- // extract_with/get_with
- for ( int i = 0; i < nLimit; ++i ) {
- CPPUNIT_ASSERT( l.insert( a[i], a[i]*2 ) );
- }
-
- for ( int i = 0; i < nLimit; ++i ) {
- float itm = a[i] + 0.3f;
- {
- rcu_lock lock;
- value_type * pGet = l.get_with( itm, other_less() );
- CPPUNIT_ASSERT( pGet != nullptr );
- CPPUNIT_CHECK( pGet->first == a[i] );
- CPPUNIT_CHECK( pGet->second.m_val == a[i] * 2 );
-
- ep = l.extract_with( itm, other_less() );
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty() );
- CPPUNIT_CHECK( ep->first == a[i] );
- CPPUNIT_CHECK( ep->second.m_val == a[i] * 2 );
- }
- ep.release();
- {
- rcu_lock lock;
- CPPUNIT_CHECK( l.get_with( itm, other_less()) == nullptr );
- ep = l.extract_with( itm, other_less() );
- CPPUNIT_CHECK( !ep );
- CPPUNIT_CHECK( ep.empty() );
- }
- }
- CPPUNIT_ASSERT( l.empty() );
-
- {
- rcu_lock lock;
- CPPUNIT_CHECK( l.get_with( 3.14f, other_less() ) == nullptr );
- CPPUNIT_CHECK( !l.extract_with( 3.14f, other_less() ));
- CPPUNIT_CHECK( ep.empty() );
- }
- }
- }
-
- template <class OrdList>
- void nogc_test()
- {
- typedef typename OrdList::value_type value_type;
- typedef typename OrdList::iterator iterator;
-
- {
- OrdList l;
- iterator it;
-
- CPPUNIT_ASSERT( l.empty() );
-
- // insert / find test
- CPPUNIT_ASSERT( l.find( 100 ) == l.end() );
- CPPUNIT_ASSERT( l.insert( 100 ) != l.end() );
- CPPUNIT_ASSERT( !l.empty() );
- it = l.find( 100 );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it.key() == 100 );
- CPPUNIT_ASSERT( it.val().m_val == 0 );
-
- CPPUNIT_ASSERT( l.find_with( 50, lt<key_type>() ) == l.end() );
- CPPUNIT_ASSERT( l.insert( 50, 500 ) != l.end());
- it = l.find( 50 );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it.key() == 50 );
- CPPUNIT_ASSERT( it.val().m_val == 500 );
-
- CPPUNIT_ASSERT( l.insert( 50, 5 ) == l.end() );
- it = l.find( 50 );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it.key() == 50 );
- CPPUNIT_ASSERT( it.val().m_val == 500 );
- CPPUNIT_ASSERT( !l.empty() );
-
- CPPUNIT_ASSERT( l.find( 150 ) == l.end() );
- CPPUNIT_ASSERT( l.insert_with( 150, insert_functor() ) != l.end() );
- it = l.find( 150 );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it.key() == 150 );
- CPPUNIT_ASSERT( it.val().m_val == 1500 );
- it = l.find( 100 );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it.key() == 100 );
- CPPUNIT_ASSERT( it.val().m_val == 0 );
- it = l.find( 50 );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it.key() == 50 );
- CPPUNIT_ASSERT( it.val().m_val == 500 );
- it.val().m_val = 25;
- it = l.find( 50 );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it.key() == 50 );
- CPPUNIT_ASSERT( it.val().m_val == 25 );
- CPPUNIT_ASSERT( !l.empty() );
-
- // ensure existing item
- std::pair<iterator, bool> ensureResult;
- ensureResult = l.ensure( 100 );
- CPPUNIT_ASSERT( !ensureResult.second );
- CPPUNIT_ASSERT( ensureResult.first.key() == 100 );
- CPPUNIT_ASSERT( ensureResult.first.val().m_val == 0 );
- ensureResult.first.val().m_val = 5;
- it = l.find( 100 );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it.key() == 100 );
- CPPUNIT_ASSERT( it.val().m_val == 5 );
-
- CPPUNIT_ASSERT( !l.empty() );
-
- // ensure new item
- ensureResult = l.ensure( 1000 );
- CPPUNIT_ASSERT( ensureResult.second );
- CPPUNIT_ASSERT( ensureResult.first.key() == 1000 );
- CPPUNIT_ASSERT( ensureResult.first.val().m_val == 0 );
- ensureResult.first.val().m_val = 33;
- ensureResult = l.ensure( 1000 );
- CPPUNIT_ASSERT( !ensureResult.second );
- CPPUNIT_ASSERT( ensureResult.first.key() == 1000 );
- CPPUNIT_ASSERT( ensureResult.first.val().m_val == 33 );
-
- // clear test
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
-
- // insert test
- CPPUNIT_ASSERT( l.emplace( 501 ) != l.end());
- CPPUNIT_ASSERT( l.emplace( 251, 152 ) != l.end());
-
- // insert failed - such key exists
- CPPUNIT_ASSERT( l.emplace( 501, 2 ) == l.end());
- CPPUNIT_ASSERT( l.emplace( 251, 10) == l.end());
-
- it = l.find(501);
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it.key() == 501 );
- CPPUNIT_ASSERT( it.val().m_val == 0 );
-
- it = l.find(251);
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it.key() == 251 );
- CPPUNIT_ASSERT( it.val().m_val == 152 );
-
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
-
- // Iterator test
- {
- int nCount = 100;
- for ( int i = 0; i < nCount; ++i )
- CPPUNIT_ASSERT( l.insert(i, i * 2 ) != l.end() );
-
- {
- typename OrdList::iterator it( l.begin() );
- typename OrdList::const_iterator cit( l.cbegin() );
- CPPUNIT_CHECK( it == cit );
- CPPUNIT_CHECK( it != l.end() );
- CPPUNIT_CHECK( it != l.cend() );
- CPPUNIT_CHECK( cit != l.end() );
- CPPUNIT_CHECK( cit != l.cend() );
- ++it;
- CPPUNIT_CHECK( it != cit );
- CPPUNIT_CHECK( it != l.end() );
- CPPUNIT_CHECK( it != l.cend() );
- CPPUNIT_CHECK( cit != l.end() );
- CPPUNIT_CHECK( cit != l.cend() );
- ++cit;
- CPPUNIT_CHECK( it == cit );
- CPPUNIT_CHECK( it != l.end() );
- CPPUNIT_CHECK( it != l.cend() );
- CPPUNIT_CHECK( cit != l.end() );
- CPPUNIT_CHECK( cit != l.cend() );
- }
-
- int i = 0;
- for ( typename OrdList::iterator iter = l.begin(), itEnd = l.end(); iter != itEnd; ++iter, ++i ) {
- CPPUNIT_ASSERT( iter.key() == i );
- CPPUNIT_ASSERT( iter->first == i );
- CPPUNIT_ASSERT( (*iter).first == i );
-
- CPPUNIT_ASSERT( iter.val().m_val == i * 2 );
- CPPUNIT_ASSERT( iter->second.m_val == i * 2 );
- CPPUNIT_ASSERT( (*iter).second.m_val == i * 2 );
-
- iter.val().m_val = i * 3;
- }
-
- // Check that we have visited all items
- for ( int i = 0; i < nCount; ++i ) {
- it = l.find( i );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it.key() == i );
- CPPUNIT_ASSERT( it.val().m_val == i * 3 );
- }
-
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
-
- // Const iterator
- for ( int i = 0; i < nCount; ++i )
- CPPUNIT_ASSERT( l.insert(i, i * 7) != l.end() );
-
- i = 0;
- const OrdList& rl = l;
- for ( typename OrdList::const_iterator iter = rl.begin(), itEnd = rl.end(); iter != itEnd; ++iter, ++i ) {
- CPPUNIT_ASSERT( iter.key() == i );
- CPPUNIT_ASSERT( iter->first == i );
- CPPUNIT_ASSERT( (*iter).first == i );
-
- CPPUNIT_ASSERT( iter.val().m_val == i * 7 );
- CPPUNIT_ASSERT( iter->second.m_val == i * 7 );
- CPPUNIT_ASSERT( (*iter).second.m_val == i * 7 );
- // it.val().m_val = i * 3 ; // error: const-iterator
- }
-
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
- }
-
- }
- }
-
- void HP_cmp();
- void HP_less();
- void HP_cmpmix();
- void HP_ic();
-
- void DHP_cmp();
- void DHP_less();
- void DHP_cmpmix();
- void DHP_ic();
-
- void RCU_GPI_cmp();
- void RCU_GPI_less();
- void RCU_GPI_cmpmix();
- void RCU_GPI_ic();
-
- void RCU_GPB_cmp();
- void RCU_GPB_less();
- void RCU_GPB_cmpmix();
- void RCU_GPB_ic();
-
- void RCU_GPT_cmp();
- void RCU_GPT_less();
- void RCU_GPT_cmpmix();
- void RCU_GPT_ic();
-
- void RCU_SHB_cmp();
- void RCU_SHB_less();
- void RCU_SHB_cmpmix();
- void RCU_SHB_ic();
-
- void RCU_SHT_cmp();
- void RCU_SHT_less();
- void RCU_SHT_cmpmix();
- void RCU_SHT_ic();
-
- void NOGC_cmp();
- void NOGC_less();
- void NOGC_cmpmix();
- void NOGC_ic();
-
- CPPUNIT_TEST_SUITE(LazyKVListTestHeader)
- CPPUNIT_TEST(HP_cmp)
- CPPUNIT_TEST(HP_less)
- CPPUNIT_TEST(HP_cmpmix)
- CPPUNIT_TEST(HP_ic)
-
- CPPUNIT_TEST(DHP_cmp)
- CPPUNIT_TEST(DHP_less)
- CPPUNIT_TEST(DHP_cmpmix)
- CPPUNIT_TEST(DHP_ic)
-
- CPPUNIT_TEST(RCU_GPI_cmp)
- CPPUNIT_TEST(RCU_GPI_less)
- CPPUNIT_TEST(RCU_GPI_cmpmix)
- CPPUNIT_TEST(RCU_GPI_ic)
-
- CPPUNIT_TEST(RCU_GPB_cmp)
- CPPUNIT_TEST(RCU_GPB_less)
- CPPUNIT_TEST(RCU_GPB_cmpmix)
- CPPUNIT_TEST(RCU_GPB_ic)
-
- CPPUNIT_TEST(RCU_GPT_cmp)
- CPPUNIT_TEST(RCU_GPT_less)
- CPPUNIT_TEST(RCU_GPT_cmpmix)
- CPPUNIT_TEST(RCU_GPT_ic)
-
- CPPUNIT_TEST(RCU_SHB_cmp)
- CPPUNIT_TEST(RCU_SHB_less)
- CPPUNIT_TEST(RCU_SHB_cmpmix)
- CPPUNIT_TEST(RCU_SHB_ic)
-
- CPPUNIT_TEST(RCU_SHT_cmp)
- CPPUNIT_TEST(RCU_SHT_less)
- CPPUNIT_TEST(RCU_SHT_cmpmix)
- CPPUNIT_TEST(RCU_SHT_ic)
-
- CPPUNIT_TEST(NOGC_cmp)
- CPPUNIT_TEST(NOGC_less)
- CPPUNIT_TEST(NOGC_cmpmix)
- CPPUNIT_TEST(NOGC_ic)
- CPPUNIT_TEST_SUITE_END()
- };
-
-} // namespace ordlist
-
-#endif // #ifndef CDSTEST_HDR_LAZY_KV_H
\ No newline at end of file
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_lazy_kv.h"
-#include <cds/container/lazy_kvlist_dhp.h>
-
-namespace ordlist {
- namespace {
- struct DHP_cmp_traits : public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
- };
- }
- void LazyKVListTestHeader::DHP_cmp()
- {
- // traits-based version
- typedef cc::LazyKVList< cds::gc::DHP, key_type, value_type, DHP_cmp_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< cds::gc::DHP, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
- namespace {
- struct DHP_less_traits : public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
- };
- }
- void LazyKVListTestHeader::DHP_less()
- {
- // traits-based version
- typedef cc::LazyKVList< cds::gc::DHP, key_type, value_type, DHP_less_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< cds::gc::DHP, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
- namespace {
- struct DHP_cmpmix_traits : public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
- typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
- };
- }
- void LazyKVListTestHeader::DHP_cmpmix()
- {
- // traits-based version
- typedef cc::LazyKVList< cds::gc::DHP, key_type, value_type, DHP_cmpmix_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< cds::gc::DHP, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- ,cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
- namespace {
- struct DHP_ic_traits : public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
- void LazyKVListTestHeader::DHP_ic()
- {
- // traits-based version
- typedef cc::LazyKVList< cds::gc::DHP, key_type, value_type, DHP_ic_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< cds::gc::DHP, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<key_type> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
-} // namespace ordlist
-
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_lazy_kv.h"
-#include <cds/container/lazy_kvlist_hp.h>
-
-namespace ordlist {
- namespace {
- struct HP_cmp_traits: public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
- };
-
- }
- void LazyKVListTestHeader::HP_cmp()
- {
- // traits-based version
- typedef cc::LazyKVList< cds::gc::HP, key_type, value_type, HP_cmp_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< cds::gc::HP,
- key_type,
- value_type,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
- namespace {
- struct HP_less_traits : public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
- };
- }
- void LazyKVListTestHeader::HP_less()
- {
- // traits-based version
- typedef cc::LazyKVList< cds::gc::HP, key_type, value_type, HP_less_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< cds::gc::HP, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
- namespace {
- struct HP_cmpmix_traits : public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
- typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
- };
- }
- void LazyKVListTestHeader::HP_cmpmix()
- {
- // traits-based version
- typedef cc::LazyKVList< cds::gc::HP, key_type, value_type, HP_cmpmix_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< cds::gc::HP, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- ,cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
- namespace {
- struct HP_ic_traits : public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
- void LazyKVListTestHeader::HP_ic()
- {
- // traits-based version
- typedef cc::LazyKVList< cds::gc::HP, key_type, value_type, HP_ic_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< cds::gc::HP, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<key_type> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
-} // namespace ordlist
-
-CPPUNIT_TEST_SUITE_REGISTRATION(ordlist::LazyKVListTestHeader);
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_lazy_kv.h"
-#include <cds/container/lazy_kvlist_nogc.h>
-
-namespace ordlist {
- namespace {
- struct NOGC_cmp_traits: public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
- };
-
- }
- void LazyKVListTestHeader::NOGC_cmp()
- {
- // traits-based version
- typedef cc::LazyKVList< cds::gc::nogc, key_type, value_type, NOGC_cmp_traits > list;
- nogc_test< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< cds::gc::nogc,
- key_type,
- value_type,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- >::type
- > opt_list;
- nogc_test< opt_list >();
- }
-
- namespace {
- struct NOGC_less_traits : public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
- };
- }
- void LazyKVListTestHeader::NOGC_less()
- {
- // traits-based version
- typedef cc::LazyKVList< cds::gc::nogc, key_type, value_type, NOGC_less_traits > list;
- nogc_test< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< cds::gc::nogc, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- nogc_test< opt_list >();
- }
-
- namespace {
- struct NOGC_cmpmix_traits : public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
- typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
- };
- }
- void LazyKVListTestHeader::NOGC_cmpmix()
- {
- // traits-based version
- typedef cc::LazyKVList< cds::gc::nogc, key_type, value_type, NOGC_cmpmix_traits > list;
- nogc_test< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< cds::gc::nogc, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- ,cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- nogc_test< opt_list >();
- }
-
- namespace {
- struct NOGC_ic_traits : public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
- void LazyKVListTestHeader::NOGC_ic()
- {
- // traits-based version
- typedef cc::LazyKVList< cds::gc::nogc, key_type, value_type, NOGC_ic_traits > list;
- nogc_test< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< cds::gc::nogc, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<key_type> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- nogc_test< opt_list >();
- }
-
-} // namespace ordlist
-
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_lazy_kv.h"
-#include <cds/urcu/general_buffered.h>
-#include <cds/container/lazy_kvlist_rcu.h>
-
-namespace ordlist {
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type;
-
- struct RCU_GPB_cmp_traits: public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
- };
- }
- void LazyKVListTestHeader::RCU_GPB_cmp()
- {
- // traits-based version
- typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_GPB_cmp_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< rcu_type, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPB_less_traits : public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
- };
- }
- void LazyKVListTestHeader::RCU_GPB_less()
- {
- // traits-based version
- typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_GPB_less_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< rcu_type, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPB_cmpmix_traits : public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
- typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
- };
- }
- void LazyKVListTestHeader::RCU_GPB_cmpmix()
- {
- // traits-based version
- typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_GPB_cmpmix_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< rcu_type, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- ,cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPB_ic_traits : public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
- void LazyKVListTestHeader::RCU_GPB_ic()
- {
- // traits-based version
- typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_GPB_ic_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< rcu_type, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<key_type> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
-} // namespace ordlist
-
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_lazy_kv.h"
-#include <cds/urcu/general_instant.h>
-#include <cds/container/lazy_kvlist_rcu.h>
-
-namespace ordlist {
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type;
-
- struct RCU_GPI_cmp_traits : public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
- };
- }
- void LazyKVListTestHeader::RCU_GPI_cmp()
- {
- // traits-based version
- typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_GPI_cmp_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< rcu_type, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPI_less_traits : public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
- };
- }
- void LazyKVListTestHeader::RCU_GPI_less()
- {
- // traits-based version
- typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_GPI_less_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< rcu_type, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPI_cmpmix_traits : public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
- typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
- };
- }
- void LazyKVListTestHeader::RCU_GPI_cmpmix()
- {
- // traits-based version
- typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_GPI_cmpmix_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< rcu_type, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- ,cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPI_ic_traits : public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
- void LazyKVListTestHeader::RCU_GPI_ic()
- {
- // traits-based version
- typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_GPI_ic_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< rcu_type, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<key_type> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
-} // namespace ordlist
-
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_lazy_kv.h"
-#include <cds/urcu/general_threaded.h>
-#include <cds/container/lazy_kvlist_rcu.h>
-
-namespace ordlist {
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type;
-
- struct RCU_GPT_cmp_traits : public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
- };
- }
- void LazyKVListTestHeader::RCU_GPT_cmp()
- {
- // traits-based version
- typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_GPT_cmp_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< rcu_type, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPT_less_traits : public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
- };
- }
- void LazyKVListTestHeader::RCU_GPT_less()
- {
- // traits-based version
- typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_GPT_less_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< rcu_type, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPT_cmpmix_traits : public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
- typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
- };
- }
- void LazyKVListTestHeader::RCU_GPT_cmpmix()
- {
- // traits-based version
- typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_GPT_cmpmix_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< rcu_type, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- ,cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPT_ic_traits : public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
- void LazyKVListTestHeader::RCU_GPT_ic()
- {
- // traits-based version
- typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_GPT_ic_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< rcu_type, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<key_type> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
-} // namespace ordlist
-
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_lazy_kv.h"
-#include <cds/urcu/signal_buffered.h>
-#include <cds/container/lazy_kvlist_rcu.h>
-
-namespace ordlist {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
-
- struct RCU_SHB_cmp_traits : public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
- };
- }
-#endif
-
- void LazyKVListTestHeader::RCU_SHB_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_SHB_cmp_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< rcu_type, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct RCU_SHB_less_traits: public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
- };
- }
-#endif
-
- void LazyKVListTestHeader::RCU_SHB_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_SHB_less_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< rcu_type, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct RCU_SHB_cmpmix_traits: public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
- typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
- };
- }
-#endif
-
- void LazyKVListTestHeader::RCU_SHB_cmpmix()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_SHB_cmpmix_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< rcu_type, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- ,cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct RCU_SHB_ic_traits: public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
-#endif
-
- void LazyKVListTestHeader::RCU_SHB_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_SHB_ic_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< rcu_type, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<key_type> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-} // namespace ordlist
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_lazy_kv.h"
-#include <cds/urcu/signal_threaded.h>
-#include <cds/container/lazy_kvlist_rcu.h>
-
-namespace ordlist {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type;
-
- struct RCU_SHT_cmp_traits : public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
- };
- }
-#endif
- void LazyKVListTestHeader::RCU_SHT_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_SHT_cmp_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< rcu_type, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct RCU_SHT_less_traits : public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
- };
- }
-#endif
- void LazyKVListTestHeader::RCU_SHT_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_SHT_less_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< rcu_type, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct RCU_SHT_cmpmix_traits: public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::cmp<LazyKVListTestHeader::key_type> compare;
- typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
- };
- }
-#endif
- void LazyKVListTestHeader::RCU_SHT_cmpmix()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_SHT_cmpmix_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< rcu_type, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- ,cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct RCU_SHT_ic_traits: public cc::lazy_list::traits
- {
- typedef LazyKVListTestHeader::lt<LazyKVListTestHeader::key_type> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
-#endif
- void LazyKVListTestHeader::RCU_SHT_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::LazyKVList< rcu_type, key_type, value_type, RCU_SHT_ic_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyKVList< rcu_type, key_type, value_type,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<key_type> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-} // namespace ordlist
-
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_lazy.h"
-#include <cds/container/lazy_list_nogc.h>
-
-namespace ordlist {
- namespace {
- struct NOGC_cmp_traits : public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
- };
- }
- void LazyListTestHeader::NOGC_cmp()
- {
- // traits-based version
- typedef cc::LazyList< cds::gc::nogc, item, NOGC_cmp_traits > list;
- nogc_test< list >();
-
- // option-based version
-
- typedef cc::LazyList< cds::gc::nogc, item,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<item> >
- >::type
- > opt_list;
- nogc_test< opt_list >();
- }
-
- namespace {
- struct NOGC_less_traits : public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
- };
- }
- void LazyListTestHeader::NOGC_less()
- {
- // traits-based version
- typedef cc::LazyList< cds::gc::nogc, item, NOGC_less_traits > list;
- nogc_test< list >();
-
- // option-based version
-
- typedef cc::LazyList< cds::gc::nogc, item,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<item> >
- >::type
- > opt_list;
- nogc_test< opt_list >();
- }
-
- namespace {
- struct NOGC_cmpmix_traits : public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
- typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
- };
- }
- void LazyListTestHeader::NOGC_cmpmix()
- {
- // traits-based version
- typedef cc::LazyList< cds::gc::nogc, item, NOGC_cmpmix_traits > list;
- nogc_test< list >();
-
- // option-based version
-
- typedef cc::LazyList< cds::gc::nogc, item,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<item> >
- ,cc::opt::less< lt<item> >
- >::type
- > opt_list;
- nogc_test< opt_list >();
- }
-
- namespace {
- struct NOGC_ic_traits : public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
- void LazyListTestHeader::NOGC_ic()
- {
- // traits-based version
- typedef cc::LazyList< cds::gc::nogc, item, NOGC_ic_traits > list;
- nogc_test< list >();
-
- // option-based version
-
- typedef cc::LazyList< cds::gc::nogc, item,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<item> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- nogc_test< opt_list >();
- }
-
-} // namespace ordlist
-
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_lazy.h"
-#include <cds/urcu/general_buffered.h>
-#include <cds/container/lazy_list_rcu.h>
-
-namespace ordlist {
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type;
-
- struct RCU_GPB_cmp_traits : public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
- };
- }
- void LazyListTestHeader::RCU_GPB_cmp()
- {
- // traits-based version
- typedef cc::LazyList< rcu_type, item, RCU_GPB_cmp_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyList< rcu_type, item,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPB_less_traits : public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
- };
- }
- void LazyListTestHeader::RCU_GPB_less()
- {
- // traits-based version
- typedef cc::LazyList< rcu_type, item, RCU_GPB_less_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyList< rcu_type, item,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPB_cmpmix_traits : public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
- typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
- };
- }
- void LazyListTestHeader::RCU_GPB_cmpmix()
- {
- // traits-based version
- typedef cc::LazyList< rcu_type, item, RCU_GPB_cmpmix_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyList< rcu_type, item,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<item> >
- ,cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPB_ic_traits : public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
- void LazyListTestHeader::RCU_GPB_ic()
- {
- // traits-based version
- typedef cc::LazyList< rcu_type, item, RCU_GPB_ic_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyList< rcu_type, item,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<item> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
-} // namespace ordlist
-
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_lazy.h"
-#include <cds/urcu/general_instant.h>
-#include <cds/container/lazy_list_rcu.h>
-
-namespace ordlist {
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type;
-
- struct RCU_GPI_cmp_traits : public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
- };
- }
- void LazyListTestHeader::RCU_GPI_cmp()
- {
- // traits-based version
- typedef cc::LazyList< rcu_type, item, RCU_GPI_cmp_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyList< rcu_type, item,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPI_less_traits : public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
- };
- }
- void LazyListTestHeader::RCU_GPI_less()
- {
- // traits-based version
- typedef cc::LazyList< rcu_type, item, RCU_GPI_less_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyList< rcu_type, item,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPI_cmpmix_traits : public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
- typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
- };
- }
- void LazyListTestHeader::RCU_GPI_cmpmix()
- {
- // traits-based version
- typedef cc::LazyList< rcu_type, item, RCU_GPI_cmpmix_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyList< rcu_type, item,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<item> >
- ,cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPI_ic_traits : public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
- void LazyListTestHeader::RCU_GPI_ic()
- {
- // traits-based version
- typedef cc::LazyList< rcu_type, item, RCU_GPI_ic_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyList< rcu_type, item,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<item> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
-} // namespace ordlist
-
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_lazy.h"
-#include <cds/urcu/general_threaded.h>
-#include <cds/container/lazy_list_rcu.h>
-
-namespace ordlist {
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type;
-
- struct RCU_GPT_cmp_traits : public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
- };
- }
- void LazyListTestHeader::RCU_GPT_cmp()
- {
- // traits-based version
- typedef cc::LazyList< rcu_type, item, RCU_GPT_cmp_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyList< rcu_type, item,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPT_less_traits : public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
- };
- }
- void LazyListTestHeader::RCU_GPT_less()
- {
- // traits-based version
- typedef cc::LazyList< rcu_type, item, RCU_GPT_less_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyList< rcu_type, item,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPT_cmpmix_traits : public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
- typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
- };
- }
- void LazyListTestHeader::RCU_GPT_cmpmix()
- {
- // traits-based version
- typedef cc::LazyList< rcu_type, item, RCU_GPT_cmpmix_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyList< rcu_type, item,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<item> >
- ,cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPT_ic_traits : public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
- void LazyListTestHeader::RCU_GPT_ic()
- {
- // traits-based version
- typedef cc::LazyList< rcu_type, item, RCU_GPT_ic_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyList< rcu_type, item,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<item> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
-} // namespace ordlist
-
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_lazy.h"
-#include <cds/urcu/signal_buffered.h>
-#include <cds/container/lazy_list_rcu.h>
-
-namespace ordlist {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
-
- struct RCU_SHB_cmp_traits : public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
- };
- }
-#endif
- void LazyListTestHeader::RCU_SHB_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::LazyList< rcu_type, item, RCU_SHB_cmp_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyList< rcu_type, item,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct RCU_SHB_less_traits : public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
- };
- }
-#endif
- void LazyListTestHeader::RCU_SHB_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::LazyList< rcu_type, item, RCU_SHB_less_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyList< rcu_type, item,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct RCU_SHB_cmpmix_traits: public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
- typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
- };
- }
-#endif
- void LazyListTestHeader::RCU_SHB_cmpmix()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::LazyList< rcu_type, item, RCU_SHB_cmpmix_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyList< rcu_type, item,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<item> >
- ,cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct RCU_SHB_ic_traits: public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
-#endif
- void LazyListTestHeader::RCU_SHB_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::LazyList< rcu_type, item, RCU_SHB_ic_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyList< rcu_type, item,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<item> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-} // namespace ordlist
-
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_lazy.h"
-#include <cds/urcu/signal_threaded.h>
-#include <cds/container/lazy_list_rcu.h>
-
-namespace ordlist {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type;
-
- struct RCU_SHT_cmp_traits : public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
- };
- }
-#endif
- void LazyListTestHeader::RCU_SHT_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::LazyList< rcu_type, item, RCU_SHT_cmp_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyList< rcu_type, item,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct RCU_SHT_less_traits : public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
- };
- }
-#endif
- void LazyListTestHeader::RCU_SHT_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::LazyList< rcu_type, item, RCU_SHT_less_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyList< rcu_type, item,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct RCU_SHT_cmpmix_traits: public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::cmp<LazyListTestHeader::item> compare;
- typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
- };
- }
-#endif
- void LazyListTestHeader::RCU_SHT_cmpmix()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::LazyList< rcu_type, item, RCU_SHT_cmpmix_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyList< rcu_type, item,
- cc::lazy_list::make_traits<
- cc::opt::compare< cmp<item> >
- ,cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct RCU_SHT_ic_traits: public cc::lazy_list::traits
- {
- typedef LazyListTestHeader::lt<LazyListTestHeader::item> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
-#endif
- void LazyListTestHeader::RCU_SHT_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::LazyList< rcu_type, item, RCU_SHT_ic_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::LazyList< rcu_type, item,
- cc::lazy_list::make_traits<
- cc::opt::less< lt<item> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-} // namespace ordlist
-
+++ /dev/null
-//$$CDS-header$$
-
-#ifndef CDSTEST_HDR_MICHAEL_H
-#define CDSTEST_HDR_MICHAEL_H
-
-#include "cppunit/cppunit_proxy.h"
-#include <cds/container/details/michael_list_base.h>
-
-namespace ordlist {
- namespace cc = cds::container;
- namespace co = cds::container::opt;
-
- class MichaelListTestHeader: public CppUnitMini::TestCase
- {
- public:
- struct stat {
- int nEnsureExistsCall;
- int nEnsureNewCall;
-
- stat()
- {
- nEnsureExistsCall
- = nEnsureNewCall
- = 0;
- }
- };
-
- struct item {
- int nKey;
- int nVal;
-
- stat s;
-
- item(int key)
- : nKey( key )
- , nVal( key * 2 )
- , s()
- {}
-
- item(int key, int val)
- : nKey( key )
- , nVal(val)
- , s()
- {}
-
- item( const item& v )
- : nKey( v.nKey )
- , nVal( v.nVal )
- , s()
- {}
-
- int key() const
- {
- return nKey;
- }
- };
-
- template <typename T>
- struct lt
- {
- bool operator ()(const T& v1, const T& v2 ) const
- {
- return v1.key() < v2.key();
- }
-
- template <typename Q>
- bool operator ()(const T& v1, const Q& v2 ) const
- {
- return v1.key() < v2;
- }
-
- template <typename Q>
- bool operator ()(const Q& v1, const T& v2 ) const
- {
- return v1 < v2.key();
- }
- };
-
- template <typename T>
- struct cmp {
- int operator ()(const T& v1, const T& v2 ) const
- {
- if ( v1.key() < v2.key() )
- return -1;
- return v1.key() > v2.key() ? 1 : 0;
- }
-
- template <typename Q>
- int operator ()(const T& v1, const Q& v2 ) const
- {
- if ( v1.key() < v2 )
- return -1;
- return v1.key() > v2 ? 1 : 0;
- }
-
- template <typename Q>
- int operator ()(const Q& v1, const T& v2 ) const
- {
- if ( v1 < v2.key() )
- return -1;
- return v1 > v2.key() ? 1 : 0;
- }
- };
-
- struct insert_functor {
- void operator ()( item& i )
- {
- i.nVal = i.nKey * 1033;
- }
- };
- struct dummy_insert_functor {
- void operator ()( item& /*i*/ )
- {
- // This functor should not be called
- TestCase::current_test()->error( "CPPUNIT_ASSERT", "dummy_insert_functor should not be called", __FILE__, __LINE__ );
- }
- };
-
- struct erase_functor {
- unsigned int nEraseCall;
-
- erase_functor()
- : nEraseCall(0)
- {}
-
- void operator()( item const& /*i*/)
- {
- ++nEraseCall;
- }
- };
-
- static void insert_function( item& i )
- {
- i.nVal = i.nKey * 1024;
- }
- static void dummy_insert_function( item& /*i*/ )
- {
- // This function should not be called
- TestCase::current_test()->error( "CPPUNIT_ASSERT", "dummy_insert_function should not be called", __FILE__, __LINE__ );
- }
-
-
- struct check_value {
- unsigned int m_nMultiplier;
-
- check_value( unsigned int nMultiplier )
- : m_nMultiplier( nMultiplier )
- {}
-
- check_value( const check_value& s )
- : m_nMultiplier( s.m_nMultiplier )
- {}
-
- void operator()( item& i, int )
- {
- CPPUNIT_ASSERT_CURRENT( int(i.nKey * m_nMultiplier) == i.nVal );
- }
- };
-
- struct check_exact_value {
- int m_nExpected;
-
- check_exact_value( int nExpected )
- : m_nExpected( nExpected )
- {}
-
- check_exact_value( check_exact_value const& s)
- : m_nExpected( s.m_nExpected )
- {}
-
- void operator()( item& i, int )
- {
- CPPUNIT_ASSERT_CURRENT( i.nVal == m_nExpected );
- }
- };
-
- struct dummy_check_value {
- void operator()( item& /*i*/, int )
- {
- // This functor should not be called
- TestCase::current_test()->error( "CPPUNIT_ASSERT", "dummy_check_value should not be called", __FILE__, __LINE__ );
- }
- };
-
- struct ensure_functor {
- void operator()( bool /*bNew*/, item& i, int /*n*/ )
- {
- i.nVal = i.nKey * 1024;
- }
- };
-
- static void ensure_func( bool /*bNew*/, item& i, int n )
- {
- i.nVal = n * 1033;
- }
-
- struct other_item
- {
- int nKey;
-
- other_item()
- {}
-
- other_item(int n)
- : nKey(n)
- {}
- };
-
- struct other_less
- {
- template <typename T1, typename T2>
- bool operator()( T1 const& t1, T2 const& t2 ) const
- {
- return t1.nKey < t2.nKey;
- }
- };
-
- protected:
- template <class OrdList>
- void test_with( OrdList& l )
- {
- typedef typename OrdList::value_type value_type;
-
- // The list should be empty
- CPPUNIT_ASSERT( l.empty() );
-
- // insert test
- CPPUNIT_ASSERT( l.insert( 50 ) );
- CPPUNIT_ASSERT( l.insert( item( 25 )) );
- CPPUNIT_ASSERT( l.insert( item( 100 )) );
-
- // insert failed - such key exists
- CPPUNIT_ASSERT( !l.insert( 50 ) );
- CPPUNIT_ASSERT( !l.insert( item( 100 )) );
-
- // clear test
-
- // The list should not be empty
- CPPUNIT_ASSERT( !l.empty() );
- l.clear();
- // and now the list is empty
- CPPUNIT_ASSERT( l.empty() );
-
- // Test insert with functor
-
- CPPUNIT_ASSERT( l.insert( 100, insert_functor() ) );
- // passed by ref
- {
- insert_functor f;
- CPPUNIT_ASSERT( l.insert( item( 25 ), std::ref( f ) ) );
- CPPUNIT_ASSERT( !l.insert( item( 100 ), std::ref( f ) ) );
- }
- // Test insert with function
- CPPUNIT_ASSERT( l.insert( 50, insert_function ));
- CPPUNIT_ASSERT( !l.insert( 25, dummy_insert_function ));
- CPPUNIT_ASSERT( !l.insert( 100, dummy_insert_functor() ));
-
- // The list should not be empty
- CPPUNIT_ASSERT( !l.empty() );
-
- // Check inserted values
- {
- int i;
- i = 100;
- CPPUNIT_ASSERT( l.find( 100 ));
- CPPUNIT_ASSERT( l.find( i, check_value(1033) ));
- {
- check_value f(1033);
- i = 25;
- CPPUNIT_ASSERT( l.find_with( 25, lt<value_type>() ));
- CPPUNIT_ASSERT( l.find_with( i, lt<value_type>(), std::ref( f ) ) );
- }
- i = 50;
- CPPUNIT_ASSERT( l.find( 50 ));
- CPPUNIT_ASSERT( l.find( i, check_value(1024) ));
-
- i = 10;
- CPPUNIT_ASSERT( !l.find_with( 10, lt<value_type>() ));
- CPPUNIT_ASSERT( !l.find_with( i, lt<value_type>(), dummy_check_value() ));
- i = 75;
- CPPUNIT_ASSERT( !l.find( 75 ));
- CPPUNIT_ASSERT( !l.find( i, dummy_check_value() ));
- i = 150;
- CPPUNIT_ASSERT( !l.find( 150 ));
- CPPUNIT_ASSERT( !l.find( i, dummy_check_value() ));
- }
-
- // The list should not be empty
- CPPUNIT_ASSERT( !l.empty() );
- l.clear();
- // and now the list is empty
- CPPUNIT_ASSERT( l.empty() );
-
- // Ensure test
- {
- std::pair<bool, bool> ensureResult;
- ensure_functor f;
- ensureResult = l.ensure( 100, ensure_functor() );
- CPPUNIT_ASSERT( ensureResult.first );
- CPPUNIT_ASSERT( ensureResult.second );
-
- ensureResult = l.ensure( 200, std::ref( f ) );
- CPPUNIT_ASSERT( ensureResult.first );
- CPPUNIT_ASSERT( ensureResult.second );
-
- ensureResult = l.ensure( 50, ensure_func );
- CPPUNIT_ASSERT( ensureResult.first );
- CPPUNIT_ASSERT( ensureResult.second );
-
- int i;
- i = 100;
- CPPUNIT_ASSERT( l.find( i, check_value(1024) ));
- i = 50;
- CPPUNIT_ASSERT( l.find( i, check_value(1033) ));
- i = 200;
- CPPUNIT_ASSERT( l.find( i, check_value(1024) ));
-
- // ensure existing key
- ensureResult = l.ensure( 200, ensure_func );
- CPPUNIT_ASSERT( ensureResult.first );
- CPPUNIT_ASSERT( !ensureResult.second );
- i = 200;
- CPPUNIT_ASSERT( l.find( i, check_value(1033) ));
-
- ensureResult = l.ensure( 50, ensure_functor() );
- CPPUNIT_ASSERT( ensureResult.first );
- CPPUNIT_ASSERT( !ensureResult.second );
- i = 50;
- CPPUNIT_ASSERT( l.find( i, check_value(1024) ));
- }
-
- // erase test (list: 50, 100, 200)
- CPPUNIT_ASSERT( !l.empty() );
- CPPUNIT_ASSERT( l.insert(160));
- CPPUNIT_ASSERT( l.insert(250));
- CPPUNIT_ASSERT( !l.empty() );
-
- CPPUNIT_ASSERT( !l.erase( 150 ));
-
- CPPUNIT_ASSERT( l.erase( 100 ));
- CPPUNIT_ASSERT( !l.erase( 100 ));
-
- CPPUNIT_ASSERT( l.erase_with( 200, lt<value_type>() ));
- CPPUNIT_ASSERT( !l.erase_with( 200, lt<value_type>() ));
-
- {
- erase_functor ef;
- CPPUNIT_ASSERT( ef.nEraseCall == 0 );
- CPPUNIT_ASSERT( l.erase_with( 160, lt<value_type>(), std::ref(ef) ));
- CPPUNIT_ASSERT( ef.nEraseCall == 1 );
- CPPUNIT_ASSERT( !l.erase_with( 160, lt<value_type>(), std::ref(ef) ));
- CPPUNIT_ASSERT( ef.nEraseCall == 1 );
-
- CPPUNIT_ASSERT( l.erase( 250, std::ref(ef) ));
- CPPUNIT_ASSERT( ef.nEraseCall == 2 );
- CPPUNIT_ASSERT( !l.erase( 250, std::ref(ef) ));
- CPPUNIT_ASSERT( ef.nEraseCall == 2 );
- }
-
- CPPUNIT_ASSERT( l.erase( 50 ));
- CPPUNIT_ASSERT( !l.erase( 50 ));
-
- CPPUNIT_ASSERT( l.empty() );
-
- // clear empty list
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
-
- {
- int i;
-
- // insert test
- CPPUNIT_ASSERT( l.emplace( 501 ) );
- CPPUNIT_ASSERT( l.emplace( 251, 152 ));
- CPPUNIT_ASSERT( l.emplace( item( 1001 )) );
-
- // insert failed - such key exists
- CPPUNIT_ASSERT( !l.emplace( 501, 2 ) );
- CPPUNIT_ASSERT( !l.emplace( 251, 10) );
-
- i = 501;
- CPPUNIT_ASSERT( l.find( i, check_exact_value(501*2) ));
- i = 251;
- CPPUNIT_ASSERT( l.find( i, check_exact_value(152) ));
- i = 1001;
- CPPUNIT_ASSERT( l.find( i, check_exact_value(1001*2) ));
-
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
- }
-
- // Iterator test
- {
- int nCount = 100;
- for ( int i = 0; i < nCount; ++i )
- CPPUNIT_ASSERT( l.insert(i) );
-
- {
- typename OrdList::iterator it( l.begin() );
- typename OrdList::const_iterator cit( l.cbegin() );
- CPPUNIT_CHECK( it == cit );
- CPPUNIT_CHECK( it != l.end() );
- CPPUNIT_CHECK( it != l.cend() );
- CPPUNIT_CHECK( cit != l.end() );
- CPPUNIT_CHECK( cit != l.cend() );
- ++it;
- CPPUNIT_CHECK( it != cit );
- CPPUNIT_CHECK( it != l.end() );
- CPPUNIT_CHECK( it != l.cend() );
- CPPUNIT_CHECK( cit != l.end() );
- CPPUNIT_CHECK( cit != l.cend() );
- ++cit;
- CPPUNIT_CHECK( it == cit );
- CPPUNIT_CHECK( it != l.end() );
- CPPUNIT_CHECK( it != l.cend() );
- CPPUNIT_CHECK( cit != l.end() );
- CPPUNIT_CHECK( cit != l.cend() );
- }
-
- int i = 0;
- for ( typename OrdList::iterator it = l.begin(), itEnd = l.end(); it != itEnd; ++it, ++i ) {
- it->nVal = i * 2;
- CPPUNIT_ASSERT( it->nKey == i );
- }
-
- // Check that we have visited all items
- for ( int i = 0; i < nCount; ++i )
- CPPUNIT_ASSERT( l.find( i, check_value(2) ));
-
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
-
- // Const iterator
- for ( int i = 0; i < nCount; ++i )
- CPPUNIT_ASSERT( l.insert(i) );
-
- i = 0;
- const OrdList& rl = l;
- for ( typename OrdList::const_iterator it = rl.begin(), itEnd = rl.end(); it != itEnd; ++it, ++i ) {
- // it->nVal = i * 2 ; // not!
- CPPUNIT_ASSERT( it->nKey == i );
- }
-
- // Check that we have visited all items
- for ( int i = 0; i < nCount; ++i )
- CPPUNIT_ASSERT( l.find( i, check_value(2) ));
-
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
- }
- }
-
- template <typename OrdList>
- void test()
- {
- typedef typename OrdList::guarded_ptr guarded_ptr;
- typedef typename OrdList::value_type value_type;
-
- OrdList l;
- test_with(l);
-
- static int const nLimit = 20;
- int arr[nLimit];
- for ( int i = 0; i < nLimit; i++ )
- arr[i] = i;
- std::random_shuffle( arr, arr + nLimit );
-
- // extract/get
- for ( int i = 0; i < nLimit; ++i )
- l.insert( arr[i] );
- {
- guarded_ptr gp;
- for ( int i = 0; i < nLimit; ++i ) {
- int nKey = arr[i];
-
- gp = l.get( nKey );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->nKey == nKey );
- CPPUNIT_CHECK( gp->nVal == nKey * 2 );
- gp.release();
-
- gp = l.extract( nKey );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->nKey == nKey );
- CPPUNIT_CHECK( gp->nVal == nKey*2 );
- gp.release();
-
- gp = l.get( nKey );
- CPPUNIT_CHECK( !gp );
- CPPUNIT_CHECK( gp.empty());
- CPPUNIT_CHECK( !l.extract( nKey));
- CPPUNIT_CHECK( gp.empty());
- }
- CPPUNIT_ASSERT( l.empty());
- CPPUNIT_CHECK( !l.get(arr[0]));
- CPPUNIT_CHECK( gp.empty());
- CPPUNIT_CHECK( !l.extract( arr[0]));
- CPPUNIT_CHECK( gp.empty());
- }
-
- // extract_with/get_with
- for ( int i = 0; i < nLimit; ++i )
- l.insert( arr[i] );
- {
- guarded_ptr gp;
- for ( int i = 0; i < nLimit; ++i ) {
- int nKey = arr[i];
- other_item key( nKey );
-
- gp = l.get_with( key, other_less() );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->nKey == nKey );
- CPPUNIT_CHECK( gp->nVal == nKey * 2 );
- gp.release();
-
- gp = l.extract_with( key, other_less() );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->nKey == nKey );
- CPPUNIT_CHECK( gp->nVal == nKey*2 );
- gp.release();
-
- gp = l.get_with( key, other_less() );
- CPPUNIT_CHECK( !gp );
- CPPUNIT_CHECK( gp.empty());
- CPPUNIT_CHECK( !l.extract_with( key, other_less()));
- CPPUNIT_CHECK( gp.empty());
- }
- CPPUNIT_ASSERT( l.empty());
- CPPUNIT_CHECK( !l.get_with(other_item(arr[0]), other_less()));
- CPPUNIT_CHECK( gp.empty());
- CPPUNIT_CHECK( !l.extract_with( other_item(arr[0]), other_less()));
- CPPUNIT_CHECK( gp.empty());
- }
- }
-
- template <typename OrdList>
- void test_rcu()
- {
- OrdList l;
- test_with(l);
-
- static int const nLimit = 20;
-
- typedef typename OrdList::rcu_lock rcu_lock;
- typedef typename OrdList::value_type value_type;
- typedef typename OrdList::gc rcu_type;
-
- {
- int a[nLimit];
- for (int i = 0; i < nLimit; ++i)
- a[i]=i;
- std::random_shuffle( a, a + nLimit );
-
- // extract/get
- for ( int i = 0; i < nLimit; ++i )
- CPPUNIT_ASSERT( l.insert( a[i] ) );
-
- typename OrdList::exempt_ptr ep;
-
- for ( int i = 0; i < nLimit; ++i ) {
- {
- rcu_lock lock;
- value_type * pGet = l.get( a[i] );
- CPPUNIT_ASSERT( pGet != nullptr );
- CPPUNIT_CHECK( pGet->nKey == a[i] );
- CPPUNIT_CHECK( pGet->nVal == a[i] * 2 );
-
- ep = l.extract( a[i] );
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty() );
- CPPUNIT_CHECK( ep->nKey == a[i] );
- CPPUNIT_CHECK( (*ep).nVal == a[i] * 2 );
- }
- ep.release();
- {
- rcu_lock lock;
- CPPUNIT_CHECK( l.get( a[i] ) == nullptr );
- ep = l.extract( a[i] );
- CPPUNIT_CHECK( !ep );
- CPPUNIT_CHECK( ep.empty() );
- }
- }
- CPPUNIT_ASSERT( l.empty() );
-
- {
- rcu_lock lock;
- CPPUNIT_CHECK( l.get( a[0] ) == nullptr );
- CPPUNIT_CHECK( !l.extract( a[0] ) );
- CPPUNIT_CHECK( ep.empty() );
- }
-
- // extract_with/get_with
- for ( int i = 0; i < nLimit; ++i ) {
- CPPUNIT_ASSERT( l.insert( a[i] ) );
- }
-
- for ( int i = 0; i < nLimit; ++i ) {
- other_item itm( a[i] );
- {
- rcu_lock lock;
- value_type * pGet = l.get_with( itm, other_less() );
- CPPUNIT_ASSERT( pGet != nullptr );
- CPPUNIT_CHECK( pGet->nKey == a[i] );
- CPPUNIT_CHECK( pGet->nVal == a[i] * 2 );
-
- ep = l.extract_with( itm, other_less() );
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty() );
- CPPUNIT_CHECK( ep->nKey == a[i] );
- CPPUNIT_CHECK( ep->nVal == a[i] * 2 );
- }
- ep.release();
- {
- rcu_lock lock;
- CPPUNIT_CHECK( l.get_with( itm, other_less() ) == nullptr );
- ep = l.extract_with( itm, other_less() );
- CPPUNIT_CHECK( !ep );
- CPPUNIT_CHECK( ep.empty() );
- }
- }
- CPPUNIT_ASSERT( l.empty() );
-
- {
- rcu_lock lock;
- CPPUNIT_CHECK( l.get_with( other_item( 0 ), other_less() ) == nullptr );
- CPPUNIT_CHECK( !l.extract_with( other_item(0), other_less() ));
- CPPUNIT_CHECK( ep.empty() );
- }
- }
-
- }
-
- template <class OrdList>
- void nogc_test()
- {
- typedef OrdList list;
- typedef typename list::value_type value_type;
- typedef std::pair<typename list::iterator, bool> ensure_result;
-
- typename list::iterator it;
-
- list l;
- CPPUNIT_ASSERT( l.empty() );
- CPPUNIT_ASSERT( l.insert(50) != l.end() );
- CPPUNIT_ASSERT( !l.empty() );
-
- ensure_result eres = l.ensure( item(100, 33) );
- CPPUNIT_ASSERT( eres.second );
- CPPUNIT_ASSERT( eres.first != l.end() );
- CPPUNIT_ASSERT( l.insert( item(150) ) != l.end() );
-
- CPPUNIT_ASSERT( l.insert(100) == l.end() );
- eres = l.ensure( item(50, 33) );
- CPPUNIT_ASSERT( !eres.second );
- CPPUNIT_ASSERT( eres.first->nVal == eres.first->nKey * 2 );
- eres.first->nVal = 63;
-
- it = l.find( 33 );
- CPPUNIT_ASSERT( it == l.end() );
-
- it = l.find( 50 );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it->nKey == 50 );
- CPPUNIT_ASSERT( it->nVal == 63 );
-
- it = l.find_with( 100, lt<value_type>() );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it->nKey == 100 );
- CPPUNIT_ASSERT( it->nVal == 33 );
-
- it = l.find( 150 );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it->nKey == 150 );
- CPPUNIT_ASSERT( it->nVal == it->nKey * 2 );
-
- CPPUNIT_ASSERT( !l.empty() );
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
-
- // insert test
- CPPUNIT_ASSERT( l.emplace( 501 ) != l.end() );
- CPPUNIT_ASSERT( l.emplace( 251, 152 ) != l.end());
- CPPUNIT_ASSERT( l.emplace( item( 1001 )) != l.end() );
-
- // insert failed - such key exists
- CPPUNIT_ASSERT( l.emplace( 501, 2 ) == l.end() );
- CPPUNIT_ASSERT( l.emplace( 251, 10) == l.end() );
-
- it = l.find( 501 );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it->nKey == 501 );
- CPPUNIT_ASSERT( it->nVal == 501 * 2 );
-
- it = l.find( 251 );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it->nKey == 251 );
- CPPUNIT_ASSERT( it->nVal == 152 );
-
- it = l.find( 1001 );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it->nKey == 1001 );
- CPPUNIT_ASSERT( it->nVal == 1001 * 2 );
-
- {
- typename OrdList::iterator it( l.begin() );
- typename OrdList::const_iterator cit( l.cbegin() );
- CPPUNIT_CHECK( it == cit );
- CPPUNIT_CHECK( it != l.end() );
- CPPUNIT_CHECK( it != l.cend() );
- CPPUNIT_CHECK( cit != l.end() );
- CPPUNIT_CHECK( cit != l.cend() );
- ++it;
- CPPUNIT_CHECK( it != cit );
- CPPUNIT_CHECK( it != l.end() );
- CPPUNIT_CHECK( it != l.cend() );
- CPPUNIT_CHECK( cit != l.end() );
- CPPUNIT_CHECK( cit != l.cend() );
- ++cit;
- CPPUNIT_CHECK( it == cit );
- CPPUNIT_CHECK( it != l.end() );
- CPPUNIT_CHECK( it != l.cend() );
- CPPUNIT_CHECK( cit != l.end() );
- CPPUNIT_CHECK( cit != l.cend() );
- }
-
-
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
- }
-
- void HP_cmp();
- void HP_less();
- void HP_cmpmix();
- void HP_ic();
-
- void DHP_cmp();
- void DHP_less();
- void DHP_cmpmix();
- void DHP_ic();
-
- void RCU_GPI_cmp();
- void RCU_GPI_less();
- void RCU_GPI_cmpmix();
- void RCU_GPI_ic();
-
- void RCU_GPB_cmp();
- void RCU_GPB_less();
- void RCU_GPB_cmpmix();
- void RCU_GPB_ic();
-
- void RCU_GPT_cmp();
- void RCU_GPT_less();
- void RCU_GPT_cmpmix();
- void RCU_GPT_ic();
-
- void RCU_SHB_cmp();
- void RCU_SHB_less();
- void RCU_SHB_cmpmix();
- void RCU_SHB_ic();
-
- void RCU_SHT_cmp();
- void RCU_SHT_less();
- void RCU_SHT_cmpmix();
- void RCU_SHT_ic();
-
- void NOGC_cmp();
- void NOGC_less();
- void NOGC_cmpmix();
- void NOGC_ic();
-
- CPPUNIT_TEST_SUITE(MichaelListTestHeader)
- CPPUNIT_TEST(HP_cmp)
- CPPUNIT_TEST(HP_less)
- CPPUNIT_TEST(HP_cmpmix)
- CPPUNIT_TEST(HP_ic)
-
- CPPUNIT_TEST(DHP_cmp)
- CPPUNIT_TEST(DHP_less)
- CPPUNIT_TEST(DHP_cmpmix)
- CPPUNIT_TEST(DHP_ic)
-
- CPPUNIT_TEST(RCU_GPI_cmp)
- CPPUNIT_TEST(RCU_GPI_less)
- CPPUNIT_TEST(RCU_GPI_cmpmix)
- CPPUNIT_TEST(RCU_GPI_ic)
-
- CPPUNIT_TEST(RCU_GPB_cmp)
- CPPUNIT_TEST(RCU_GPB_less)
- CPPUNIT_TEST(RCU_GPB_cmpmix)
- CPPUNIT_TEST(RCU_GPB_ic)
-
- CPPUNIT_TEST(RCU_GPT_cmp)
- CPPUNIT_TEST(RCU_GPT_less)
- CPPUNIT_TEST(RCU_GPT_cmpmix)
- CPPUNIT_TEST(RCU_GPT_ic)
-
- CPPUNIT_TEST(RCU_SHB_cmp)
- CPPUNIT_TEST(RCU_SHB_less)
- CPPUNIT_TEST(RCU_SHB_cmpmix)
- CPPUNIT_TEST(RCU_SHB_ic)
-
- CPPUNIT_TEST(RCU_SHT_cmp)
- CPPUNIT_TEST(RCU_SHT_less)
- CPPUNIT_TEST(RCU_SHT_cmpmix)
- CPPUNIT_TEST(RCU_SHT_ic)
-
- CPPUNIT_TEST(NOGC_cmp)
- CPPUNIT_TEST(NOGC_less)
- CPPUNIT_TEST(NOGC_cmpmix)
- CPPUNIT_TEST(NOGC_ic)
- CPPUNIT_TEST_SUITE_END()
- };
-
-} // namespace ordlist
-
-#endif // #ifndef CDSTEST_HDR_MICHAEL_H
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_michael.h"
-#include <cds/container/michael_list_dhp.h>
-
-namespace ordlist {
- namespace {
- struct DHP_cmp_traits: public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
- };
- }
- void MichaelListTestHeader::DHP_cmp()
- {
- // traits-based version
- typedef cc::MichaelList< cds::gc::DHP, item, DHP_cmp_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::MichaelList< cds::gc::DHP, item,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<item> >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
- namespace {
- struct DHP_less_traits: public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
- };
- }
- void MichaelListTestHeader::DHP_less()
- {
- // traits-based version
- typedef cc::MichaelList< cds::gc::DHP, item, DHP_less_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::MichaelList< cds::gc::DHP, item,
- cc::michael_list::make_traits<
- cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
- namespace {
- struct DHP_cmpmix_traits: public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
- typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
- };
- }
- void MichaelListTestHeader::DHP_cmpmix()
- {
- // traits-based version
- typedef cc::MichaelList< cds::gc::DHP, item, DHP_cmpmix_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::MichaelList< cds::gc::DHP, item,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<item> >
- ,cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
- namespace {
- struct DHP_ic_traits: public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
- void MichaelListTestHeader::DHP_ic()
- {
- // traits-based version
- typedef cc::MichaelList< cds::gc::DHP, item, DHP_ic_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::MichaelList< cds::gc::DHP, item,
- cc::michael_list::make_traits<
- cc::opt::less< lt<item> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
-} // namespace ordlist
-
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_michael.h"
-#include <cds/container/michael_list_hp.h>
-
-namespace ordlist {
- namespace {
- struct HP_cmp_traits: public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
- };
-
- }
- void MichaelListTestHeader::HP_cmp()
- {
- // traits-based version
- typedef cc::MichaelList< cds::gc::HP, item, HP_cmp_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::MichaelList< cds::gc::HP, item,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<item> >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
- namespace {
- struct HP_less_traits: public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
- };
- }
- void MichaelListTestHeader::HP_less()
- {
- // traits-based version
- typedef cc::MichaelList< cds::gc::HP, item, HP_less_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::MichaelList< cds::gc::HP, item,
- cc::michael_list::make_traits<
- cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
- namespace {
- struct HP_cmpmix_traits: public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
- typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
- };
- }
- void MichaelListTestHeader::HP_cmpmix()
- {
- // traits-based version
- typedef cc::MichaelList< cds::gc::HP, item, HP_cmpmix_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::MichaelList< cds::gc::HP, item,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<item> >
- ,cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
- namespace {
- struct HP_ic_traits: public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
- void MichaelListTestHeader::HP_ic()
- {
- // traits-based version
- typedef cc::MichaelList< cds::gc::HP, item, HP_ic_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::MichaelList< cds::gc::HP, item,
- cc::michael_list::make_traits<
- cc::opt::less< lt<item> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
-} // namespace ordlist
-
-CPPUNIT_TEST_SUITE_REGISTRATION(ordlist::MichaelListTestHeader);
+++ /dev/null
-//$$CDS-header$$
-
-#ifndef CDSTEST_HDR_MICHAEL_KV_H
-#define CDSTEST_HDR_MICHAEL_KV_H
-
-#include "cppunit/cppunit_proxy.h"
-#include <cds/container/details/michael_list_base.h>
-
-namespace ordlist {
- namespace cc = cds::container;
- namespace co = cds::container::opt;
-
- class MichaelKVListTestHeader: public CppUnitMini::TestCase
- {
- public:
- typedef int key_type;
- struct value_type {
- int m_val;
-
- value_type()
- : m_val(0)
- {}
-
- value_type( int n )
- : m_val( n )
- {}
- };
-
- template <typename T>
- struct lt
- {
- bool operator ()(const T& v1, const T& v2 ) const
- {
- return v1 < v2;
- }
- };
-
- template <typename T>
- struct cmp {
- int operator ()(const T& v1, const T& v2 ) const
- {
- if ( v1 < v2 )
- return -1;
- return v1 > v2 ? 1 : 0;
- }
- };
-
- struct check_value {
- int m_nExpected;
-
- check_value( int nExpected )
- : m_nExpected( nExpected )
- {}
-
- template <typename T>
- void operator ()( T& pair )
- {
- CPPUNIT_ASSERT_CURRENT( pair.second.m_val == m_nExpected );
- }
- };
-
- struct insert_functor {
- template <typename T>
- void operator()( T& pair )
- {
- pair.second.m_val = pair.first * 10;
- }
- };
-
- struct ensure_functor {
- template <typename T>
- void operator()( bool /*bNew*/, T& pair )
- {
- pair.second.m_val = pair.first * 50;
- }
- };
-
- struct erase_functor {
- int nKey;
- int nVal;
-
- erase_functor()
- : nKey(0)
- , nVal(0)
- {}
-
- template <typename T>
- void operator()( T& i )
- {
- nKey = i.first;
- nVal = i.second.m_val;
- }
- };
-
- typedef float other_key;
- struct other_less {
- bool operator()( float f, int i ) const
- {
- return int(f) < i;
- }
- bool operator()( int i, float f ) const
- {
- return i < int(f);
- }
- };
-
- protected:
- template <class OrdList>
- void test_with( OrdList& l)
- {
- typedef typename OrdList::value_type value_type;
-
- typename OrdList::iterator itTest;
- typename OrdList::const_iterator citTest;
-
- CPPUNIT_ASSERT( l.empty() );
-
- // insert / find test
- CPPUNIT_ASSERT( !l.find( 100 ));
- CPPUNIT_ASSERT( l.insert( 100 ));
- CPPUNIT_ASSERT( !l.empty() );
- CPPUNIT_ASSERT( l.find( 100 ));
-
- check_value chk(0);
- CPPUNIT_ASSERT( l.find( 100, std::ref( chk ) ) );
-
- CPPUNIT_ASSERT( !l.find_with( 50, lt<key_type>() ));
- CPPUNIT_ASSERT( l.insert( 50, 500 ));
- CPPUNIT_ASSERT( l.find_with( 50, lt<key_type>() ));
- CPPUNIT_ASSERT( !l.insert( 50, 5 ));
- chk.m_nExpected = 500;
- CPPUNIT_ASSERT( l.find_with( 50, lt<key_type>(), std::ref( chk ) ) );
- chk.m_nExpected = 0;
- CPPUNIT_ASSERT( l.find_with( 100, lt<key_type>(), std::ref( chk ) ) );
- CPPUNIT_ASSERT( !l.empty() );
-
- CPPUNIT_ASSERT( !l.find( 150 ));
- CPPUNIT_ASSERT( l.insert_with( 150, insert_functor() ));
- CPPUNIT_ASSERT( l.find( 150 ));
- chk.m_nExpected = 1500;
- CPPUNIT_ASSERT( l.find( 150, std::ref( chk ) ) );
- chk.m_nExpected = 0;
- CPPUNIT_ASSERT( l.find( 100, std::ref( chk ) ) );
- chk.m_nExpected = 500;
- CPPUNIT_ASSERT( l.find( 50, std::ref( chk ) ) );
- CPPUNIT_ASSERT( !l.empty() );
-
- // erase test
-
- CPPUNIT_ASSERT( !l.erase( 500 ));
- CPPUNIT_ASSERT( !l.empty() );
-
- CPPUNIT_ASSERT( l.find( 50 ));
- {
- erase_functor ef;
- l.erase( 50, std::ref( ef ) );
- CPPUNIT_ASSERT( ef.nKey == 50 );
- CPPUNIT_ASSERT( ef.nVal == 500 );
- }
- CPPUNIT_ASSERT( !l.find( 50 ));
-
- // ensure test
- std::pair<bool, bool> bEnsureResult;
- bEnsureResult = l.ensure( 100, ensure_functor() );
- CPPUNIT_ASSERT( bEnsureResult.first );
- CPPUNIT_ASSERT( !bEnsureResult.second );
- chk.m_nExpected = 5000;
- CPPUNIT_ASSERT( l.find( 100, std::ref( chk ) ) );
-
- {
- ensure_functor ef;
- bEnsureResult = l.ensure( 50, std::ref( ef ) );
- }
- CPPUNIT_ASSERT( bEnsureResult.first );
- CPPUNIT_ASSERT( bEnsureResult.second );
- chk.m_nExpected = 2500;
- CPPUNIT_ASSERT( l.find( 50, std::ref( chk ) ) );
-
- // erase test
- CPPUNIT_ASSERT( !l.empty() );
- CPPUNIT_ASSERT( l.insert_with( 200, insert_functor() ));
- CPPUNIT_ASSERT( l.insert( 25 ));
- CPPUNIT_ASSERT( l.erase( 100 ));
- CPPUNIT_ASSERT( l.erase( 150 ));
- {
- erase_functor ef;
- CPPUNIT_ASSERT( l.erase_with( 200, lt<key_type>(), std::ref(ef)) );
- CPPUNIT_ASSERT( ef.nKey == 200 );
- CPPUNIT_ASSERT( ef.nVal == 2000 );
- }
- CPPUNIT_ASSERT( l.erase_with( 25, lt<key_type>()))
- CPPUNIT_ASSERT( l.erase( 50 ));
- CPPUNIT_ASSERT( l.empty() );
-
- // clear empty list
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
-
- // insert test
- CPPUNIT_ASSERT( l.emplace( 501 ) );
- CPPUNIT_ASSERT( l.emplace( 251, 152 ));
-
- // insert failed - such key exists
- CPPUNIT_ASSERT( !l.emplace( 501, 2 ) );
- CPPUNIT_ASSERT( !l.emplace( 251, 10) );
-
- check_value cv(0);
- CPPUNIT_ASSERT( l.find( 501, std::ref(cv) ));
- cv.m_nExpected = 152;
- CPPUNIT_ASSERT( l.find( 251, std::ref(cv) ));
-
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
-
- // Iterator test
- {
- int nCount = 100;
- for ( int i = 0; i < nCount; ++i )
- CPPUNIT_ASSERT( l.insert(i, i * 2 ) );
-
- {
- typename OrdList::iterator it( l.begin() );
- typename OrdList::const_iterator cit( l.cbegin() );
- CPPUNIT_CHECK( it == cit );
- CPPUNIT_CHECK( it != l.end() );
- CPPUNIT_CHECK( it != l.cend() );
- CPPUNIT_CHECK( cit != l.end() );
- CPPUNIT_CHECK( cit != l.cend() );
- ++it;
- CPPUNIT_CHECK( it != cit );
- CPPUNIT_CHECK( it != l.end() );
- CPPUNIT_CHECK( it != l.cend() );
- CPPUNIT_CHECK( cit != l.end() );
- CPPUNIT_CHECK( cit != l.cend() );
- ++cit;
- CPPUNIT_CHECK( it == cit );
- CPPUNIT_CHECK( it != l.end() );
- CPPUNIT_CHECK( it != l.cend() );
- CPPUNIT_CHECK( cit != l.end() );
- CPPUNIT_CHECK( cit != l.cend() );
- }
-
- int i = 0;
- for ( typename OrdList::iterator it = l.begin(), itEnd = l.end(); it != itEnd; ++it, ++i ) {
- CPPUNIT_ASSERT( it.key() == i );
- CPPUNIT_ASSERT( it->first == i );
- CPPUNIT_ASSERT( (*it).first == i );
-
- CPPUNIT_ASSERT( it.val().m_val == i * 2 );
- CPPUNIT_ASSERT( it->second.m_val == i * 2 );
- CPPUNIT_ASSERT( (*it).second.m_val == i * 2 );
- it.val().m_val = i * 3;
- }
-
- // Check that we have visited all items
- for ( int i = 0; i < nCount; ++i ) {
- chk.m_nExpected = i * 3;
- CPPUNIT_ASSERT( l.find( i, std::ref( chk ) ) );
- }
-
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
-
- // Const iterator
- for ( int i = 0; i < nCount; ++i )
- CPPUNIT_ASSERT( l.insert(i, i * 7) );
-
- i = 0;
- const OrdList& rl = l;
- for ( typename OrdList::const_iterator it = rl.begin(), itEnd = rl.end(); it != itEnd; ++it, ++i ) {
- CPPUNIT_ASSERT( it.key() == i );
- CPPUNIT_ASSERT( it->first == i );
- CPPUNIT_ASSERT( (*it).first == i );
-
- CPPUNIT_ASSERT( it.val().m_val == i * 7 );
- CPPUNIT_ASSERT( it->second.m_val == i * 7 );
- CPPUNIT_ASSERT( (*it).second.m_val == i * 7 );
- }
-
- // Check that we have visited all items
- for ( int i = 0; i < nCount; ++i ) {
- chk.m_nExpected = i * 7;
- CPPUNIT_ASSERT( l.find_with( i, lt<key_type>(), std::ref( chk ) ) );
- }
-
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
- }
- }
-
- template <class OrdList>
- void test()
- {
- OrdList l;
- test_with(l);
-
- typedef typename OrdList::guarded_ptr guarded_ptr;
-
- static int const nLimit = 20;
- int arr[nLimit];
- for ( int i = 0; i < nLimit; i++ )
- arr[i] = i;
- std::random_shuffle( arr, arr + nLimit );
-
- // extract/get
- for ( int i = 0; i < nLimit; ++i )
- l.insert( arr[i], arr[i] * 2 );
- {
- guarded_ptr gp;
- for ( int i = 0; i < nLimit; ++i ) {
- int nKey = arr[i];
-
- gp = l.get( nKey );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->first == nKey );
- CPPUNIT_CHECK( gp->second.m_val == nKey * 2 );
- gp.release();
- CPPUNIT_CHECK( gp.empty() );
-
- gp = l.extract( nKey );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->first == nKey );
- CPPUNIT_CHECK( gp->second.m_val == nKey*2 );
- gp.release();
-
- gp = l.get( nKey );
- CPPUNIT_CHECK( !gp );
- CPPUNIT_CHECK( gp.empty());
- CPPUNIT_CHECK( !l.extract( nKey));
- CPPUNIT_CHECK( gp.empty());
- }
- CPPUNIT_ASSERT( l.empty());
- CPPUNIT_CHECK( !l.get(arr[0]));
- CPPUNIT_CHECK( gp.empty());
- CPPUNIT_CHECK( !l.extract( arr[0]));
- CPPUNIT_CHECK( gp.empty());
- }
-
- // extract_with/get_with
- for ( int i = 0; i < nLimit; ++i )
- l.insert( arr[i], arr[i] * 2 );
- {
- guarded_ptr gp;
- for ( int i = 0; i < nLimit; ++i ) {
- int nKey = arr[i];
- other_key key = float(nKey + 0.3);
-
- gp = l.get_with( key, other_less() );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->first == nKey );
- CPPUNIT_CHECK( gp->second.m_val == nKey * 2 );
- gp.release();
-
- gp = l.extract_with( key, other_less() );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->first == nKey );
- CPPUNIT_CHECK( gp->second.m_val == nKey*2 );
- gp.release();
-
- gp = l.get_with( key, other_less() );
- CPPUNIT_CHECK( !gp );
- CPPUNIT_CHECK( gp.empty());
- CPPUNIT_CHECK( !l.extract_with( key, other_less()));
- CPPUNIT_CHECK( gp.empty());
- }
- CPPUNIT_ASSERT( l.empty());
- CPPUNIT_CHECK( !l.get_with( 3.4f, other_less()));
- CPPUNIT_CHECK( gp.empty());
- CPPUNIT_CHECK( !l.extract_with( 3.4f, other_less()));
- CPPUNIT_CHECK( gp.empty());
- }
- }
-
- template <class OrdList>
- void test_rcu()
- {
- OrdList l;
- test_with(l);
-
- static int const nLimit = 20;
-
- typedef typename OrdList::rcu_lock rcu_lock;
- typedef typename OrdList::value_type value_type;
- typedef typename OrdList::gc rcu_type;
-
- {
- int a[nLimit];
- for (int i = 0; i < nLimit; ++i)
- a[i]=i;
- std::random_shuffle( a, a + nLimit );
-
- // extract/get
- for ( int i = 0; i < nLimit; ++i )
- CPPUNIT_ASSERT( l.insert( a[i], a[i]*2 ) );
-
- typename OrdList::exempt_ptr ep;
-
- for ( int i = 0; i < nLimit; ++i ) {
- {
- rcu_lock lock;
- value_type * pGet = l.get( a[i] );
- CPPUNIT_ASSERT( pGet != nullptr );
- CPPUNIT_CHECK( pGet->first == a[i] );
- CPPUNIT_CHECK( pGet->second.m_val == a[i] * 2 );
-
- ep = l.extract( a[i] );
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty() );
- CPPUNIT_CHECK( ep->first == a[i] );
- CPPUNIT_CHECK( (*ep).second.m_val == a[i] * 2 );
- }
- ep.release();
- {
- rcu_lock lock;
- CPPUNIT_CHECK( l.get( a[i] ) == nullptr );
- ep = l.extract( a[i] );
- CPPUNIT_CHECK( !ep );
- CPPUNIT_CHECK( ep.empty() );
- }
- }
- CPPUNIT_ASSERT( l.empty() );
-
- {
- rcu_lock lock;
- CPPUNIT_CHECK( l.get( a[0] ) == nullptr );
- CPPUNIT_CHECK( !l.extract( a[0] ) );
- CPPUNIT_CHECK( ep.empty() );
- }
-
- // extract_with/get_with
- for ( int i = 0; i < nLimit; ++i ) {
- CPPUNIT_ASSERT( l.insert( a[i], a[i]*2 ) );
- }
-
- for ( int i = 0; i < nLimit; ++i ) {
- float itm = a[i] + 0.3f;
- {
- rcu_lock lock;
- value_type * pGet = l.get_with( itm, other_less() );
- CPPUNIT_ASSERT( pGet != nullptr );
- CPPUNIT_CHECK( pGet->first == a[i] );
- CPPUNIT_CHECK( pGet->second.m_val == a[i] * 2 );
-
- ep = l.extract_with( itm, other_less() );
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty() );
- CPPUNIT_CHECK( ep->first == a[i] );
- CPPUNIT_CHECK( ep->second.m_val == a[i] * 2 );
- }
- ep.release();
- {
- rcu_lock lock;
- CPPUNIT_CHECK( l.get_with( itm, other_less() ) == nullptr );
- ep = l.extract_with( itm, other_less() );
- CPPUNIT_CHECK( !ep );
- CPPUNIT_CHECK( ep.empty() );
- }
- }
- CPPUNIT_ASSERT( l.empty() );
-
- {
- rcu_lock lock;
- CPPUNIT_CHECK( l.get_with( 3.14f, other_less() ) == nullptr );
- CPPUNIT_CHECK( !l.extract_with( 3.14f, other_less() ));
- CPPUNIT_CHECK( ep.empty() );
- }
- }
-
- }
-
- template <class OrdList>
- void nogc_test()
- {
- typedef typename OrdList::value_type value_type;
- typedef typename OrdList::iterator iterator;
-
- {
- OrdList l;
- iterator it;
-
- CPPUNIT_ASSERT( l.empty() );
-
- // insert / find test
- CPPUNIT_ASSERT( l.find( 100 ) == l.end() );
- CPPUNIT_ASSERT( l.insert( 100 ) != l.end() );
- CPPUNIT_ASSERT( !l.empty() );
- it = l.find_with( 100, lt<key_type>() );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it.key() == 100 );
- CPPUNIT_ASSERT( it.val().m_val == 0 );
-
- CPPUNIT_ASSERT( l.find_with( 50, lt<key_type>() ) == l.end() );
- CPPUNIT_ASSERT( l.insert( 50, 500 ) != l.end());
- it = l.find( 50 );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it.key() == 50 );
- CPPUNIT_ASSERT( it.val().m_val == 500 );
-
- CPPUNIT_ASSERT( l.insert( 50, 5 ) == l.end() );
- it = l.find( 50 );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it.key() == 50 );
- CPPUNIT_ASSERT( it.val().m_val == 500 );
- CPPUNIT_ASSERT( !l.empty() );
-
- CPPUNIT_ASSERT( l.find( 150 ) == l.end() );
- CPPUNIT_ASSERT( l.insert_with( 150, insert_functor() ) != l.end() );
- it = l.find( 150 );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it.key() == 150 );
- CPPUNIT_ASSERT( it.val().m_val == 1500 );
- it = l.find( 100 );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it.key() == 100 );
- CPPUNIT_ASSERT( it.val().m_val == 0 );
- it = l.find( 50 );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it.key() == 50 );
- CPPUNIT_ASSERT( it.val().m_val == 500 );
- it.val().m_val = 25;
- it = l.find( 50 );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it.key() == 50 );
- CPPUNIT_ASSERT( it.val().m_val == 25 );
- CPPUNIT_ASSERT( !l.empty() );
-
- // ensure existing item
- std::pair<iterator, bool> ensureResult;
- ensureResult = l.ensure( 100 );
- CPPUNIT_ASSERT( !ensureResult.second );
- CPPUNIT_ASSERT( ensureResult.first.key() == 100 );
- CPPUNIT_ASSERT( ensureResult.first.val().m_val == 0 );
- ensureResult.first.val().m_val = 5;
- it = l.find( 100 );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it.key() == 100 );
- CPPUNIT_ASSERT( it.val().m_val == 5 );
-
- CPPUNIT_ASSERT( !l.empty() );
-
- // ensure new item
- ensureResult = l.ensure( 1000 );
- CPPUNIT_ASSERT( ensureResult.second );
- CPPUNIT_ASSERT( ensureResult.first.key() == 1000 );
- CPPUNIT_ASSERT( ensureResult.first.val().m_val == 0 );
- ensureResult.first.val().m_val = 33;
- ensureResult = l.ensure( 1000 );
- CPPUNIT_ASSERT( !ensureResult.second );
- CPPUNIT_ASSERT( ensureResult.first.key() == 1000 );
- CPPUNIT_ASSERT( ensureResult.first.val().m_val == 33 );
-
- // clear test
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
-
- // insert test
- CPPUNIT_ASSERT( l.emplace( 501 ) != l.end());
- CPPUNIT_ASSERT( l.emplace( 251, 152 ) != l.end());
-
- // insert failed - such key exists
- CPPUNIT_ASSERT( l.emplace( 501, 2 ) == l.end());
- CPPUNIT_ASSERT( l.emplace( 251, 10) == l.end());
-
- it = l.find( 501 );
- CPPUNIT_ASSERT( it != l.end());
- CPPUNIT_ASSERT( it.key() == 501 );
- CPPUNIT_ASSERT( it.val().m_val == 0 );
-
- it = l.find( 251 );
- CPPUNIT_ASSERT( it != l.end());
- CPPUNIT_ASSERT( it.key() == 251 );
- CPPUNIT_ASSERT( it.val().m_val == 152 );
-
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
-
- // Iterator test
- {
- int nCount = 100;
- for ( int i = 0; i < nCount; ++i )
- CPPUNIT_ASSERT( l.insert(i, i * 2 ) != l.end() );
-
- {
- typename OrdList::iterator it( l.begin() );
- typename OrdList::const_iterator cit( l.cbegin() );
- CPPUNIT_CHECK( it == cit );
- CPPUNIT_CHECK( it != l.end() );
- CPPUNIT_CHECK( it != l.cend() );
- CPPUNIT_CHECK( cit != l.end() );
- CPPUNIT_CHECK( cit != l.cend() );
- ++it;
- CPPUNIT_CHECK( it != cit );
- CPPUNIT_CHECK( it != l.end() );
- CPPUNIT_CHECK( it != l.cend() );
- CPPUNIT_CHECK( cit != l.end() );
- CPPUNIT_CHECK( cit != l.cend() );
- ++cit;
- CPPUNIT_CHECK( it == cit );
- CPPUNIT_CHECK( it != l.end() );
- CPPUNIT_CHECK( it != l.cend() );
- CPPUNIT_CHECK( cit != l.end() );
- CPPUNIT_CHECK( cit != l.cend() );
- }
-
- int i = 0;
- for ( typename OrdList::iterator iter = l.begin(), itEnd = l.end(); iter != itEnd; ++iter, ++i ) {
- CPPUNIT_ASSERT( iter.key() == i );
- CPPUNIT_ASSERT( iter->first == i );
- CPPUNIT_ASSERT( (*iter).first == i );
-
- CPPUNIT_ASSERT( iter.val().m_val == i * 2 );
- CPPUNIT_ASSERT( iter->second.m_val == i * 2 );
- CPPUNIT_ASSERT( (*iter).second.m_val == i * 2 );
-
- iter.val().m_val = i * 3;
- }
-
- // Check that we have visited all items
- for ( int i = 0; i < nCount; ++i ) {
- it = l.find( i );
- CPPUNIT_ASSERT( it != l.end() );
- CPPUNIT_ASSERT( it.key() == i );
- CPPUNIT_ASSERT( it.val().m_val == i * 3 );
- }
-
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
-
- // Const iterator
- for ( int i = 0; i < nCount; ++i )
- CPPUNIT_ASSERT( l.insert(i, i * 7) != l.end() );
-
- i = 0;
- const OrdList& rl = l;
- for ( typename OrdList::const_iterator iter = rl.begin(), itEnd = rl.end(); iter != itEnd; ++iter, ++i ) {
- CPPUNIT_ASSERT( iter.key() == i );
- CPPUNIT_ASSERT( iter->first == i );
- CPPUNIT_ASSERT( (*iter).first == i );
-
- CPPUNIT_ASSERT( iter.val().m_val == i * 7 );
- CPPUNIT_ASSERT( iter->second.m_val == i * 7 );
- CPPUNIT_ASSERT( (*iter).second.m_val == i * 7 );
-
- // it.val().m_val = i * 3 ; // error: const-iterator
- }
-
- l.clear();
- CPPUNIT_ASSERT( l.empty() );
- }
-
- }
- }
-
- void HP_cmp();
- void HP_less();
- void HP_cmpmix();
- void HP_ic();
-
- void DHP_cmp();
- void DHP_less();
- void DHP_cmpmix();
- void DHP_ic();
-
- void RCU_GPI_cmp();
- void RCU_GPI_less();
- void RCU_GPI_cmpmix();
- void RCU_GPI_ic();
-
- void RCU_GPB_cmp();
- void RCU_GPB_less();
- void RCU_GPB_cmpmix();
- void RCU_GPB_ic();
-
- void RCU_GPT_cmp();
- void RCU_GPT_less();
- void RCU_GPT_cmpmix();
- void RCU_GPT_ic();
-
- void RCU_SHB_cmp();
- void RCU_SHB_less();
- void RCU_SHB_cmpmix();
- void RCU_SHB_ic();
-
- void RCU_SHT_cmp();
- void RCU_SHT_less();
- void RCU_SHT_cmpmix();
- void RCU_SHT_ic();
-
- void NOGC_cmp();
- void NOGC_less();
- void NOGC_cmpmix();
- void NOGC_ic();
-
- CPPUNIT_TEST_SUITE(MichaelKVListTestHeader)
- CPPUNIT_TEST(HP_cmp)
- CPPUNIT_TEST(HP_less)
- CPPUNIT_TEST(HP_cmpmix)
- CPPUNIT_TEST(HP_ic)
-
- CPPUNIT_TEST(DHP_cmp)
- CPPUNIT_TEST(DHP_less)
- CPPUNIT_TEST(DHP_cmpmix)
- CPPUNIT_TEST(DHP_ic)
-
- CPPUNIT_TEST(RCU_GPI_cmp)
- CPPUNIT_TEST(RCU_GPI_less)
- CPPUNIT_TEST(RCU_GPI_cmpmix)
- CPPUNIT_TEST(RCU_GPI_ic)
-
- CPPUNIT_TEST(RCU_GPB_cmp)
- CPPUNIT_TEST(RCU_GPB_less)
- CPPUNIT_TEST(RCU_GPB_cmpmix)
- CPPUNIT_TEST(RCU_GPB_ic)
-
- CPPUNIT_TEST(RCU_GPT_cmp)
- CPPUNIT_TEST(RCU_GPT_less)
- CPPUNIT_TEST(RCU_GPT_cmpmix)
- CPPUNIT_TEST(RCU_GPT_ic)
-
- CPPUNIT_TEST(RCU_SHB_cmp)
- CPPUNIT_TEST(RCU_SHB_less)
- CPPUNIT_TEST(RCU_SHB_cmpmix)
- CPPUNIT_TEST(RCU_SHB_ic)
-
- CPPUNIT_TEST(RCU_SHT_cmp)
- CPPUNIT_TEST(RCU_SHT_less)
- CPPUNIT_TEST(RCU_SHT_cmpmix)
- CPPUNIT_TEST(RCU_SHT_ic)
-
- CPPUNIT_TEST(NOGC_cmp)
- CPPUNIT_TEST(NOGC_less)
- CPPUNIT_TEST(NOGC_cmpmix)
- CPPUNIT_TEST(NOGC_ic)
- CPPUNIT_TEST_SUITE_END()
- };
-
-} // namespace ordlist
-
-#endif // #ifndef CDSTEST_HDR_MICHAEL_KV_H
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_michael_kv.h"
-#include <cds/container/michael_kvlist_dhp.h>
-
-namespace ordlist {
- namespace {
- struct DHP_cmp_traits: public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
- };
- }
- void MichaelKVListTestHeader::DHP_cmp()
- {
- // traits-based version
- typedef cc::MichaelKVList< cds::gc::DHP, key_type, value_type, DHP_cmp_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< cds::gc::DHP, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
- namespace {
- struct DHP_less_traits: public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
- };
- }
- void MichaelKVListTestHeader::DHP_less()
- {
- // traits-based version
- typedef cc::MichaelKVList< cds::gc::DHP, key_type, value_type, DHP_less_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< cds::gc::DHP, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
- namespace {
- struct DHP_cmpmix_traits: public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
- typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
- };
- }
- void MichaelKVListTestHeader::DHP_cmpmix()
- {
- // traits-based version
- typedef cc::MichaelKVList< cds::gc::DHP, key_type, value_type, DHP_cmpmix_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< cds::gc::DHP, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- ,cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
- namespace {
- struct DHP_ic_traits: public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
- void MichaelKVListTestHeader::DHP_ic()
- {
- // traits-based version
- typedef cc::MichaelKVList< cds::gc::DHP, key_type, value_type, DHP_ic_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< cds::gc::DHP, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::less< lt<key_type> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
-} // namespace ordlist
-
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_michael_kv.h"
-#include <cds/container/michael_kvlist_hp.h>
-
-namespace ordlist {
- namespace {
- struct HP_cmp_traits: public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
- };
-
- }
- void MichaelKVListTestHeader::HP_cmp()
- {
- // traits-based version
- typedef cc::MichaelKVList< cds::gc::HP, key_type, value_type, HP_cmp_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< cds::gc::HP,
- key_type,
- value_type,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
- namespace {
- struct HP_less_traits : public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
- };
- }
- void MichaelKVListTestHeader::HP_less()
- {
- // traits-based version
- typedef cc::MichaelKVList< cds::gc::HP, key_type, value_type, HP_less_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< cds::gc::HP, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
- namespace {
- struct HP_cmpmix_traits : public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
- typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
- };
- }
- void MichaelKVListTestHeader::HP_cmpmix()
- {
- // traits-based version
- typedef cc::MichaelKVList< cds::gc::HP, key_type, value_type, HP_cmpmix_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< cds::gc::HP, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- ,cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
- namespace {
- struct HP_ic_traits : public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
- void MichaelKVListTestHeader::HP_ic()
- {
- // traits-based version
- typedef cc::MichaelKVList< cds::gc::HP, key_type, value_type, HP_ic_traits > list;
- test< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< cds::gc::HP, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::less< lt<key_type> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test< opt_list >();
- }
-
-} // namespace ordlist
-
-CPPUNIT_TEST_SUITE_REGISTRATION(ordlist::MichaelKVListTestHeader);
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_michael_kv.h"
-#include <cds/container/michael_kvlist_nogc.h>
-
-namespace ordlist {
- namespace {
- struct NOGC_cmp_traits : public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
- };
-
- }
- void MichaelKVListTestHeader::NOGC_cmp()
- {
- // traits-based version
- typedef cc::MichaelKVList< cds::gc::nogc, key_type, value_type, NOGC_cmp_traits > list;
- nogc_test< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< cds::gc::nogc,
- key_type,
- value_type,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- >::type
- > opt_list;
- nogc_test< opt_list >();
- }
-
- namespace {
- struct NOGC_less_traits : public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
- };
- }
- void MichaelKVListTestHeader::NOGC_less()
- {
- // traits-based version
- typedef cc::MichaelKVList< cds::gc::nogc, key_type, value_type, NOGC_less_traits > list;
- nogc_test< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< cds::gc::nogc, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- nogc_test< opt_list >();
- }
-
- namespace {
- struct NOGC_cmpmix_traits : public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
- typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
- };
- }
- void MichaelKVListTestHeader::NOGC_cmpmix()
- {
- // traits-based version
- typedef cc::MichaelKVList< cds::gc::nogc, key_type, value_type, NOGC_cmpmix_traits > list;
- nogc_test< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< cds::gc::nogc, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- ,cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- nogc_test< opt_list >();
- }
-
- namespace {
- struct NOGC_ic_traits : public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
- void MichaelKVListTestHeader::NOGC_ic()
- {
- // traits-based version
- typedef cc::MichaelKVList< cds::gc::nogc, key_type, value_type, NOGC_ic_traits > list;
- nogc_test< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< cds::gc::nogc, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::less< lt<key_type> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- nogc_test< opt_list >();
- }
-
-} // namespace ordlist
-
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_michael_kv.h"
-#include <cds/urcu/general_buffered.h>
-#include <cds/container/michael_kvlist_rcu.h>
-
-namespace ordlist {
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type;
- struct RCU_GPB_cmp_traits : public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
- };
- }
- void MichaelKVListTestHeader::RCU_GPB_cmp()
- {
- // traits-based version
- typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_GPB_cmp_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< rcu_type, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPB_less_traits : public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
- };
- }
- void MichaelKVListTestHeader::RCU_GPB_less()
- {
- // traits-based version
- typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_GPB_less_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< rcu_type, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPB_cmpmix_traits : public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
- typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
- };
- }
- void MichaelKVListTestHeader::RCU_GPB_cmpmix()
- {
- // traits-based version
- typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_GPB_cmpmix_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< rcu_type, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- ,cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPB_ic_traits : public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
- void MichaelKVListTestHeader::RCU_GPB_ic()
- {
- // traits-based version
- typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_GPB_ic_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< rcu_type, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::less< lt<key_type> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
-} // namespace ordlist
-
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_michael_kv.h"
-#include <cds/urcu/general_instant.h>
-#include <cds/container/michael_kvlist_rcu.h>
-
-namespace ordlist {
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type;
- struct RCU_GPI_cmp_traits : public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
- };
- }
- void MichaelKVListTestHeader::RCU_GPI_cmp()
- {
- // traits-based version
- typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_GPI_cmp_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< rcu_type, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPI_less_traits : public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
- };
- }
- void MichaelKVListTestHeader::RCU_GPI_less()
- {
- // traits-based version
- typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_GPI_less_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< rcu_type, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPI_cmpmix_traits : public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
- typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
- };
- }
- void MichaelKVListTestHeader::RCU_GPI_cmpmix()
- {
- // traits-based version
- typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_GPI_cmpmix_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< rcu_type, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- ,cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPI_ic_traits : public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
- void MichaelKVListTestHeader::RCU_GPI_ic()
- {
- // traits-based version
- typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_GPI_ic_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< rcu_type, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::less< lt<key_type> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
-} // namespace ordlist
-
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_michael_kv.h"
-#include <cds/urcu/general_threaded.h>
-#include <cds/container/michael_kvlist_rcu.h>
-
-namespace ordlist {
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type;
- struct RCU_GPT_cmp_traits: public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
- };
- }
- void MichaelKVListTestHeader::RCU_GPT_cmp()
- {
- // traits-based version
- typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_GPT_cmp_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< rcu_type, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPT_less_traits : public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
- };
- }
- void MichaelKVListTestHeader::RCU_GPT_less()
- {
- // traits-based version
- typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_GPT_less_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< rcu_type, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPT_cmpmix_traits : public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
- typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
- };
- }
- void MichaelKVListTestHeader::RCU_GPT_cmpmix()
- {
- // traits-based version
- typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_GPT_cmpmix_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< rcu_type, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- ,cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPT_ic_traits : public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
- void MichaelKVListTestHeader::RCU_GPT_ic()
- {
- // traits-based version
- typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_GPT_ic_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< rcu_type, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::less< lt<key_type> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
-} // namespace ordlist
-
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_michael_kv.h"
-#include <cds/urcu/signal_buffered.h>
-#include <cds/container/michael_kvlist_rcu.h>
-
-namespace ordlist {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
- struct RCU_SHB_cmp_traits: public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
- };
- }
-#endif
- void MichaelKVListTestHeader::RCU_SHB_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_SHB_cmp_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< rcu_type, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct RCU_SHB_less_traits: public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
- };
- }
-#endif
- void MichaelKVListTestHeader::RCU_SHB_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_SHB_less_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< rcu_type, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct RCU_SHB_cmpmix_traits: public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
- typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
- };
- }
-#endif
- void MichaelKVListTestHeader::RCU_SHB_cmpmix()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_SHB_cmpmix_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< rcu_type, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- ,cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct RCU_SHB_ic_traits: public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
-#endif
- void MichaelKVListTestHeader::RCU_SHB_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_SHB_ic_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< rcu_type, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::less< lt<key_type> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-} // namespace ordlist
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_michael_kv.h"
-#include <cds/urcu/signal_threaded.h>
-#include <cds/container/michael_kvlist_rcu.h>
-
-namespace ordlist {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type;
- struct RCU_SHT_cmp_traits: public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
- };
- }
-#endif
- void MichaelKVListTestHeader::RCU_SHT_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_SHT_cmp_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< rcu_type, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct RCU_SHT_less_traits: public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
- };
- }
-#endif
- void MichaelKVListTestHeader::RCU_SHT_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_SHT_less_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< rcu_type, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct RCU_SHT_cmpmix_traits: public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::cmp<MichaelKVListTestHeader::key_type> compare;
- typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
- };
- }
-#endif
- void MichaelKVListTestHeader::RCU_SHT_cmpmix()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_SHT_cmpmix_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< rcu_type, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<key_type> >
- ,cc::opt::less< lt<key_type> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct RCU_SHT_ic_traits: public cc::michael_list::traits
- {
- typedef MichaelKVListTestHeader::lt<MichaelKVListTestHeader::key_type> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
-#endif
- void MichaelKVListTestHeader::RCU_SHT_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::MichaelKVList< rcu_type, key_type, value_type, RCU_SHT_ic_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelKVList< rcu_type, key_type, value_type,
- cc::michael_list::make_traits<
- cc::opt::less< lt<key_type> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-} // namespace ordlist
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_michael.h"
-#include <cds/container/michael_list_nogc.h>
-
-namespace ordlist {
- namespace {
- struct NOGC_cmp_traits: public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
- };
- }
- void MichaelListTestHeader::NOGC_cmp()
- {
- // traits-based version
- typedef cc::MichaelList< cds::gc::nogc, item, NOGC_cmp_traits > list;
- nogc_test< list >();
-
- // option-based version
-
- typedef cc::MichaelList< cds::gc::nogc, item,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<item> >
- >::type
- > opt_list;
- nogc_test< opt_list >();
- }
-
- namespace {
- struct NOGC_less_traits: public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
- };
- }
- void MichaelListTestHeader::NOGC_less()
- {
- // traits-based version
- typedef cc::MichaelList< cds::gc::nogc, item, NOGC_less_traits > list;
- nogc_test< list >();
-
- // option-based version
-
- typedef cc::MichaelList< cds::gc::nogc, item,
- cc::michael_list::make_traits<
- cc::opt::less< lt<item> >
- >::type
- > opt_list;
- nogc_test< opt_list >();
- }
-
- namespace {
- struct NOGC_cmpmix_traits: public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
- typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
- };
- }
- void MichaelListTestHeader::NOGC_cmpmix()
- {
- // traits-based version
- typedef cc::MichaelList< cds::gc::nogc, item, NOGC_cmpmix_traits > list;
- nogc_test< list >();
-
- // option-based version
-
- typedef cc::MichaelList< cds::gc::nogc, item,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<item> >
- ,cc::opt::less< lt<item> >
- >::type
- > opt_list;
- nogc_test< opt_list >();
- }
-
- namespace {
- struct NOGC_ic_traits: public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
- void MichaelListTestHeader::NOGC_ic()
- {
- // traits-based version
- typedef cc::MichaelList< cds::gc::nogc, item, NOGC_ic_traits > list;
- nogc_test< list >();
-
- // option-based version
-
- typedef cc::MichaelList< cds::gc::nogc, item,
- cc::michael_list::make_traits<
- cc::opt::less< lt<item> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- nogc_test< opt_list >();
- }
-
-} // namespace ordlist
-
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_michael.h"
-#include <cds/urcu/general_buffered.h>
-#include <cds/container/michael_list_rcu.h>
-
-namespace ordlist {
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type;
-
- struct RCU_GPB_cmp_traits: public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
- };
- }
-
- void MichaelListTestHeader::RCU_GPB_cmp()
- {
- // traits-based version
- typedef cc::MichaelList< rcu_type, item, RCU_GPB_cmp_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelList< rcu_type, item,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPB_less_traits: public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
- };
- }
- void MichaelListTestHeader::RCU_GPB_less()
- {
- // traits-based version
- typedef cc::MichaelList< rcu_type, item, RCU_GPB_less_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelList< rcu_type, item,
- cc::michael_list::make_traits<
- cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPB_cmpmix_traits : public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
- typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
- };
- }
- void MichaelListTestHeader::RCU_GPB_cmpmix()
- {
- // traits-based version
- typedef cc::MichaelList< rcu_type, item, RCU_GPB_cmpmix_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelList< rcu_type, item,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<item> >
- ,cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPB_ic_traits : public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
- void MichaelListTestHeader::RCU_GPB_ic()
- {
- // traits-based version
- typedef cc::MichaelList< rcu_type, item, RCU_GPB_ic_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelList< rcu_type, item,
- cc::michael_list::make_traits<
- cc::opt::less< lt<item> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
-} // namespace ordlist
-
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_michael.h"
-#include <cds/urcu/general_instant.h>
-#include <cds/container/michael_list_rcu.h>
-
-namespace ordlist {
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type;
-
- struct RCU_GPI_cmp_traits : public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
- };
- }
-
- void MichaelListTestHeader::RCU_GPI_cmp()
- {
- // traits-based version
- typedef cc::MichaelList< rcu_type, item, RCU_GPI_cmp_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelList< rcu_type, item,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPI_less_traits : public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
- };
- }
- void MichaelListTestHeader::RCU_GPI_less()
- {
- // traits-based version
- typedef cc::MichaelList< rcu_type, item, RCU_GPI_less_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelList< rcu_type, item,
- cc::michael_list::make_traits<
- cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPI_cmpmix_traits : public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
- typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
- };
- }
- void MichaelListTestHeader::RCU_GPI_cmpmix()
- {
- // traits-based version
- typedef cc::MichaelList< rcu_type, item, RCU_GPI_cmpmix_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelList< rcu_type, item,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<item> >
- ,cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPI_ic_traits : public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
- void MichaelListTestHeader::RCU_GPI_ic()
- {
- // traits-based version
- typedef cc::MichaelList< rcu_type, item, RCU_GPI_ic_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelList< rcu_type, item,
- cc::michael_list::make_traits<
- cc::opt::less< lt<item> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
-} // namespace ordlist
-
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_michael.h"
-#include <cds/urcu/general_threaded.h>
-#include <cds/container/michael_list_rcu.h>
-
-namespace ordlist {
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type;
-
- struct RCU_GPT_cmp_traits : public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
- };
- }
-
- void MichaelListTestHeader::RCU_GPT_cmp()
- {
- // traits-based version
- typedef cc::MichaelList< rcu_type, item, RCU_GPT_cmp_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelList< rcu_type, item,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPT_less_traits : public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
- };
- }
- void MichaelListTestHeader::RCU_GPT_less()
- {
- // traits-based version
- typedef cc::MichaelList< rcu_type, item, RCU_GPT_less_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelList< rcu_type, item,
- cc::michael_list::make_traits<
- cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPT_cmpmix_traits : public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
- typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
- };
- }
- void MichaelListTestHeader::RCU_GPT_cmpmix()
- {
- // traits-based version
- typedef cc::MichaelList< rcu_type, item, RCU_GPT_cmpmix_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelList< rcu_type, item,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<item> >
- ,cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
- namespace {
- struct RCU_GPT_ic_traits : public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
- void MichaelListTestHeader::RCU_GPT_ic()
- {
- // traits-based version
- typedef cc::MichaelList< rcu_type, item, RCU_GPT_ic_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelList< rcu_type, item,
- cc::michael_list::make_traits<
- cc::opt::less< lt<item> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test_rcu< opt_list >();
- }
-
-} // namespace ordlist
-
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_michael.h"
-#include <cds/urcu/signal_buffered.h>
-#include <cds/container/michael_list_rcu.h>
-
-namespace ordlist {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
-
- struct RCU_SHB_cmp_traits : public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
- };
- }
-#endif
-
- void MichaelListTestHeader::RCU_SHB_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::MichaelList< rcu_type, item, RCU_SHB_cmp_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelList< rcu_type, item,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct RCU_SHB_less_traits : public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
- };
- }
-#endif
- void MichaelListTestHeader::RCU_SHB_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::MichaelList< rcu_type, item, RCU_SHB_less_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelList< rcu_type, item,
- cc::michael_list::make_traits<
- cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct RCU_SHB_cmpmix_traits: public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
- typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
- };
- }
-#endif
- void MichaelListTestHeader::RCU_SHB_cmpmix()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::MichaelList< rcu_type, item, RCU_SHB_cmpmix_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelList< rcu_type, item,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<item> >
- ,cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct RCU_SHB_ic_traits: public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
-#endif
- void MichaelListTestHeader::RCU_SHB_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::MichaelList< rcu_type, item, RCU_SHB_ic_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelList< rcu_type, item,
- cc::michael_list::make_traits<
- cc::opt::less< lt<item> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-} // namespace ordlist
+++ /dev/null
-//$$CDS-header$$
-
-#include "ordered_list/hdr_michael.h"
-#include <cds/urcu/signal_threaded.h>
-#include <cds/container/michael_list_rcu.h>
-
-namespace ordlist {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type;
-
- struct RCU_SHT_cmp_traits : public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
- };
- }
-#endif
-
- void MichaelListTestHeader::RCU_SHT_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::MichaelList< rcu_type, item, RCU_SHT_cmp_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelList< rcu_type, item,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct RCU_SHT_less_traits: public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
- };
- }
-#endif
- void MichaelListTestHeader::RCU_SHT_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::MichaelList< rcu_type, item, RCU_SHT_less_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelList< rcu_type, item,
- cc::michael_list::make_traits<
- cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct RCU_SHT_cmpmix_traits: public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare;
- typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
- };
- }
-#endif
- void MichaelListTestHeader::RCU_SHT_cmpmix()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::MichaelList< rcu_type, item, RCU_SHT_cmpmix_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelList< rcu_type, item,
- cc::michael_list::make_traits<
- cc::opt::compare< cmp<item> >
- ,cc::opt::less< lt<item> >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace {
- struct RCU_SHT_ic_traits: public cc::michael_list::traits
- {
- typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less;
- typedef cds::atomicity::item_counter item_counter;
- };
- }
-#endif
- void MichaelListTestHeader::RCU_SHT_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- // traits-based version
- typedef cc::MichaelList< rcu_type, item, RCU_SHT_ic_traits > list;
- test_rcu< list >();
-
- // option-based version
-
- typedef cc::MichaelList< rcu_type, item,
- cc::michael_list::make_traits<
- cc::opt::less< lt<item> >
- ,cc::opt::item_counter< cds::atomicity::item_counter >
- >::type
- > opt_list;
- test_rcu< opt_list >();
-#endif
- }
-
-} // namespace ordlist