$(TESTHDR_OBJS): %.o: %.cpp
$(CXX) $(CPP_COMP_OPT) -I$(TESTHDR_SRC_DIR) -I$(TEST_COMMONHDR_SRC_DIR) $< -o $@
-include ../projects/source.test-hdr.offsetof.mk
-CDS_TESTHDR_OFFSETOF_SOURCES := $(CDS_TESTHDR_OFFSETOF_SOURCES:%.cpp=../%.cpp)
-TESTHDR_OBJS_NO_OFFSETOF_WARN := $(CDS_TESTHDR_OFFSETOF_SOURCES:%.cpp=%.o)
-TESTHDR_OBJS_NO_OFFSETOF_WARN_DEPS := $(TESTHDR_OBJS_NO_OFFSETOF_WARN:%.o=%.d)
-
--include $(TESTHDR_OBJS_NO_OFFSETOF_WARN_DEPS)
-$(TESTHDR_OBJS_NO_OFFSETOF_WARN): %.o: %.cpp
- $(CXX) $(CPP_COMP_OPT) -I$(TESTHDR_SRC_DIR) -I$(TEST_COMMONHDR_SRC_DIR) -Wno-invalid-offsetof $< -o $@
-
-
TEST_SRC_DIR=../tests/unit
TEST_DATA_DIR=`pwd`/../tests/data
{408FE9BC-44F0-4E6A-89FA-D6F952584239} = {408FE9BC-44F0-4E6A-89FA-D6F952584239}\r
EndProjectSection\r
EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hdr-test-tree", "hdr-test-tree.vcxproj", "{6F834EAD-7B94-4979-A0F1-A662E3D30145}"\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
- EndProjectSection\r
-EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unit-map-insdel-item", "unit-map-insdel-item.vcxproj", "{7521DD92-56FF-4ECA-93E5-CCE50862354B}"\r
ProjectSection(ProjectDependencies) = postProject\r
{61179F2F-07E1-490D-B64D-D85A90B6EF81} = {61179F2F-07E1-490D-B64D-D85A90B6EF81}\r
{BA23811C-D4CB-4836-B2F3-6791BD6FFCD1}.Release|Win32.Build.0 = Release|Win32\r
{BA23811C-D4CB-4836-B2F3-6791BD6FFCD1}.Release|x64.ActiveCfg = Release|x64\r
{BA23811C-D4CB-4836-B2F3-6791BD6FFCD1}.Release|x64.Build.0 = Release|x64\r
- {6F834EAD-7B94-4979-A0F1-A662E3D30145}.Debug|Win32.ActiveCfg = Debug|Win32\r
- {6F834EAD-7B94-4979-A0F1-A662E3D30145}.Debug|Win32.Build.0 = Debug|Win32\r
- {6F834EAD-7B94-4979-A0F1-A662E3D30145}.Debug|x64.ActiveCfg = Debug|x64\r
- {6F834EAD-7B94-4979-A0F1-A662E3D30145}.Debug|x64.Build.0 = Debug|x64\r
- {6F834EAD-7B94-4979-A0F1-A662E3D30145}.DebugVLD|Win32.ActiveCfg = DebugVLD|Win32\r
- {6F834EAD-7B94-4979-A0F1-A662E3D30145}.DebugVLD|Win32.Build.0 = DebugVLD|Win32\r
- {6F834EAD-7B94-4979-A0F1-A662E3D30145}.DebugVLD|x64.ActiveCfg = DebugVLD|x64\r
- {6F834EAD-7B94-4979-A0F1-A662E3D30145}.DebugVLD|x64.Build.0 = DebugVLD|x64\r
- {6F834EAD-7B94-4979-A0F1-A662E3D30145}.Release|Win32.ActiveCfg = Release|Win32\r
- {6F834EAD-7B94-4979-A0F1-A662E3D30145}.Release|Win32.Build.0 = Release|Win32\r
- {6F834EAD-7B94-4979-A0F1-A662E3D30145}.Release|x64.ActiveCfg = Release|x64\r
- {6F834EAD-7B94-4979-A0F1-A662E3D30145}.Release|x64.Build.0 = Release|x64\r
{7521DD92-56FF-4ECA-93E5-CCE50862354B}.Debug|Win32.ActiveCfg = Debug|Win32\r
{7521DD92-56FF-4ECA-93E5-CCE50862354B}.Debug|Win32.Build.0 = Debug|Win32\r
{7521DD92-56FF-4ECA-93E5-CCE50862354B}.Debug|x64.ActiveCfg = Debug|x64\r
{CA25BDBF-B354-4597-B6D2-220ABBB0D2F4} = {6BB7A27F-FC59-4267-B6FA-D034176D1459}\r
{AF7B2253-2E6D-4992-94D9-4B3699C54929} = {A64449B7-90FB-4E2B-A686-9EFC0E298644}\r
{BA23811C-D4CB-4836-B2F3-6791BD6FFCD1} = {A64449B7-90FB-4E2B-A686-9EFC0E298644}\r
- {6F834EAD-7B94-4979-A0F1-A662E3D30145} = {B8C24D26-A3BF-4DA6-B64C-142CBA4BFE75}\r
{7521DD92-56FF-4ECA-93E5-CCE50862354B} = {6BB7A27F-FC59-4267-B6FA-D034176D1459}\r
{CA6F0834-0628-4CD7-8800-AEABCD636360} = {6BB7A27F-FC59-4267-B6FA-D034176D1459}\r
{DE256E91-EE96-412E-82EE-DD7BD1A1130D} = {A64449B7-90FB-4E2B-A686-9EFC0E298644}\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="14.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="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>{6F834EAD-7B94-4979-A0F1-A662E3D30145}</ProjectGuid>\r
- <RootNamespace>hdrtesttree</RootNamespace>\r
- <Keyword>Win32Proj</Keyword>\r
- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>\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>v140</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>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v140</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>v140</PlatformToolset>\r
- </PropertyGroup>\r
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
- <ConfigurationType>Application</ConfigurationType>\r
- <CharacterSet>MultiByte</CharacterSet>\r
- <PlatformToolset>v140</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)'=='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)'=='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\vc.$(PlatformToolset)\$(Platform)\</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-release\</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-release\</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>\r
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">false</LinkIncremental>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)\</OutDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(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
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />\r
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />\r
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />\r
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />\r
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />\r
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />\r
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>\r
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />\r
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />\r
- <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName)_d</TargetName>\r
- <TargetName Condition="'$(Configuration)|$(Platform)'=='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;NOMINMAX;%(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
- <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\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;NOMINMAX;%(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
- <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\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;NOMINMAX;_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
- <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\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;NOMINMAX;_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
- <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\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;NOMINMAX;%(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
- <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\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;NOMINMAX;%(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
- <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>\r
- </Link>\r
- </ItemDefinitionGroup>\r
- <ItemGroup>\r
- <ClInclude Include="..\..\..\tests\test-hdr\tree\hdr_bronson_avltree_map.h" />\r
- <ClInclude Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_map.h" />\r
- <ClInclude Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_set.h" />\r
- <ClInclude Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_bintree.h" />\r
- <ClInclude Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_pool_dhp.h" />\r
- <ClInclude Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_pool_hp.h" />\r
- <ClInclude Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_pool_rcu.h" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_bronson_avltree_map_rcu_gpb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_bronson_avltree_map_rcu_gpb_pool_monitor.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_bronson_avltree_map_rcu_gpi.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_bronson_avltree_map_rcu_gpi_pool_monitor.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_bronson_avltree_map_rcu_gpt.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_bronson_avltree_map_rcu_gpt_pool_monitor.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_bronson_avltree_map_rcu_shb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_bronson_avltree_map_rcu_shb_pool_monitor.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_bronson_avltree_map_rcu_sht.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_bronson_avltree_map_rcu_sht_pool_monitor.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_map_dhp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_map_hp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_map_rcu_gpb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_map_rcu_gpi.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_map_rcu_gpt.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_map_rcu_shb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_map_rcu_sht.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_set_dhp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_set_hp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_set_rcu_gpb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_set_rcu_gpi.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_set_rcu_gpt.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_set_rcu_shb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_set_rcu_sht.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_dhp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_dhp_member.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_hp.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_hp_member.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_rcu_gpb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_rcu_gpb_member.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_rcu_gpi.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_rcu_gpi_member.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_rcu_gpt.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_rcu_gpt_member.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_rcu_shb.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_rcu_shb_member.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_rcu_sht.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_rcu_sht_member.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_tree_reg.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
- <Filter Include="container">\r
- <UniqueIdentifier>{dec34594-a06a-4ed8-9792-fbc6b2a251f5}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="intrusive">\r
- <UniqueIdentifier>{a13910ed-6cb1-46bc-a137-7da531e65e3a}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="container\ellen-bintree-set">\r
- <UniqueIdentifier>{e2f66f2f-4770-4533-86f0-75fe68a263ab}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="container\bronson-avltree-map">\r
- <UniqueIdentifier>{36cb9dc5-7022-42bd-a68d-db247368092f}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="container\ellen-bintree-map">\r
- <UniqueIdentifier>{c47142c5-b407-4938-94f6-49f43f192890}</UniqueIdentifier>\r
- </Filter>\r
- <Filter Include="intrusive\ellen-bintree-set">\r
- <UniqueIdentifier>{af39cad7-51ab-4d41-ae94-d02f650314da}</UniqueIdentifier>\r
- </Filter>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ClInclude Include="..\..\..\tests\test-hdr\tree\hdr_bronson_avltree_map.h">\r
- <Filter>container\bronson-avltree-map</Filter>\r
- </ClInclude>\r
- <ClInclude Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_set.h">\r
- <Filter>container\ellen-bintree-set</Filter>\r
- </ClInclude>\r
- <ClInclude Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_map.h">\r
- <Filter>container\ellen-bintree-map</Filter>\r
- </ClInclude>\r
- <ClInclude Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_bintree.h">\r
- <Filter>intrusive\ellen-bintree-set</Filter>\r
- </ClInclude>\r
- <ClInclude Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_pool_dhp.h">\r
- <Filter>intrusive\ellen-bintree-set</Filter>\r
- </ClInclude>\r
- <ClInclude Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_pool_hp.h">\r
- <Filter>intrusive\ellen-bintree-set</Filter>\r
- </ClInclude>\r
- <ClInclude Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_pool_rcu.h">\r
- <Filter>intrusive\ellen-bintree-set</Filter>\r
- </ClInclude>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_tree_reg.cpp" />\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_bronson_avltree_map_rcu_gpb.cpp">\r
- <Filter>container\bronson-avltree-map</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_bronson_avltree_map_rcu_gpb_pool_monitor.cpp">\r
- <Filter>container\bronson-avltree-map</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_bronson_avltree_map_rcu_gpi.cpp">\r
- <Filter>container\bronson-avltree-map</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_bronson_avltree_map_rcu_gpi_pool_monitor.cpp">\r
- <Filter>container\bronson-avltree-map</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_bronson_avltree_map_rcu_gpt.cpp">\r
- <Filter>container\bronson-avltree-map</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_bronson_avltree_map_rcu_gpt_pool_monitor.cpp">\r
- <Filter>container\bronson-avltree-map</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_bronson_avltree_map_rcu_shb.cpp">\r
- <Filter>container\bronson-avltree-map</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_bronson_avltree_map_rcu_shb_pool_monitor.cpp">\r
- <Filter>container\bronson-avltree-map</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_bronson_avltree_map_rcu_sht.cpp">\r
- <Filter>container\bronson-avltree-map</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_bronson_avltree_map_rcu_sht_pool_monitor.cpp">\r
- <Filter>container\bronson-avltree-map</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_set_dhp.cpp">\r
- <Filter>container\ellen-bintree-set</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_set_hp.cpp">\r
- <Filter>container\ellen-bintree-set</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_set_rcu_gpb.cpp">\r
- <Filter>container\ellen-bintree-set</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_set_rcu_gpi.cpp">\r
- <Filter>container\ellen-bintree-set</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_set_rcu_gpt.cpp">\r
- <Filter>container\ellen-bintree-set</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_set_rcu_shb.cpp">\r
- <Filter>container\ellen-bintree-set</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_set_rcu_sht.cpp">\r
- <Filter>container\ellen-bintree-set</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_map_dhp.cpp">\r
- <Filter>container\ellen-bintree-map</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_map_hp.cpp">\r
- <Filter>container\ellen-bintree-map</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_map_rcu_gpb.cpp">\r
- <Filter>container\ellen-bintree-map</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_map_rcu_gpi.cpp">\r
- <Filter>container\ellen-bintree-map</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_map_rcu_gpt.cpp">\r
- <Filter>container\ellen-bintree-map</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_map_rcu_shb.cpp">\r
- <Filter>container\ellen-bintree-map</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_ellenbintree_map_rcu_sht.cpp">\r
- <Filter>container\ellen-bintree-map</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_dhp.cpp">\r
- <Filter>intrusive\ellen-bintree-set</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_dhp_member.cpp">\r
- <Filter>intrusive\ellen-bintree-set</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_hp.cpp">\r
- <Filter>intrusive\ellen-bintree-set</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_hp_member.cpp">\r
- <Filter>intrusive\ellen-bintree-set</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_rcu_gpb.cpp">\r
- <Filter>intrusive\ellen-bintree-set</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_rcu_gpb_member.cpp">\r
- <Filter>intrusive\ellen-bintree-set</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_rcu_gpi.cpp">\r
- <Filter>intrusive\ellen-bintree-set</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_rcu_gpi_member.cpp">\r
- <Filter>intrusive\ellen-bintree-set</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_rcu_gpt.cpp">\r
- <Filter>intrusive\ellen-bintree-set</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_rcu_gpt_member.cpp">\r
- <Filter>intrusive\ellen-bintree-set</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_rcu_shb.cpp">\r
- <Filter>intrusive\ellen-bintree-set</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_rcu_shb_member.cpp">\r
- <Filter>intrusive\ellen-bintree-set</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_rcu_sht.cpp">\r
- <Filter>intrusive\ellen-bintree-set</Filter>\r
- </ClCompile>\r
- <ClCompile Include="..\..\..\tests\test-hdr\tree\hdr_intrusive_ellen_bintree_rcu_sht_member.cpp">\r
- <Filter>intrusive\ellen-bintree-set</Filter>\r
- </ClCompile>\r
- </ItemGroup>\r
-</Project>
\ No newline at end of file
-CDS_TESTHDR_TREE := \
- tests/test-hdr/tree/hdr_tree_reg.cpp \
- tests/test-hdr/tree/hdr_intrusive_ellen_bintree_hp.cpp \
- tests/test-hdr/tree/hdr_intrusive_ellen_bintree_dhp.cpp \
- tests/test-hdr/tree/hdr_intrusive_ellen_bintree_rcu_gpb.cpp \
- tests/test-hdr/tree/hdr_intrusive_ellen_bintree_rcu_gpi.cpp \
- tests/test-hdr/tree/hdr_intrusive_ellen_bintree_rcu_gpt.cpp \
- tests/test-hdr/tree/hdr_intrusive_ellen_bintree_rcu_shb.cpp \
- tests/test-hdr/tree/hdr_intrusive_ellen_bintree_rcu_sht.cpp \
- tests/test-hdr/tree/hdr_ellenbintree_map_hp.cpp \
- tests/test-hdr/tree/hdr_ellenbintree_map_dhp.cpp \
- tests/test-hdr/tree/hdr_ellenbintree_map_rcu_gpb.cpp \
- tests/test-hdr/tree/hdr_ellenbintree_map_rcu_gpi.cpp \
- tests/test-hdr/tree/hdr_ellenbintree_map_rcu_gpt.cpp \
- tests/test-hdr/tree/hdr_ellenbintree_map_rcu_shb.cpp \
- tests/test-hdr/tree/hdr_ellenbintree_map_rcu_sht.cpp \
- tests/test-hdr/tree/hdr_ellenbintree_set_hp.cpp \
- tests/test-hdr/tree/hdr_ellenbintree_set_dhp.cpp \
- tests/test-hdr/tree/hdr_ellenbintree_set_rcu_gpb.cpp \
- tests/test-hdr/tree/hdr_ellenbintree_set_rcu_gpi.cpp \
- tests/test-hdr/tree/hdr_ellenbintree_set_rcu_gpt.cpp \
- tests/test-hdr/tree/hdr_ellenbintree_set_rcu_shb.cpp \
- tests/test-hdr/tree/hdr_ellenbintree_set_rcu_sht.cpp \
- tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpb.cpp \
- tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpb_pool_monitor.cpp \
- tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpi.cpp \
- tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpi_pool_monitor.cpp \
- tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpt.cpp \
- tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_gpt_pool_monitor.cpp \
- tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_shb.cpp \
- tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_shb_pool_monitor.cpp \
- tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_sht.cpp \
- tests/test-hdr/tree/hdr_bronson_avltree_map_rcu_sht_pool_monitor.cpp \
-
-
CDS_TESTHDR_MISC := \
tests/test-hdr/misc/cxx11_atomic_class.cpp \
tests/test-hdr/misc/cxx11_atomic_func.cpp \
tests/test-hdr/misc/thread_init_fini.cpp
CDS_TESTHDR_SOURCES := \
- $(CDS_TESTHDR_TREE) \
$(CDS_TESTHDR_MISC)
+++ /dev/null
-CDS_TESTHDR_OFFSETOF_TREE := \
- tests/test-hdr/tree/hdr_intrusive_ellen_bintree_hp_member.cpp \
- tests/test-hdr/tree/hdr_intrusive_ellen_bintree_dhp_member.cpp \
- tests/test-hdr/tree/hdr_intrusive_ellen_bintree_rcu_gpb_member.cpp \
- tests/test-hdr/tree/hdr_intrusive_ellen_bintree_rcu_gpi_member.cpp \
- tests/test-hdr/tree/hdr_intrusive_ellen_bintree_rcu_gpt_member.cpp \
- tests/test-hdr/tree/hdr_intrusive_ellen_bintree_rcu_shb_member.cpp \
- tests/test-hdr/tree/hdr_intrusive_ellen_bintree_rcu_sht_member.cpp
-
-CDS_TESTHDR_OFFSETOF_SOURCES := \
- $(CDS_TESTHDR_OFFSETOF_TREE)
set(PACKAGE_NAME test-hdr)\r
\r
-set(CDS_TESTHDR_TREE\r
- tree/hdr_tree_reg.cpp
- tree/hdr_intrusive_ellen_bintree_hp.cpp
- tree/hdr_intrusive_ellen_bintree_dhp.cpp
- tree/hdr_intrusive_ellen_bintree_rcu_gpb.cpp
- tree/hdr_intrusive_ellen_bintree_rcu_gpi.cpp
- tree/hdr_intrusive_ellen_bintree_rcu_gpt.cpp
- tree/hdr_intrusive_ellen_bintree_rcu_shb.cpp
- tree/hdr_intrusive_ellen_bintree_rcu_sht.cpp
- tree/hdr_ellenbintree_map_hp.cpp
- tree/hdr_ellenbintree_map_dhp.cpp
- tree/hdr_ellenbintree_map_rcu_gpb.cpp
- tree/hdr_ellenbintree_map_rcu_gpi.cpp
- tree/hdr_ellenbintree_map_rcu_gpt.cpp
- tree/hdr_ellenbintree_map_rcu_shb.cpp
- tree/hdr_ellenbintree_map_rcu_sht.cpp
- tree/hdr_ellenbintree_set_hp.cpp
- tree/hdr_ellenbintree_set_dhp.cpp
- tree/hdr_ellenbintree_set_rcu_gpb.cpp
- tree/hdr_ellenbintree_set_rcu_gpi.cpp
- tree/hdr_ellenbintree_set_rcu_gpt.cpp
- tree/hdr_ellenbintree_set_rcu_shb.cpp
- tree/hdr_ellenbintree_set_rcu_sht.cpp
- tree/hdr_bronson_avltree_map_rcu_gpb.cpp
- tree/hdr_bronson_avltree_map_rcu_gpb_pool_monitor.cpp
- tree/hdr_bronson_avltree_map_rcu_gpi.cpp
- tree/hdr_bronson_avltree_map_rcu_gpi_pool_monitor.cpp
- tree/hdr_bronson_avltree_map_rcu_gpt.cpp
- tree/hdr_bronson_avltree_map_rcu_gpt_pool_monitor.cpp
- tree/hdr_bronson_avltree_map_rcu_shb.cpp
- tree/hdr_bronson_avltree_map_rcu_shb_pool_monitor.cpp
- tree/hdr_bronson_avltree_map_rcu_sht.cpp
- tree/hdr_bronson_avltree_map_rcu_sht_pool_monitor.cpp
- )
-
set(CDS_TESTHDR_MISC\r
misc/cxx11_atomic_class.cpp\r
misc/cxx11_atomic_func.cpp\r
misc/permutation_generator.cpp\r
misc/thread_init_fini.cpp)\r
\r
-set(CDS_TESTHDR_OFFSETOF_TREE\r
- tree/hdr_intrusive_ellen_bintree_hp_member.cpp\r
- tree/hdr_intrusive_ellen_bintree_dhp_member.cpp\r
- tree/hdr_intrusive_ellen_bintree_rcu_gpb_member.cpp\r
- tree/hdr_intrusive_ellen_bintree_rcu_gpi_member.cpp\r
- tree/hdr_intrusive_ellen_bintree_rcu_gpt_member.cpp\r
- tree/hdr_intrusive_ellen_bintree_rcu_shb_member.cpp\r
- tree/hdr_intrusive_ellen_bintree_rcu_sht_member.cpp)\r
-\r
-set(CDS_TESTHDR_OFFSETOF_SOURCES\r
- ${CDS_TESTHDR_OFFSETOF_TREE})\r
-\r
-add_library(test-hdr-offsetof OBJECT ${CDS_TESTHDR_OFFSETOF_SOURCES})\r
-\r
-if(CMAKE_COMPILER_IS_GNUCC)\r
- set_property(TARGET test-hdr-offsetof APPEND_STRING PROPERTY COMPILE_FLAGS -Wno-invalid-offsetof)\r
-endif(CMAKE_COMPILER_IS_GNUCC)\r
-\r
set(CDS_TESTHDR_SOURCES\r
- ${CDS_TESTHDR_TREE}\r
${CDS_TESTHDR_MISC})\r
\r
add_executable(${PACKAGE_NAME} ${CDS_TESTHDR_SOURCES} $<TARGET_OBJECTS:test-hdr-offsetof> $<TARGET_OBJECTS:${TEST_COMMON}>)\r
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef CDSTEST_HDR_BRONSON_AVLTREE_MAP_H
-#define CDSTEST_HDR_BRONSON_AVLTREE_MAP_H
-
-#include "cppunit/cppunit_proxy.h"
-#include "size_check.h"
-#include <functional> // ref
-#include <algorithm>
-
-namespace tree {
- using misc::check_size;
-
- class BronsonAVLTreeHdrTest : public CppUnitMini::TestCase
- {
- public:
- typedef int key_type;
-
- struct stat_data {
- size_t nInsertFuncCall;
- size_t nEnsureExistFuncCall;
- size_t nEnsureNewFuncCall;
- size_t nEraseFuncCall;
- size_t nFindFuncCall;
-
- stat_data()
- : nInsertFuncCall( 0 )
- , nEnsureExistFuncCall( 0 )
- , nEnsureNewFuncCall( 0 )
- , nEraseFuncCall( 0 )
- , nFindFuncCall( 0 )
- {}
- };
-
- struct value_type {
- int nVal;
- stat_data stat;
-
- value_type()
- : nVal(0)
- {}
-
- value_type( int v )
- : nVal( v )
- {}
- };
-
- struct compare {
- int operator()( key_type k1, key_type k2 )
- {
- return k1 < k2 ? -1 : k1 > k2 ? 1 : 0;
- }
- };
-
- struct wrapped_int {
- int nKey;
-
- wrapped_int( int n )
- : nKey( n )
- {}
- };
-
- struct wrapped_less
- {
- bool operator()( wrapped_int const& w, int n ) const
- {
- return w.nKey < n;
- }
- bool operator()( int n, wrapped_int const& w ) const
- {
- return n < w.nKey;
- }
- template <typename T>
- bool operator()( wrapped_int const& w, T const& v ) const
- {
- return w.nKey < v.nKey;
- }
- template <typename T>
- bool operator()( T const& v, wrapped_int const& w ) const
- {
- return v.nKey < w.nKey;
- }
- };
-
- protected:
- static const size_t c_nItemCount = 10000;
-
- struct find_functor
- {
- void operator()( key_type, value_type& v ) const
- {
- ++v.stat.nFindFuncCall;
- }
- };
-
- template <typename Item>
- struct copy_found
- {
- Item m_found;
-
- void operator()( key_type const&, Item& v )
- {
- m_found = v;
- }
-
- void operator()( Item& v )
- {
- m_found = v;
- }
- };
-
- struct insert_functor
- {
- template <typename Item>
- void operator()( key_type key, Item& i )
- {
- i.nVal = key * 100;
- ++i.stat.nInsertFuncCall;
- }
- };
-
- template <typename Q>
- static void update_func( bool bNew, Q key, value_type& i )
- {
- i.nVal = key * 100;
- if ( bNew )
- ++i.stat.nEnsureNewFuncCall;
- else
- ++i.stat.nEnsureExistFuncCall;
- }
-
- struct update_functor
- {
- template <typename Q>
- void operator()( bool bNew, Q key, value_type& i )
- {
- update_func( bNew, key, i );
- }
- };
-
- struct check_functor
- {
- void operator()( size_t nLevel, size_t hLeft, size_t hRight )
- {
- CPPUNIT_MSG("Consistency violation: level=" << nLevel << ", hLeft=" << hLeft << ", hRight=" << hRight );
- }
- };
-
- protected:
- template <class Set>
- void test_with( Set& s )
- {
- value_type itm;
- int key;
- typedef typename Set::exempt_ptr exempt_ptr;
-
- // insert/find test
- CPPUNIT_ASSERT( !s.contains( 10 ) );
- CPPUNIT_ASSERT( s.insert( 10 ) );
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 1 ) );
- CPPUNIT_ASSERT( s.contains( 10 ) );
-
- CPPUNIT_ASSERT( !s.insert( 10 ) );
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 1 ) );
-
- CPPUNIT_ASSERT( !s.contains( 20, std::less<key_type>() ) );
- CPPUNIT_ASSERT( s.insert( 20, 25 ) );
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 2 ) );
- CPPUNIT_ASSERT( s.contains( 10, std::less<key_type>() ) );
- CPPUNIT_ASSERT( s.contains( key = 20 ) );
- CPPUNIT_ASSERT( s.find_with( key, std::less<key_type>(), find_functor() ) );
- {
- copy_found<value_type> f;
- key = 20;
- CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
- CPPUNIT_ASSERT( f.m_found.nVal == 25 );
- CPPUNIT_ASSERT( f.m_found.stat.nFindFuncCall == 1 );
- }
- CPPUNIT_ASSERT( s.find( key, find_functor() ) );
- {
- copy_found<value_type> f;
- key = 20;
- CPPUNIT_ASSERT( s.find_with( key, std::less<key_type>(), std::ref( f ) ) );
- CPPUNIT_ASSERT( f.m_found.nVal == 25 );
- CPPUNIT_ASSERT( f.m_found.stat.nFindFuncCall == 2 );
- }
- CPPUNIT_ASSERT( s.find( 20, find_functor() ) );
- {
- copy_found<value_type> f;
- CPPUNIT_ASSERT( s.find_with( 20, std::less<key_type>(), std::ref( f ) ) );
- CPPUNIT_ASSERT( f.m_found.nVal == 25 );
- CPPUNIT_ASSERT( f.m_found.stat.nFindFuncCall == 3 );
- }
-
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 2 ) );
-
- CPPUNIT_ASSERT( !s.contains( 25 ) );
- CPPUNIT_ASSERT( s.insert_with( 25, insert_functor() ) );
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 3 ) );
- {
- copy_found<value_type> f;
- key = 25;
- CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
- CPPUNIT_ASSERT( f.m_found.nVal == 2500 );
- CPPUNIT_ASSERT( f.m_found.stat.nInsertFuncCall == 1 );
- }
-
- // update test
- key = 10;
- {
- copy_found<value_type> f;
- CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
- CPPUNIT_ASSERT( f.m_found.nVal == 0 );
- CPPUNIT_ASSERT( f.m_found.stat.nEnsureExistFuncCall == 0 );
- CPPUNIT_ASSERT( f.m_found.stat.nEnsureNewFuncCall == 0 );
- }
- std::pair<bool, bool> updateResult = s.update( key, update_functor() );
- CPPUNIT_ASSERT( updateResult.first && !updateResult.second );
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 3 ) );
- {
- copy_found<value_type> f;
- CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
- CPPUNIT_ASSERT( f.m_found.nVal == 1000 );
- CPPUNIT_ASSERT( f.m_found.stat.nEnsureExistFuncCall == 1 );
- CPPUNIT_ASSERT( f.m_found.stat.nEnsureNewFuncCall == 0 );
- }
-
- updateResult = s.update( 13, []( bool /*bNew*/, key_type key, value_type& v )
- {
- v.nVal = key * 1000;
- ++v.stat.nEnsureNewFuncCall;
- });
- CPPUNIT_ASSERT( updateResult.first && updateResult.second );
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 4 ) );
- {
- copy_found<value_type> f;
- key = 13;
- CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
- CPPUNIT_ASSERT( f.m_found.nVal == 13000 );
- CPPUNIT_ASSERT( f.m_found.stat.nEnsureExistFuncCall == 0 );
- CPPUNIT_ASSERT( f.m_found.stat.nEnsureNewFuncCall == 1 );
- }
-
- // erase test
- CPPUNIT_ASSERT( s.erase( 13 ) );
- CPPUNIT_ASSERT( !s.contains( 13 ) );
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 3 ) );
- CPPUNIT_ASSERT( !s.erase( 13 ) );
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 3 ) );
-
- CPPUNIT_ASSERT( s.contains( 10 ) );
- CPPUNIT_ASSERT( s.erase_with( 10, std::less<key_type>() ) );
- CPPUNIT_ASSERT( !s.contains( 10 ) );
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 2 ) );
- CPPUNIT_ASSERT( !s.erase_with( 10, std::less<key_type>() ) );
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 2 ) );
-
- CPPUNIT_ASSERT( s.contains( 20 ) );
- {
- copy_found<value_type> f;
- CPPUNIT_ASSERT( s.erase( 20, std::ref( f ) ) );
- CPPUNIT_ASSERT( f.m_found.nVal == 25 );
-
- CPPUNIT_ASSERT( s.insert( 235, 2350 ) );
- CPPUNIT_ASSERT( s.erase_with( 235, std::less<key_type>(), std::ref( f ) ) );
- CPPUNIT_ASSERT( f.m_found.nVal == 2350 );
- }
- CPPUNIT_ASSERT( !s.contains( 20 ) );
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 1 ) );
-
- s.clear();
- CPPUNIT_ASSERT( s.empty() );
- CPPUNIT_ASSERT( check_size( s, 0 ) );
-
- // emplace test
- CPPUNIT_ASSERT( s.emplace( 151 ) ); // key = 151, val=0
- CPPUNIT_ASSERT( s.emplace( 174, 471 ) ); // key = 174, val = 471
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 2 ) );
-
- CPPUNIT_ASSERT( s.contains( 151 ) );
- CPPUNIT_ASSERT( s.contains( 174, std::less<key_type>() ) );
- CPPUNIT_ASSERT( !s.contains( 190 ) );
-
- {
- copy_found<value_type> f;
- key = 151;
- CPPUNIT_ASSERT( s.find( key, std::ref( f )));
- CPPUNIT_ASSERT( f.m_found.nVal == 0 );
-
- key = 174;
- CPPUNIT_ASSERT( s.find( key, std::ref( f )));
- CPPUNIT_ASSERT( f.m_found.nVal == 471 );
- }
-
- s.clear();
- CPPUNIT_ASSERT( s.empty() );
- CPPUNIT_ASSERT( check_size( s, 0 ) );
-
- const int c_nStep = 10;
- int keys[1000];
- for ( key_type i = 0; i < static_cast<key_type>(sizeof(keys) / sizeof(keys[0])); ++i )
- keys[i] = i;
- shuffle( keys, keys + sizeof(keys) / sizeof(keys[0]));
-
- size_t nCount = 1;
- int nPrev;
- key_type keyPrev;
- exempt_ptr xp;
-
- // extract_min
- for ( int i = 0; i < static_cast<int>(sizeof(keys) / sizeof(keys[0])); ++i )
- CPPUNIT_ASSERT( s.emplace( keys[i], keys[i] * c_nStep ));
- CPPUNIT_CHECK( s.check_consistency( check_functor() ));
-
- xp = s.extract_min();
- CPPUNIT_ASSERT( xp );
- nPrev = xp->nVal;
- CPPUNIT_CHECK_EX( nPrev == 0, "Expected=0 real=" << nPrev );
- while ( !s.empty() ) {
- xp = s.extract_min();
- CPPUNIT_ASSERT( xp );
- CPPUNIT_CHECK_EX( nPrev + c_nStep == xp->nVal, "Expected=" << nPrev + c_nStep << " real=" << xp->nVal );
- nPrev = xp->nVal;
- ++nCount;
- }
- CPPUNIT_CHECK( nCount == sizeof(keys) / sizeof(keys[0]));
-
- // extract_min<Func>
- for ( int i = 0; i < static_cast<int>(sizeof(keys) / sizeof(keys[0])); ++i )
- CPPUNIT_ASSERT( s.insert( keys[i], keys[i] * c_nStep ));
- CPPUNIT_CHECK( s.check_consistency( check_functor() ));
-
- nCount = 1;
- xp = s.extract_min( [&keyPrev]( key_type k ){ keyPrev = k; });
- CPPUNIT_ASSERT( xp );
- nPrev = xp->nVal;
- CPPUNIT_CHECK_EX( keyPrev == 0, "Expected=0 real=" << keyPrev );
- CPPUNIT_CHECK_EX( nPrev == 0, "Expected=0 real=" << nPrev );
- while ( !s.empty() ) {
- xp = s.extract_min( [&key](key_type k){ key = k; } );
- CPPUNIT_ASSERT( xp );
- CPPUNIT_CHECK_EX( key == keyPrev + 1, "Expected=" << keyPrev + 1 << " real=" << key );
- CPPUNIT_CHECK_EX( nPrev + c_nStep == xp->nVal, "Expected=" << nPrev + c_nStep << " real=" << xp->nVal );
- nPrev = xp->nVal;
- ++keyPrev;
- ++nCount;
- }
- CPPUNIT_CHECK( nCount == sizeof(keys) / sizeof(keys[0]));
-
- // extract_min_key
- for ( int i = 0; i < static_cast<int>(sizeof(keys) / sizeof(keys[0])); ++i )
- CPPUNIT_ASSERT( s.insert( keys[i], keys[i] * c_nStep ));
- CPPUNIT_CHECK( s.check_consistency( check_functor() ));
-
- nCount = 1;
- xp = s.extract_min_key( keyPrev );
- CPPUNIT_ASSERT( xp );
- nPrev = xp->nVal;
- CPPUNIT_CHECK_EX( keyPrev == 0, "Expected=0 real=" << keyPrev );
- CPPUNIT_CHECK_EX( nPrev == 0, "Expected=0 real=" << nPrev );
- while ( !s.empty() ) {
- xp = s.extract_min_key( key );
- CPPUNIT_ASSERT( xp );
- CPPUNIT_CHECK_EX( key == keyPrev + 1, "Expected=" << keyPrev + 1 << " real=" << key );
- CPPUNIT_CHECK_EX( nPrev + c_nStep == xp->nVal, "Expected=" << nPrev + c_nStep << " real=" << xp->nVal );
- nPrev = xp->nVal;
- ++keyPrev;
- ++nCount;
- }
- CPPUNIT_CHECK( nCount == sizeof(keys) / sizeof(keys[0]));
-
- // extract_max
- for ( int i = 0; i < static_cast<int>(sizeof(keys) / sizeof(keys[0])); ++i )
- CPPUNIT_ASSERT( s.emplace( keys[i], keys[i] * c_nStep ));
- CPPUNIT_CHECK( s.check_consistency( check_functor() ));
-
- nCount = 1;
- xp = s.extract_max();
- CPPUNIT_ASSERT( xp );
- nPrev = xp->nVal;
- CPPUNIT_CHECK_EX( nPrev == c_nStep * (sizeof(keys) / sizeof(keys[0]) - 1),
- "Expected=" << c_nStep * (sizeof(keys) / sizeof(keys[0]) - 1) << " real=" << nPrev );
- while ( !s.empty() ) {
- xp = s.extract_max();
- CPPUNIT_ASSERT( xp );
- CPPUNIT_CHECK_EX( nPrev - c_nStep == xp->nVal, "Expected=" << nPrev - c_nStep << " real=" << xp->nVal );
- nPrev = xp->nVal;
- ++nCount;
- }
- CPPUNIT_CHECK( nCount == sizeof(keys) / sizeof(keys[0]));
-
- // extract_max<Func>
- for ( int i = 0; i < static_cast<int>(sizeof(keys) / sizeof(keys[0])); ++i )
- CPPUNIT_ASSERT( s.emplace( keys[i], keys[i] * c_nStep ));
- CPPUNIT_CHECK( s.check_consistency( check_functor() ));
-
- nCount = 1;
- xp = s.extract_max( [&keyPrev]( key_type k ){ keyPrev = k; });
- CPPUNIT_ASSERT( xp );
- nPrev = xp->nVal;
- CPPUNIT_CHECK_EX( keyPrev == sizeof(keys) / sizeof(keys[0]) - 1,
- "Expected=" << sizeof(keys) / sizeof(keys[0]) - 1 << " real=" << keyPrev );
- CPPUNIT_CHECK_EX( nPrev == c_nStep * (sizeof(keys) / sizeof(keys[0]) - 1),
- "Expected=" << c_nStep * (sizeof(keys) / sizeof(keys[0]) - 1) << " real=" << nPrev );
- while ( !s.empty() ) {
- xp = s.extract_max( [&key](key_type k){ key = k; });
- CPPUNIT_ASSERT( xp );
- CPPUNIT_CHECK_EX( key == keyPrev - 1, "Expected=" << keyPrev - 1 << " real=" << key );
- CPPUNIT_CHECK_EX( nPrev - c_nStep == xp->nVal, "Expected=" << nPrev - c_nStep << " real=" << xp->nVal );
- nPrev = xp->nVal;
- --keyPrev;
- ++nCount;
- }
- CPPUNIT_CHECK( nCount == sizeof(keys) / sizeof(keys[0]));
-
- // extract_max_key
- for ( int i = 0; i < static_cast<int>(sizeof(keys) / sizeof(keys[0])); ++i )
- CPPUNIT_ASSERT( s.emplace( keys[i], keys[i] * c_nStep ));
- CPPUNIT_CHECK( s.check_consistency( check_functor() ));
-
- nCount = 1;
- xp = s.extract_max_key( keyPrev );
- CPPUNIT_ASSERT( xp );
- nPrev = xp->nVal;
- CPPUNIT_CHECK_EX( keyPrev == sizeof(keys) / sizeof(keys[0]) - 1,
- "Expected=" << sizeof(keys) / sizeof(keys[0]) - 1 << " real=" << keyPrev );
- CPPUNIT_CHECK_EX( nPrev == c_nStep * (sizeof(keys) / sizeof(keys[0]) - 1),
- "Expected=" << c_nStep * (sizeof(keys) / sizeof(keys[0]) - 1) << " real=" << nPrev );
- while ( !s.empty() ) {
- xp = s.extract_max_key( key );
- CPPUNIT_ASSERT( xp );
- CPPUNIT_CHECK_EX( key == keyPrev - 1, "Expected=" << keyPrev - 1 << " real=" << key );
- CPPUNIT_CHECK_EX( nPrev - c_nStep == xp->nVal, "Expected=" << nPrev - c_nStep << " real=" << xp->nVal );
- nPrev = xp->nVal;
- --keyPrev;
- ++nCount;
- }
- CPPUNIT_CHECK( nCount == sizeof(keys) / sizeof(keys[0]));
-
- // extract
- for ( int i = 0; i < static_cast<int>(sizeof(keys) / sizeof(keys[0])); ++i )
- CPPUNIT_ASSERT( s.emplace( keys[i], keys[i] * c_nStep ));
- CPPUNIT_CHECK( s.check_consistency( check_functor() ));
-
- for ( int i = 0; i < static_cast<int>(sizeof( keys ) / sizeof( keys[0] )); ++i ) {
- xp = s.extract(keys[i]);
- CPPUNIT_CHECK_EX( xp->nVal == keys[i] * c_nStep, "Expected value=" << keys[i] * c_nStep << " real=" << xp->nVal );
- }
- CPPUNIT_ASSERT(s.empty());
-
-
- // extract_with
- for ( int i = 0; i < static_cast<int>(sizeof(keys) / sizeof(keys[0])); ++i )
- CPPUNIT_ASSERT( s.emplace( keys[i], keys[i] * c_nStep ));
- CPPUNIT_CHECK( s.check_consistency( check_functor() ));
-
- for ( int i = 0; i < static_cast<int>(sizeof( keys ) / sizeof( keys[0] )); ++i ) {
- xp = s.extract_with( wrapped_int(keys[i]), wrapped_less());
- CPPUNIT_CHECK_EX( xp->nVal == keys[i] * c_nStep, "Expected value=" << keys[i] * c_nStep << " real=" << xp->nVal );
- }
- CPPUNIT_ASSERT(s.empty());
- }
-
- template <class Set, class PrintStat>
- void test()
- {
- typedef Set set_type;
-
- set_type s;
-
- test_with( s );
-
- s.clear();
- CPPUNIT_ASSERT( s.empty() );
- CPPUNIT_ASSERT( check_size( s, 0 ) );
-
- PrintStat()(s);
- }
-
- void BronsonAVLTree_rcu_gpi_less();
- void BronsonAVLTree_rcu_gpi_less_stat();
- void BronsonAVLTree_rcu_gpi_cmp();
- void BronsonAVLTree_rcu_gpi_cmp_stat();
- void BronsonAVLTree_rcu_gpi_cmpless();
- void BronsonAVLTree_rcu_gpi_less_ic();
- void BronsonAVLTree_rcu_gpi_cmp_ic();
- void BronsonAVLTree_rcu_gpi_cmp_ic_stat();
- void BronsonAVLTree_rcu_gpi_cmp_ic_stat_yield();
- void BronsonAVLTree_rcu_gpi_less_relaxed_insert();
- void BronsonAVLTree_rcu_gpi_less_relaxed_insert_stat();
- void BronsonAVLTree_rcu_gpi_pool_monitor_less();
- void BronsonAVLTree_rcu_gpi_pool_monitor_less_stat();
- void BronsonAVLTree_rcu_gpi_pool_monitor_cmp_ic_stat();
- void BronsonAVLTree_rcu_gpi_pool_monitor_cmp_ic_stat_yield();
- void BronsonAVLTree_rcu_gpi_pool_monitor_less_relaxed_insert();
- void BronsonAVLTree_rcu_gpi_pool_monitor_less_relaxed_insert_stat();
-
- void BronsonAVLTree_rcu_gpb_less();
- void BronsonAVLTree_rcu_gpb_less_stat();
- void BronsonAVLTree_rcu_gpb_cmp();
- void BronsonAVLTree_rcu_gpb_cmp_stat();
- void BronsonAVLTree_rcu_gpb_cmpless();
- void BronsonAVLTree_rcu_gpb_less_ic();
- void BronsonAVLTree_rcu_gpb_cmp_ic();
- void BronsonAVLTree_rcu_gpb_cmp_ic_stat();
- void BronsonAVLTree_rcu_gpb_cmp_ic_stat_yield();
- void BronsonAVLTree_rcu_gpb_less_relaxed_insert();
- void BronsonAVLTree_rcu_gpb_less_relaxed_insert_stat();
- void BronsonAVLTree_rcu_gpb_pool_monitor_less();
- void BronsonAVLTree_rcu_gpb_pool_monitor_less_stat();
- void BronsonAVLTree_rcu_gpb_pool_monitor_cmp_ic_stat();
- void BronsonAVLTree_rcu_gpb_pool_monitor_cmp_ic_stat_yield();
- void BronsonAVLTree_rcu_gpb_pool_monitor_less_relaxed_insert();
- void BronsonAVLTree_rcu_gpb_pool_monitor_less_relaxed_insert_stat();
-
- void BronsonAVLTree_rcu_gpt_less();
- void BronsonAVLTree_rcu_gpt_less_stat();
- void BronsonAVLTree_rcu_gpt_cmp();
- void BronsonAVLTree_rcu_gpt_cmp_stat();
- void BronsonAVLTree_rcu_gpt_cmpless();
- void BronsonAVLTree_rcu_gpt_less_ic();
- void BronsonAVLTree_rcu_gpt_cmp_ic();
- void BronsonAVLTree_rcu_gpt_cmp_ic_stat();
- void BronsonAVLTree_rcu_gpt_cmp_ic_stat_yield();
- void BronsonAVLTree_rcu_gpt_less_relaxed_insert();
- void BronsonAVLTree_rcu_gpt_less_relaxed_insert_stat();
- void BronsonAVLTree_rcu_gpt_pool_monitor_less();
- void BronsonAVLTree_rcu_gpt_pool_monitor_less_stat();
- void BronsonAVLTree_rcu_gpt_pool_monitor_cmp_ic_stat();
- void BronsonAVLTree_rcu_gpt_pool_monitor_cmp_ic_stat_yield();
- void BronsonAVLTree_rcu_gpt_pool_monitor_less_relaxed_insert();
- void BronsonAVLTree_rcu_gpt_pool_monitor_less_relaxed_insert_stat();
-
- void BronsonAVLTree_rcu_shb_less();
- void BronsonAVLTree_rcu_shb_less_stat();
- void BronsonAVLTree_rcu_shb_cmp();
- void BronsonAVLTree_rcu_shb_cmp_stat();
- void BronsonAVLTree_rcu_shb_cmpless();
- void BronsonAVLTree_rcu_shb_less_ic();
- void BronsonAVLTree_rcu_shb_cmp_ic();
- void BronsonAVLTree_rcu_shb_cmp_ic_stat();
- void BronsonAVLTree_rcu_shb_cmp_ic_stat_yield();
- void BronsonAVLTree_rcu_shb_less_relaxed_insert();
- void BronsonAVLTree_rcu_shb_less_relaxed_insert_stat();
- void BronsonAVLTree_rcu_shb_pool_monitor_less();
- void BronsonAVLTree_rcu_shb_pool_monitor_less_stat();
- void BronsonAVLTree_rcu_shb_pool_monitor_cmp_ic_stat();
- void BronsonAVLTree_rcu_shb_pool_monitor_cmp_ic_stat_yield();
- void BronsonAVLTree_rcu_shb_pool_monitor_less_relaxed_insert();
- void BronsonAVLTree_rcu_shb_pool_monitor_less_relaxed_insert_stat();
-
- void BronsonAVLTree_rcu_sht_less();
- void BronsonAVLTree_rcu_sht_less_stat();
- void BronsonAVLTree_rcu_sht_cmp();
- void BronsonAVLTree_rcu_sht_cmp_stat();
- void BronsonAVLTree_rcu_sht_cmpless();
- void BronsonAVLTree_rcu_sht_less_ic();
- void BronsonAVLTree_rcu_sht_cmp_ic();
- void BronsonAVLTree_rcu_sht_cmp_ic_stat();
- void BronsonAVLTree_rcu_sht_cmp_ic_stat_yield();
- void BronsonAVLTree_rcu_sht_less_relaxed_insert();
- void BronsonAVLTree_rcu_sht_less_relaxed_insert_stat();
- void BronsonAVLTree_rcu_sht_pool_monitor_less();
- void BronsonAVLTree_rcu_sht_pool_monitor_less_stat();
- void BronsonAVLTree_rcu_sht_pool_monitor_cmp_ic_stat();
- void BronsonAVLTree_rcu_sht_pool_monitor_cmp_ic_stat_yield();
- void BronsonAVLTree_rcu_sht_pool_monitor_less_relaxed_insert();
- void BronsonAVLTree_rcu_sht_pool_monitor_less_relaxed_insert_stat();
-
- CPPUNIT_TEST_SUITE( BronsonAVLTreeHdrTest )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpi_less )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpi_less_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpi_cmp )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpi_cmp_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpi_cmpless )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpi_less_ic )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpi_cmp_ic )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpi_cmp_ic_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpi_cmp_ic_stat_yield )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpi_less_relaxed_insert )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpi_less_relaxed_insert_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpi_pool_monitor_less )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpi_pool_monitor_less_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpi_pool_monitor_cmp_ic_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpi_pool_monitor_cmp_ic_stat_yield )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpi_pool_monitor_less_relaxed_insert )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpi_pool_monitor_less_relaxed_insert_stat )
-
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpb_less )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpb_less_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpb_cmp )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpb_cmp_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpb_cmpless )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpb_less_ic )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpb_cmp_ic )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpb_cmp_ic_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpb_cmp_ic_stat_yield )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpb_less_relaxed_insert )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpb_less_relaxed_insert_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpb_pool_monitor_less )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpb_pool_monitor_less_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpb_pool_monitor_cmp_ic_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpb_pool_monitor_cmp_ic_stat_yield )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpb_pool_monitor_less_relaxed_insert )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpb_pool_monitor_less_relaxed_insert_stat )
-
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpt_less )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpt_less_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpt_cmp )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpt_cmp_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpt_cmpless )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpt_less_ic )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpt_cmp_ic )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpt_cmp_ic_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpt_cmp_ic_stat_yield )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpt_less_relaxed_insert )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpt_less_relaxed_insert_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpt_pool_monitor_less )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpt_pool_monitor_less_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpt_pool_monitor_cmp_ic_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpt_pool_monitor_cmp_ic_stat_yield )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpt_pool_monitor_less_relaxed_insert )
- CPPUNIT_TEST( BronsonAVLTree_rcu_gpt_pool_monitor_less_relaxed_insert_stat )
-
- CPPUNIT_TEST( BronsonAVLTree_rcu_shb_less )
- CPPUNIT_TEST( BronsonAVLTree_rcu_shb_less_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_shb_cmp )
- CPPUNIT_TEST( BronsonAVLTree_rcu_shb_cmp_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_shb_cmpless )
- CPPUNIT_TEST( BronsonAVLTree_rcu_shb_less_ic )
- CPPUNIT_TEST( BronsonAVLTree_rcu_shb_cmp_ic )
- CPPUNIT_TEST( BronsonAVLTree_rcu_shb_cmp_ic_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_shb_cmp_ic_stat_yield )
- CPPUNIT_TEST( BronsonAVLTree_rcu_shb_less_relaxed_insert )
- CPPUNIT_TEST( BronsonAVLTree_rcu_shb_less_relaxed_insert_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_shb_pool_monitor_less )
- CPPUNIT_TEST( BronsonAVLTree_rcu_shb_pool_monitor_less_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_shb_pool_monitor_cmp_ic_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_shb_pool_monitor_cmp_ic_stat_yield )
- CPPUNIT_TEST( BronsonAVLTree_rcu_shb_pool_monitor_less_relaxed_insert )
- CPPUNIT_TEST( BronsonAVLTree_rcu_shb_pool_monitor_less_relaxed_insert_stat )
-
- CPPUNIT_TEST( BronsonAVLTree_rcu_sht_less )
- CPPUNIT_TEST( BronsonAVLTree_rcu_sht_less_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_sht_cmp )
- CPPUNIT_TEST( BronsonAVLTree_rcu_sht_cmp_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_sht_cmpless )
- CPPUNIT_TEST( BronsonAVLTree_rcu_sht_less_ic )
- CPPUNIT_TEST( BronsonAVLTree_rcu_sht_cmp_ic )
- CPPUNIT_TEST( BronsonAVLTree_rcu_sht_cmp_ic_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_sht_cmp_ic_stat_yield )
- CPPUNIT_TEST( BronsonAVLTree_rcu_sht_less_relaxed_insert )
- CPPUNIT_TEST( BronsonAVLTree_rcu_sht_less_relaxed_insert_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_sht_pool_monitor_less )
- CPPUNIT_TEST( BronsonAVLTree_rcu_sht_pool_monitor_less_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_sht_pool_monitor_cmp_ic_stat )
- CPPUNIT_TEST( BronsonAVLTree_rcu_sht_pool_monitor_cmp_ic_stat_yield )
- CPPUNIT_TEST( BronsonAVLTree_rcu_sht_pool_monitor_less_relaxed_insert )
- CPPUNIT_TEST( BronsonAVLTree_rcu_sht_pool_monitor_less_relaxed_insert_stat )
-
- CPPUNIT_TEST_SUITE_END()
- };
-} // namespace tree
-
-#endif // #ifndef CDSTEST_HDR_BRONSON_AVLTREE_MAP_H
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_bronson_avltree_map.h"
-#include <cds/urcu/general_buffered.h>
-#include <cds/container/bronson_avltree_map_rcu.h>
-
-#include "unit/print_bronsonavltree_stat.h"
-
-namespace tree {
- namespace cc = cds::container;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t )
- {
- std::cout << t.statistics();
- }
- };
- } // namespace
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_less()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,cc::bronson_avltree::relaxed_insert< false >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_less_stat()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,cc::bronson_avltree::relaxed_insert< false >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_cmp()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_cmp_stat()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::stat< cc::bronson_avltree::stat<> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_cmpless()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::less< std::less<key_type> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_less_ic()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_cmp_ic()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_cmp_ic_stat()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::bronson_avltree::stat<> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_cmp_ic_stat_yield()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,co::back_off< cds::backoff::yield >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_less_relaxed_insert()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,cc::bronson_avltree::relaxed_insert< true >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_less_relaxed_insert_stat()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,cc::bronson_avltree::relaxed_insert< true >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
-} // namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_bronson_avltree_map.h"
-#include <cds/urcu/general_buffered.h>
-#include <cds/container/bronson_avltree_map_rcu.h>
-#include <cds/sync/pool_monitor.h>
-#include <cds/memory/vyukov_queue_pool.h>
-
-#include "unit/print_bronsonavltree_stat.h"
-#include "unit/print_sync_monitor_stat.h"
-
-namespace tree {
- namespace cc = cds::container;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t ) const
- {
- std::cout << t.statistics();
- std::cout << t.monitor().statistics();
- }
- };
-
- typedef cds::memory::vyukov_queue_pool< std::mutex > simple_pool;
- typedef cds::memory::lazy_vyukov_queue_pool< std::mutex > lazy_pool;
- typedef cds::memory::bounded_vyukov_queue_pool< std::mutex > bounded_pool;
- } // namespace
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_pool_monitor_less()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::sync_monitor< cds::sync::pool_monitor<simple_pool> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_pool_monitor_less_stat()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,co::sync_monitor< cds::sync::pool_monitor<lazy_pool, cds::opt::none, true >>
- ,cc::bronson_avltree::relaxed_insert< false >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_pool_monitor_cmp_ic_stat()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,co::sync_monitor< cds::sync::pool_monitor<bounded_pool, cds::opt::none, true >>
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_pool_monitor_cmp_ic_stat_yield()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,co::back_off< cds::backoff::yield >
- ,co::sync_monitor< cds::sync::pool_monitor<lazy_pool, cds::opt::none, true >>
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_pool_monitor_less_relaxed_insert()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,cc::bronson_avltree::relaxed_insert< true >
- ,co::sync_monitor< cds::sync::pool_monitor<lazy_pool> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpb_pool_monitor_less_relaxed_insert_stat()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,cc::bronson_avltree::relaxed_insert< true >
- ,co::sync_monitor< cds::sync::pool_monitor<simple_pool, cds::opt::none, true >>
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
-} // namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_bronson_avltree_map.h"
-#include <cds/urcu/general_instant.h>
-#include <cds/container/bronson_avltree_map_rcu.h>
-
-#include "unit/print_bronsonavltree_stat.h"
-
-namespace tree {
- namespace cc = cds::container;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t )
- {
- std::cout << t.statistics();
- }
- };
- } // namespace
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_less()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,cc::bronson_avltree::relaxed_insert< false >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_less_stat()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,cc::bronson_avltree::relaxed_insert< false >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_cmp()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_cmp_stat()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::stat< cc::bronson_avltree::stat<> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_cmpless()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::less< std::less<key_type> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_less_ic()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_cmp_ic()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_cmp_ic_stat()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::bronson_avltree::stat<> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_cmp_ic_stat_yield()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,co::back_off< cds::backoff::yield >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_less_relaxed_insert()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,cc::bronson_avltree::relaxed_insert< true >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_less_relaxed_insert_stat()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,cc::bronson_avltree::relaxed_insert< true >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
-} // namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_bronson_avltree_map.h"
-#include <cds/urcu/general_instant.h>
-#include <cds/container/bronson_avltree_map_rcu.h>
-#include <cds/sync/pool_monitor.h>
-#include <cds/memory/vyukov_queue_pool.h>
-
-#include "unit/print_bronsonavltree_stat.h"
-#include "unit/print_sync_monitor_stat.h"
-
-namespace tree {
- namespace cc = cds::container;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t )
- {
- std::cout << t.statistics();
- std::cout << t.monitor().statistics();
- }
- };
-
- typedef cds::memory::vyukov_queue_pool< std::mutex > simple_pool;
- typedef cds::memory::lazy_vyukov_queue_pool< std::mutex > lazy_pool;
- typedef cds::memory::bounded_vyukov_queue_pool< std::mutex > bounded_pool;
- } // namespace
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_pool_monitor_less()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::sync_monitor< cds::sync::pool_monitor<simple_pool> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_pool_monitor_less_stat()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,co::sync_monitor< cds::sync::pool_monitor<lazy_pool> >
- ,cc::bronson_avltree::relaxed_insert< false >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_pool_monitor_cmp_ic_stat()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,co::sync_monitor< cds::sync::pool_monitor<bounded_pool> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_pool_monitor_cmp_ic_stat_yield()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,co::back_off< cds::backoff::yield >
- ,co::sync_monitor< cds::sync::pool_monitor<lazy_pool> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_pool_monitor_less_relaxed_insert()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,cc::bronson_avltree::relaxed_insert< true >
- ,co::sync_monitor< cds::sync::pool_monitor<lazy_pool> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpi_pool_monitor_less_relaxed_insert_stat()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,cc::bronson_avltree::relaxed_insert< true >
- ,co::sync_monitor< cds::sync::pool_monitor<simple_pool> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
-} // namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_bronson_avltree_map.h"
-#include <cds/urcu/general_threaded.h>
-#include <cds/container/bronson_avltree_map_rcu.h>
-
-#include "unit/print_bronsonavltree_stat.h"
-
-namespace tree {
- namespace cc = cds::container;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t )
- {
- std::cout << t.statistics();
- }
- };
- } // namespace
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_less()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,cc::bronson_avltree::relaxed_insert< false >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_less_stat()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,cc::bronson_avltree::relaxed_insert< false >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_cmp()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_cmp_stat()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::stat< cc::bronson_avltree::stat<> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_cmpless()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::less< std::less<key_type> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_less_ic()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_cmp_ic()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_cmp_ic_stat()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::bronson_avltree::stat<> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_cmp_ic_stat_yield()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,co::back_off< cds::backoff::yield >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_less_relaxed_insert()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,cc::bronson_avltree::relaxed_insert< true >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_less_relaxed_insert_stat()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,cc::bronson_avltree::relaxed_insert< true >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
-} // namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_bronson_avltree_map.h"
-#include <cds/urcu/general_threaded.h>
-#include <cds/container/bronson_avltree_map_rcu.h>
-#include <cds/sync/pool_monitor.h>
-#include <cds/memory/vyukov_queue_pool.h>
-
-#include "unit/print_bronsonavltree_stat.h"
-#include "unit/print_sync_monitor_stat.h"
-
-
-namespace tree {
- namespace cc = cds::container;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t )
- {
- std::cout << t.statistics();
- std::cout << t.monitor().statistics();
- }
- };
-
- typedef cds::memory::vyukov_queue_pool< std::mutex > simple_pool;
- typedef cds::memory::lazy_vyukov_queue_pool< std::mutex > lazy_pool;
- typedef cds::memory::bounded_vyukov_queue_pool< std::mutex > bounded_pool;
- } // namespace
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_pool_monitor_less()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::sync_monitor< cds::sync::pool_monitor<simple_pool> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_pool_monitor_less_stat()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,co::sync_monitor< cds::sync::pool_monitor<lazy_pool> >
- ,cc::bronson_avltree::relaxed_insert< false >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_pool_monitor_cmp_ic_stat()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,co::sync_monitor< cds::sync::pool_monitor<bounded_pool> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_pool_monitor_cmp_ic_stat_yield()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,co::back_off< cds::backoff::yield >
- ,co::sync_monitor< cds::sync::pool_monitor<lazy_pool> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_pool_monitor_less_relaxed_insert()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,cc::bronson_avltree::relaxed_insert< true >
- ,co::sync_monitor< cds::sync::pool_monitor<lazy_pool> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_gpt_pool_monitor_less_relaxed_insert_stat()
- {
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,cc::bronson_avltree::relaxed_insert< true >
- ,co::sync_monitor< cds::sync::pool_monitor<simple_pool> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
- }
-
-} // namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_bronson_avltree_map.h"
-#include <cds/urcu/signal_buffered.h>
-#include <cds/container/bronson_avltree_map_rcu.h>
-
-#include "unit/print_bronsonavltree_stat.h"
-
-namespace tree {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace cc = cds::container;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t )
- {
- std::cout << t.statistics();
- }
- };
- } // namespace
-#endif
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,cc::bronson_avltree::relaxed_insert< false >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_less_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,cc::bronson_avltree::relaxed_insert< false >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_cmp_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::stat< cc::bronson_avltree::stat<> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_cmpless()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::less< std::less<key_type> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_less_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_cmp_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_cmp_ic_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::bronson_avltree::stat<> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_cmp_ic_stat_yield()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,co::back_off< cds::backoff::yield >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_less_relaxed_insert()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,cc::bronson_avltree::relaxed_insert< true >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_less_relaxed_insert_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,cc::bronson_avltree::relaxed_insert< true >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
-} // namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_bronson_avltree_map.h"
-#include <cds/urcu/signal_buffered.h>
-#include <cds/container/bronson_avltree_map_rcu.h>
-#include <cds/sync/pool_monitor.h>
-#include <cds/memory/vyukov_queue_pool.h>
-
-#include "unit/print_bronsonavltree_stat.h"
-#include "unit/print_sync_monitor_stat.h"
-
-namespace tree {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace cc = cds::container;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t )
- {
- std::cout << t.statistics();
- std::cout << t.monitor().statistics();
- }
- };
-
- typedef cds::memory::vyukov_queue_pool< std::mutex > simple_pool;
- typedef cds::memory::lazy_vyukov_queue_pool< std::mutex > lazy_pool;
- typedef cds::memory::bounded_vyukov_queue_pool< std::mutex > bounded_pool;
- } // namespace
-#endif
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_pool_monitor_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::sync_monitor< cds::sync::pool_monitor<simple_pool> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_pool_monitor_less_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,co::sync_monitor< cds::sync::pool_monitor<lazy_pool> >
- ,cc::bronson_avltree::relaxed_insert< false >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_pool_monitor_cmp_ic_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,co::sync_monitor< cds::sync::pool_monitor<bounded_pool> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_pool_monitor_cmp_ic_stat_yield()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,co::back_off< cds::backoff::yield >
- ,co::sync_monitor< cds::sync::pool_monitor<lazy_pool> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_pool_monitor_less_relaxed_insert()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,cc::bronson_avltree::relaxed_insert< true >
- ,co::sync_monitor< cds::sync::pool_monitor<lazy_pool> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_shb_pool_monitor_less_relaxed_insert_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,cc::bronson_avltree::relaxed_insert< true >
- ,co::sync_monitor< cds::sync::pool_monitor<simple_pool> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-} // namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_bronson_avltree_map.h"
-#include <cds/urcu/signal_threaded.h>
-#include <cds/container/bronson_avltree_map_rcu.h>
-
-#include "unit/print_bronsonavltree_stat.h"
-
-namespace tree {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace cc = cds::container;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t )
- {
- std::cout << t.statistics();
- }
- };
- } // namespace
-#endif
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,cc::bronson_avltree::relaxed_insert< false >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_less_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,cc::bronson_avltree::relaxed_insert< false >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_cmp_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::stat< cc::bronson_avltree::stat<> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_cmpless()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::less< std::less<key_type> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_less_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_cmp_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_cmp_ic_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::bronson_avltree::stat<> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_cmp_ic_stat_yield()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,co::back_off< cds::backoff::yield >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_less_relaxed_insert()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,cc::bronson_avltree::relaxed_insert< true >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_less_relaxed_insert_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,cc::bronson_avltree::relaxed_insert< true >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
-} // namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_bronson_avltree_map.h"
-#include <cds/urcu/signal_threaded.h>
-#include <cds/container/bronson_avltree_map_rcu.h>
-#include <cds/sync/pool_monitor.h>
-#include <cds/memory/vyukov_queue_pool.h>
-
-#include "unit/print_bronsonavltree_stat.h"
-#include "unit/print_sync_monitor_stat.h"
-
-namespace tree {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace cc = cds::container;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t )
- {
- std::cout << t.statistics();
- std::cout << t.monitor().statistics();
- }
- };
-
- typedef cds::memory::vyukov_queue_pool< std::mutex > simple_pool;
- typedef cds::memory::lazy_vyukov_queue_pool< std::mutex > lazy_pool;
- typedef cds::memory::bounded_vyukov_queue_pool< std::mutex > bounded_pool;
- } // namespace
-#endif
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_pool_monitor_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::sync_monitor< cds::sync::pool_monitor<simple_pool> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_pool_monitor_less_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,co::sync_monitor< cds::sync::pool_monitor<lazy_pool> >
- ,cc::bronson_avltree::relaxed_insert< false >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_pool_monitor_cmp_ic_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,co::sync_monitor< cds::sync::pool_monitor<bounded_pool> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_pool_monitor_cmp_ic_stat_yield()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::compare< compare >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,co::back_off< cds::backoff::yield >
- ,co::sync_monitor< cds::sync::pool_monitor<lazy_pool> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_pool_monitor_less_relaxed_insert()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,cc::bronson_avltree::relaxed_insert< true >
- ,co::sync_monitor< cds::sync::pool_monitor<lazy_pool> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-
- void BronsonAVLTreeHdrTest::BronsonAVLTree_rcu_sht_pool_monitor_less_relaxed_insert_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- struct traits: public
- cc::bronson_avltree::make_traits<
- co::less< std::less<key_type> >
- ,co::stat< cc::bronson_avltree::stat<> >
- ,cc::bronson_avltree::relaxed_insert< true >
- ,co::sync_monitor< cds::sync::pool_monitor<simple_pool> >
- >::type
- {};
- typedef cc::BronsonAVLTreeMap< rcu_type, key_type, value_type, traits > map_type;
- test<map_type, print_stat>();
-#endif
- }
-} // namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef CDSTEST_HDR_ELLENBINTREE_MAP_H
-#define CDSTEST_HDR_ELLENBINTREE_MAP_H
-
-#include "cppunit/cppunit_proxy.h"
-#include "size_check.h"
-#include <functional> // ref
-#include <algorithm>
-
-namespace tree {
- using misc::check_size;
-
- class EllenBinTreeMapHdrTest: public CppUnitMini::TestCase
- {
- public:
- typedef int key_type;
-
- struct stat_data {
- size_t nInsertFuncCall;
- size_t nEnsureExistFuncCall;
- size_t nEnsureNewFuncCall;
- size_t nEraseFuncCall;
- size_t nFindFuncCall;
- size_t nFindConstFuncCall;
-
- stat_data()
- : nInsertFuncCall(0)
- , nEnsureExistFuncCall(0)
- , nEnsureNewFuncCall(0)
- , nEraseFuncCall(0)
- , nFindFuncCall(0)
- , nFindConstFuncCall(0)
- {}
- };
-
- struct value_type: public stat_data
- {
- int nVal;
-
- value_type()
- : nVal(0)
- {}
-
- value_type( int v )
- : nVal( v )
- {}
-
- value_type( value_type const& v )
- : nVal( v.nVal )
- {}
-
- value_type( value_type&& v )
- : nVal( v.nVal )
- {}
-
- value_type& operator=( int n )
- {
- nVal = n;
- return *this;
- }
-
- value_type& operator=( value_type const& v )
- {
- nVal = v.nVal;
- return *this;
- }
- };
-
- typedef std::pair<key_type const, value_type> pair_type;
-
- struct less {
- bool operator()( int k1, int k2 ) const
- {
- return k1 < k2;
- }
- };
-
- struct compare {
- int cmp( int k1, int k2 ) const
- {
- return k1 < k2 ? -1 : (k1 > k2 ? 1 : 0);
- }
- int operator()( int k1, int k2 ) const
- {
- return cmp( k1, k2 );
- }
- };
-
- struct wrapped_int {
- int nKey;
-
- wrapped_int( int n )
- : nKey(n)
- {}
- };
-
- struct wrapped_less
- {
- bool operator()( wrapped_int const& w, int n ) const
- {
- return w.nKey < n;
- }
- bool operator()( int n, wrapped_int const& w ) const
- {
- return n < w.nKey;
- }
- /*
- template <typename T>
- bool operator()( wrapped_int const& w, T const& v ) const
- {
- return w.nKey < v.nKey;
- }
- template <typename T>
- bool operator()( T const& v, wrapped_int const& w ) const
- {
- return v.nKey < w.nKey;
- }
- */
- };
-
- protected:
- template <typename Map>
- struct insert_functor
- {
- typedef typename Map::value_type pair_type;
-
- // insert ftor
- void operator()( pair_type& item )
- {
- item.second.nVal = item.first * 3;
- }
-
- // update ftor
- void operator()( bool bNew, pair_type& item )
- {
- if ( bNew )
- item.second.nVal = item.first * 2;
- else
- item.second.nVal = item.first * 5;
- }
- };
-
- 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.nVal == m_nExpected );
- }
- template <typename T, typename Q>
- void operator ()( T& pair, Q )
- {
- CPPUNIT_ASSERT_CURRENT( pair.second.nVal == m_nExpected );
- }
- };
-
- struct extract_functor
- {
- int * m_pVal;
- void operator()( pair_type const& val )
- {
- *m_pVal = val.second.nVal;
- }
- };
-
- protected:
- static const size_t c_nItemCount = 10000;
-
- class data_array
- {
- int * pFirst;
- int * pLast;
-
- public:
- data_array()
- : pFirst( new int[c_nItemCount] )
- , pLast( pFirst + c_nItemCount )
- {
- int i = 0;
- for ( int * p = pFirst; p != pLast; ++p, ++i )
- *p = i;
-
- shuffle( pFirst, pLast );
- }
-
- ~data_array()
- {
- delete [] pFirst;
- }
-
- int operator[]( size_t i ) const
- {
- assert( i < size_t(pLast - pFirst) );
- return pFirst[i];
- }
- };
-
- struct extract_functor2
- {
- int nKey;
-
- template <typename Q>
- void operator()( Q&, pair_type& v )
- {
- nKey = v.first;
- }
- };
-
-
- protected:
-
- template <class Map>
- void test_with( Map& m )
- {
- std::pair<bool, bool> updateResult;
-
- // insert
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
- CPPUNIT_ASSERT( !m.contains(25) );
- CPPUNIT_ASSERT( m.insert( 25 ) ) ; // value = 0
- CPPUNIT_ASSERT( m.contains(25) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 1 ));
- CPPUNIT_ASSERT( m.contains(25) );
-
- CPPUNIT_ASSERT( !m.insert( 25 ) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 1 ));
-
- CPPUNIT_ASSERT( !m.contains(10, less()) );
- CPPUNIT_ASSERT( m.insert( 10, 10 ) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 2 ));
- CPPUNIT_ASSERT( m.contains(10, less()) );
-
- CPPUNIT_ASSERT( !m.insert( 10, 20 ) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 2 ));
-
- CPPUNIT_ASSERT( !m.contains(30) );
- CPPUNIT_ASSERT( m.insert_with( 30, insert_functor<Map>() ) ) ; // value = 90
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( m.contains(30) );
-
- CPPUNIT_ASSERT( !m.insert_with( 10, insert_functor<Map>() ) );
- CPPUNIT_ASSERT( !m.insert_with( 25, insert_functor<Map>() ) );
- CPPUNIT_ASSERT( !m.insert_with( 30, insert_functor<Map>() ) );
-
- // update (new key)
- CPPUNIT_ASSERT( !m.contains(27) );
- updateResult = m.update( 27, insert_functor<Map>(), false ) ; // value = 54
- CPPUNIT_ASSERT( !updateResult.first );
- CPPUNIT_ASSERT( !updateResult.second );
- CPPUNIT_ASSERT( !m.contains(27) );
- updateResult = m.update( 27, insert_functor<Map>(), true ) ; // value = 54
- CPPUNIT_ASSERT( updateResult.first );
- CPPUNIT_ASSERT( updateResult.second );
- CPPUNIT_ASSERT( m.contains(27) );
-
- // find test
- check_value chk(10);
- CPPUNIT_ASSERT( m.find( 10, std::ref(chk) ));
- chk.m_nExpected = 0;
- CPPUNIT_ASSERT( m.find_with( 25, less(), std::ref( chk ) ) );
- chk.m_nExpected = 90;
- CPPUNIT_ASSERT( m.find( 30, std::ref( chk ) ) );
- chk.m_nExpected = 54;
- CPPUNIT_ASSERT( m.find( 27, std::ref( chk ) ) );
-
- updateResult = m.update( 10, insert_functor<Map>() ) ; // value = 50
- CPPUNIT_ASSERT( updateResult.first );
- CPPUNIT_ASSERT( !updateResult.second );
- chk.m_nExpected = 50;
- CPPUNIT_ASSERT( m.find( 10, std::ref( chk ) ) );
-
- // erase test
- CPPUNIT_ASSERT( !m.contains(100) );
- CPPUNIT_ASSERT( !m.erase( 100 )) ; // not found
-
- CPPUNIT_ASSERT( m.contains(25) );
- CPPUNIT_ASSERT( check_size( m, 4 ));
- CPPUNIT_ASSERT( m.erase( 25 ));
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( !m.contains(25) );
- CPPUNIT_ASSERT( !m.erase( 25 ));
-
- CPPUNIT_ASSERT( !m.contains(258) );
- CPPUNIT_ASSERT( m.insert(258))
- CPPUNIT_ASSERT( check_size( m, 4 ));
- CPPUNIT_ASSERT( m.contains(258, less()) );
- CPPUNIT_ASSERT( m.erase_with( 258, less() ));
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( !m.contains(258) );
- CPPUNIT_ASSERT( !m.erase_with( 258, less() ));
-
- int nVal;
- extract_functor ext;
- ext.m_pVal = &nVal;
-
- CPPUNIT_ASSERT( !m.contains(29) );
- CPPUNIT_ASSERT( m.insert(29, 290));
- CPPUNIT_ASSERT( check_size( m, 4 ));
- CPPUNIT_ASSERT( m.erase_with( 29, less(), std::ref( ext ) ) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
- CPPUNIT_ASSERT( nVal == 290 );
- nVal = -1;
- CPPUNIT_ASSERT( !m.erase_with( 29, less(), std::ref( ext ) ) );
- CPPUNIT_ASSERT( nVal == -1 );
-
- CPPUNIT_ASSERT( m.erase( 30, std::ref( ext ) ) );
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 2 ));
- CPPUNIT_ASSERT( nVal == 90 );
- nVal = -1;
- CPPUNIT_ASSERT( !m.erase( 30, std::ref( ext ) ) );
- CPPUNIT_ASSERT( nVal == -1 );
-
- m.clear();
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
-
- // emplace test
- CPPUNIT_ASSERT( m.emplace(126) ) ; // key = 126, val = 0
- CPPUNIT_ASSERT( m.emplace(137, 731)) ; // key = 137, val = 731
- CPPUNIT_ASSERT( m.emplace( 149, value_type(941) )) ; // key = 149, val = 941
-
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
-
- chk.m_nExpected = 0;
- CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
- chk.m_nExpected = 731;
- CPPUNIT_ASSERT( m.find_with( 137, less(), std::ref(chk) ));
- chk.m_nExpected = 941;
- CPPUNIT_ASSERT( m.find( 149, std::ref(chk) ));
-
- CPPUNIT_ASSERT( !m.emplace(126, 621)) ; // already in map
- chk.m_nExpected = 0;
- CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
- CPPUNIT_ASSERT( !m.empty() );
- CPPUNIT_ASSERT( check_size( m, 3 ));
-
- m.clear();
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
- }
-
- template <typename Map>
- void fill_map( Map& s, data_array& a )
- {
- CPPUNIT_ASSERT( s.empty() );
- for ( size_t i = 0; i < c_nItemCount; ++i ) {
- CPPUNIT_ASSERT( s.insert( a[i] ));
- }
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, c_nItemCount ));
- }
-
- template <class Map, class PrintStat>
- void test()
- {
- typedef Map map_type;
-
- map_type m;
-
- test_with( m );
-
- m.clear();
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
-
- // extract min/max
- {
- typename map_type::guarded_ptr gp;
-
- data_array arr;
- fill_map( m, arr );
-
- int i = 0;
- std::pair<key_type, value_type> v;
- while ( !m.empty() ) {
- gp = m.extract_min();
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_ASSERT( gp->first == i );
- ++i;
- }
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
-
-
- fill_map( m, arr );
- i = (int) c_nItemCount - 1;
- while ( !m.empty() ) {
- gp = m.extract_max();
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_ASSERT( gp->first == i );
- --i;
- }
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
-
- fill_map( m, arr );
- for ( int i = 0; i < static_cast<int>( c_nItemCount ); ++i ) {
- int nKey = arr[i];
- gp = m.get( nKey );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->first == nKey );
-
- gp = m.extract( nKey );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->first == nKey );
-
- gp = m.get( nKey );
- CPPUNIT_CHECK( !gp );
- CPPUNIT_CHECK( gp.empty());
- CPPUNIT_CHECK( !m.extract( nKey ));
- CPPUNIT_CHECK( gp.empty());
- }
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
-
- fill_map( m, arr );
- for ( int i = 0; i < static_cast<int>( c_nItemCount ); ++i ) {
- int nKey = arr[i];
- gp = m.get_with( wrapped_int( nKey ), wrapped_less() );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->first == nKey );
-
- gp = m.extract_with( wrapped_int( nKey ), wrapped_less() );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->first == nKey );
-
- gp = m.get_with( wrapped_int( nKey ), wrapped_less() );
- CPPUNIT_CHECK( !gp );
- CPPUNIT_CHECK( gp.empty());
- CPPUNIT_CHECK( !m.extract_with( wrapped_int(nKey), wrapped_less() ));
- CPPUNIT_CHECK( gp.empty());
- }
-
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
- }
-
- PrintStat()( m );
- }
-
- template <class Map, class PrintStat>
- void test_rcu()
- {
- typedef Map map_type;
-
- map_type m;
-
- test_with( m );
-
- m.clear();
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
-
- // extract min/max
- {
- typename map_type::exempt_ptr ep;
- data_array arr;
- fill_map( m, arr );
-
- int i = 0;
- while ( !m.empty() ) {
- ep = m.extract_min();
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty());
- CPPUNIT_ASSERT(ep->first == i );
- ++i;
- //ep.release();
- }
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
- ep = m.extract_min();
- CPPUNIT_ASSERT( !ep );
- CPPUNIT_ASSERT( ep.empty());
-
- fill_map( m, arr );
- i = (int) c_nItemCount - 1;
- while ( !m.empty() ) {
- ep = m.extract_max();
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty());
- CPPUNIT_ASSERT( ep->first == i );
- --i;
- //ep.release();
- }
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
- ep = m.extract_max();
- CPPUNIT_ASSERT( !ep );
- CPPUNIT_ASSERT( ep.empty());
-
- fill_map( m, arr );
- for ( size_t i = 0; i < c_nItemCount; ++i ) {
- int nKey = arr[i];
- {
- typename map_type::rcu_lock l;
- typename map_type::value_type * pVal = m.get(nKey);
- CPPUNIT_ASSERT( pVal != nullptr );
- CPPUNIT_CHECK( pVal->first == nKey);
- }
- ep = m.extract( nKey );
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty());
- CPPUNIT_CHECK( ep->first == nKey);
- //ep.release();
-
- ep = m.extract( nKey );
- CPPUNIT_ASSERT( !ep );
- CPPUNIT_ASSERT( ep.empty());
- {
- typename map_type::rcu_lock l;
- CPPUNIT_CHECK( !m.get(nKey));
- }
- }
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
-
- fill_map( m, arr );
- for ( size_t i = 0; i < c_nItemCount; ++i ) {
- int nKey = arr[i];
- {
- typename map_type::rcu_lock l;
- typename map_type::value_type * pVal = m.get_with(wrapped_int(nKey), wrapped_less());
- CPPUNIT_ASSERT( pVal != nullptr );
- CPPUNIT_CHECK( pVal->first == nKey);
- }
- ep = m.extract_with( wrapped_int( nKey ), wrapped_less() );
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty());
- CPPUNIT_CHECK( ep->first == nKey);
- //ep.release();
-
- ep = m.extract_with( wrapped_int( nKey ), wrapped_less() );
- CPPUNIT_ASSERT( !ep );
- CPPUNIT_ASSERT( ep.empty());
- {
- typename map_type::rcu_lock l;
- CPPUNIT_CHECK( !m.get_with(wrapped_int(nKey), wrapped_less()));
- }
- }
- CPPUNIT_ASSERT( m.empty() );
- CPPUNIT_ASSERT( check_size( m, 0 ));
- }
-
- PrintStat()( m );
- }
-
- void EllenBinTree_hp_less();
- void EllenBinTree_hp_cmp();
- void EllenBinTree_hp_cmpless();
- void EllenBinTree_hp_less_ic();
- void EllenBinTree_hp_cmp_ic();
- void EllenBinTree_hp_less_stat();
- void EllenBinTree_hp_cmp_ic_stat();
- void EllenBinTree_hp_cmp_ic_stat_yield();
- void EllenBinTree_hp_less_pool();
- void EllenBinTree_hp_less_pool_ic_stat();
-
- void EllenBinTree_dhp_less();
- void EllenBinTree_dhp_cmp();
- void EllenBinTree_dhp_cmpless();
- void EllenBinTree_dhp_less_ic();
- void EllenBinTree_dhp_cmp_ic();
- void EllenBinTree_dhp_less_stat();
- void EllenBinTree_dhp_cmp_ic_stat();
- void EllenBinTree_dhp_cmp_ic_stat_yield();
- void EllenBinTree_dhp_less_pool();
- void EllenBinTree_dhp_less_pool_ic_stat();
-
- void EllenBinTree_rcu_gpi_less();
- void EllenBinTree_rcu_gpi_cmp();
- void EllenBinTree_rcu_gpi_cmpless();
- void EllenBinTree_rcu_gpi_less_ic();
- void EllenBinTree_rcu_gpi_cmp_ic();
- void EllenBinTree_rcu_gpi_less_stat();
- void EllenBinTree_rcu_gpi_cmp_ic_stat();
- void EllenBinTree_rcu_gpi_cmp_ic_stat_yield();
- void EllenBinTree_rcu_gpi_less_pool();
- void EllenBinTree_rcu_gpi_less_pool_ic_stat();
-
- void EllenBinTree_rcu_gpb_less();
- void EllenBinTree_rcu_gpb_cmp();
- void EllenBinTree_rcu_gpb_cmpless();
- void EllenBinTree_rcu_gpb_less_ic();
- void EllenBinTree_rcu_gpb_cmp_ic();
- void EllenBinTree_rcu_gpb_less_stat();
- void EllenBinTree_rcu_gpb_cmp_ic_stat();
- void EllenBinTree_rcu_gpb_cmp_ic_stat_yield();
- void EllenBinTree_rcu_gpb_less_pool();
- void EllenBinTree_rcu_gpb_less_pool_ic_stat();
-
- void EllenBinTree_rcu_gpt_less();
- void EllenBinTree_rcu_gpt_cmp();
- void EllenBinTree_rcu_gpt_cmpless();
- void EllenBinTree_rcu_gpt_less_ic();
- void EllenBinTree_rcu_gpt_cmp_ic();
- void EllenBinTree_rcu_gpt_less_stat();
- void EllenBinTree_rcu_gpt_cmp_ic_stat();
- void EllenBinTree_rcu_gpt_cmp_ic_stat_yield();
- void EllenBinTree_rcu_gpt_less_pool();
- void EllenBinTree_rcu_gpt_less_pool_ic_stat();
-
- void EllenBinTree_rcu_shb_less();
- void EllenBinTree_rcu_shb_cmp();
- void EllenBinTree_rcu_shb_cmpless();
- void EllenBinTree_rcu_shb_less_ic();
- void EllenBinTree_rcu_shb_cmp_ic();
- void EllenBinTree_rcu_shb_less_stat();
- void EllenBinTree_rcu_shb_cmp_ic_stat();
- void EllenBinTree_rcu_shb_cmp_ic_stat_yield();
- void EllenBinTree_rcu_shb_less_pool();
- void EllenBinTree_rcu_shb_less_pool_ic_stat();
-
- void EllenBinTree_rcu_sht_less();
- void EllenBinTree_rcu_sht_cmp();
- void EllenBinTree_rcu_sht_cmpless();
- void EllenBinTree_rcu_sht_less_ic();
- void EllenBinTree_rcu_sht_cmp_ic();
- void EllenBinTree_rcu_sht_less_stat();
- void EllenBinTree_rcu_sht_cmp_ic_stat();
- void EllenBinTree_rcu_sht_cmp_ic_stat_yield();
- void EllenBinTree_rcu_sht_less_pool();
- void EllenBinTree_rcu_sht_less_pool_ic_stat();
-
- CPPUNIT_TEST_SUITE(EllenBinTreeMapHdrTest)
- CPPUNIT_TEST(EllenBinTree_hp_less)
- CPPUNIT_TEST(EllenBinTree_hp_cmp)
- CPPUNIT_TEST(EllenBinTree_hp_less_stat)
- CPPUNIT_TEST(EllenBinTree_hp_cmpless)
- CPPUNIT_TEST(EllenBinTree_hp_less_ic)
- CPPUNIT_TEST(EllenBinTree_hp_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_hp_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_hp_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_hp_less_pool )
- CPPUNIT_TEST(EllenBinTree_hp_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_dhp_less)
- CPPUNIT_TEST(EllenBinTree_dhp_cmp)
- CPPUNIT_TEST(EllenBinTree_dhp_less_stat)
- CPPUNIT_TEST(EllenBinTree_dhp_cmpless)
- CPPUNIT_TEST(EllenBinTree_dhp_less_ic)
- CPPUNIT_TEST(EllenBinTree_dhp_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_dhp_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_dhp_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_dhp_less_pool )
- CPPUNIT_TEST(EllenBinTree_dhp_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_less)
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_cmp)
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_less_stat)
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_cmpless)
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_less_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_rcu_gpi_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_rcu_gpi_less_pool )
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_less)
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_cmp)
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_less_stat)
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_cmpless)
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_less_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_rcu_gpb_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_rcu_gpb_less_pool )
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_less)
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_cmp)
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_less_stat)
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_cmpless)
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_less_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_rcu_gpt_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_rcu_gpt_less_pool )
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_rcu_shb_less)
- CPPUNIT_TEST(EllenBinTree_rcu_shb_cmp)
- CPPUNIT_TEST(EllenBinTree_rcu_shb_less_stat)
- CPPUNIT_TEST(EllenBinTree_rcu_shb_cmpless)
- CPPUNIT_TEST(EllenBinTree_rcu_shb_less_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_shb_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_shb_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_rcu_shb_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_rcu_shb_less_pool )
- CPPUNIT_TEST(EllenBinTree_rcu_shb_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_rcu_sht_less)
- CPPUNIT_TEST(EllenBinTree_rcu_sht_cmp)
- CPPUNIT_TEST(EllenBinTree_rcu_sht_less_stat)
- CPPUNIT_TEST(EllenBinTree_rcu_sht_cmpless)
- CPPUNIT_TEST(EllenBinTree_rcu_sht_less_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_sht_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_sht_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_rcu_sht_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_rcu_sht_less_pool )
- CPPUNIT_TEST(EllenBinTree_rcu_sht_less_pool_ic_stat)
-
- CPPUNIT_TEST_SUITE_END()
-
- };
-} // namespace tree
-
-#endif // #ifndef CDSTEST_HDR_ELLENBINTREE_MAP_H
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_ellenbintree_map.h"
-#include <cds/container/ellen_bintree_map_dhp.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_dhp.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
- namespace cc = cds::container;
- namespace co = cds::opt;
- namespace {
- typedef cds::gc::DHP gc_type;
-
- typedef cc::ellen_bintree::map_node<gc_type, EllenBinTreeMapHdrTest::key_type, EllenBinTreeMapHdrTest::value_type> tree_leaf_node;
- typedef cc::ellen_bintree::internal_node< EllenBinTreeMapHdrTest::key_type, tree_leaf_node > tree_internal_node;
- typedef cc::ellen_bintree::update_desc<tree_leaf_node, tree_internal_node> tree_update_desc;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
-
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_dhp_less()
- {
- struct map_traits : public cc::ellen_bintree::traits
- {
- typedef EllenBinTreeMapHdrTest::less less;
- };
- typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, map_traits > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_dhp_cmp()
- {
- typedef cc::EllenBinTreeMap< gc_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::compare< compare >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_dhp_cmpless()
- {
- typedef cc::EllenBinTreeMap< gc_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::compare< compare >
- ,co::less< less >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_dhp_less_ic()
- {
- typedef cc::EllenBinTreeMap< gc_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_dhp_cmp_ic()
- {
- typedef cc::EllenBinTreeMap< gc_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::item_counter< cds::atomicity::item_counter >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_dhp_less_stat()
- {
- typedef cc::EllenBinTreeMap< gc_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_dhp_cmp_ic_stat()
- {
- typedef cc::EllenBinTreeMap< gc_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_dhp_cmp_ic_stat_yield()
- {
- typedef cc::EllenBinTreeMap< gc_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- , co::back_off< cds::backoff::yield >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_dhp_less_pool()
- {
- typedef cc::EllenBinTreeMap< gc_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_dhp::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_dhp::update_desc_pool_accessor > >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_dhp_less_pool_ic_stat()
- {
- typedef cc::EllenBinTreeMap< gc_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_dhp::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_dhp::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
-} // namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_ellenbintree_map.h"
-#include <cds/container/ellen_bintree_map_hp.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_hp.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
- namespace cc = cds::container;
- namespace co = cds::opt;
- namespace {
- typedef cds::gc::HP gc_type;
-
- typedef cc::ellen_bintree::map_node<gc_type, EllenBinTreeMapHdrTest::key_type, EllenBinTreeMapHdrTest::value_type> tree_leaf_node;
- typedef cc::ellen_bintree::internal_node< EllenBinTreeMapHdrTest::key_type, tree_leaf_node > tree_internal_node;
- typedef cc::ellen_bintree::update_desc<tree_leaf_node, tree_internal_node> tree_update_desc;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
-
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_hp_less()
- {
- struct set_traits : public cc::ellen_bintree::traits
- {
- typedef EllenBinTreeMapHdrTest::less less;
- };
- typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, set_traits > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_hp_cmp()
- {
- typedef cc::EllenBinTreeMap< gc_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::compare< compare >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_hp_cmpless()
- {
- typedef cc::EllenBinTreeMap< gc_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::compare< compare >
- ,co::less< less >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_hp_less_ic()
- {
- typedef cc::EllenBinTreeMap< gc_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_hp_cmp_ic()
- {
- typedef cc::EllenBinTreeMap< gc_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::item_counter< cds::atomicity::item_counter >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_hp_less_stat()
- {
- typedef cc::EllenBinTreeMap< gc_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_hp_cmp_ic_stat()
- {
- typedef cc::EllenBinTreeMap< gc_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_hp_cmp_ic_stat_yield()
- {
- typedef cc::EllenBinTreeMap< gc_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- , co::back_off< cds::backoff::yield >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_hp_less_pool()
- {
- typedef cc::EllenBinTreeMap< gc_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_hp::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_hp::update_desc_pool_accessor > >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_hp_less_pool_ic_stat()
- {
- typedef cc::EllenBinTreeMap< gc_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_hp::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_hp::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
-} // namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_ellenbintree_map.h"
-#include <cds/urcu/general_buffered.h>
-#include <cds/container/ellen_bintree_map_rcu.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_rcu.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
- namespace cc = cds::container;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type;
-
- typedef cc::ellen_bintree::map_node<rcu_type, EllenBinTreeMapHdrTest::key_type, EllenBinTreeMapHdrTest::value_type> tree_leaf_node;
- typedef cc::ellen_bintree::internal_node< EllenBinTreeMapHdrTest::key_type, tree_leaf_node > tree_internal_node;
- typedef cc::ellen_bintree::update_desc<tree_leaf_node, tree_internal_node> tree_update_desc;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpb_less()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- >::type
- > map_type;
-
- test_rcu<map_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpb_cmp()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::compare< compare >
- >::type
- > map_type;
-
- test_rcu<map_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpb_cmpless()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::compare< compare >
- ,co::less< less >
- >::type
- > map_type;
-
- test_rcu<map_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpb_less_ic()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > map_type;
-
- test_rcu<map_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpb_cmp_ic()
- {
- struct map_traits : public cc::ellen_bintree::traits {
- typedef cds::atomicity::item_counter item_counter;
- typedef EllenBinTreeMapHdrTest::compare compare;
- };
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type, map_traits > map_type;
-
- test_rcu<map_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpb_less_stat()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > map_type;
-
- test_rcu<map_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpb_cmp_ic_stat()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- >::type
- > map_type;
-
- test_rcu<map_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpb_cmp_ic_stat_yield()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- , co::back_off< cds::backoff::yield >
- >::type
- > map_type;
-
- test_rcu<map_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpb_less_pool()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- >::type
- > map_type;
-
- test_rcu<map_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpb_less_pool_ic_stat()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > map_type;
-
- test_rcu<map_type, print_stat>();
- }
-
-} // namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_ellenbintree_map.h"
-#include <cds/urcu/general_instant.h>
-#include <cds/container/ellen_bintree_map_rcu.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_rcu.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
- namespace cc = cds::container;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type;
-
- typedef cc::ellen_bintree::map_node<rcu_type, EllenBinTreeMapHdrTest::key_type, EllenBinTreeMapHdrTest::value_type> tree_leaf_node;
- typedef cc::ellen_bintree::internal_node< EllenBinTreeMapHdrTest::key_type, tree_leaf_node > tree_internal_node;
- typedef cc::ellen_bintree::update_desc<tree_leaf_node, tree_internal_node> tree_update_desc;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
-
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpi_less()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpi_cmp()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpi_cmpless()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::compare< compare >
- ,co::less< less >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpi_less_ic()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpi_cmp_ic()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::item_counter< cds::atomicity::item_counter >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpi_less_stat()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpi_cmp_ic_stat()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpi_cmp_ic_stat_yield()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- , co::back_off< cds::backoff::yield >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpi_less_pool()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpi_less_pool_ic_stat()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
-} // namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_ellenbintree_map.h"
-#include <cds/urcu/general_threaded.h>
-#include <cds/container/ellen_bintree_map_rcu.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_rcu.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
- namespace cc = cds::container;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type;
-
- typedef cc::ellen_bintree::map_node<rcu_type, EllenBinTreeMapHdrTest::key_type, EllenBinTreeMapHdrTest::value_type> tree_leaf_node;
- typedef cc::ellen_bintree::internal_node< EllenBinTreeMapHdrTest::key_type, tree_leaf_node > tree_internal_node;
- typedef cc::ellen_bintree::update_desc<tree_leaf_node, tree_internal_node> tree_update_desc;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
-
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpt_less()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpt_cmp()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpt_cmpless()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::compare< compare >
- ,co::less< less >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpt_less_ic()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpt_cmp_ic()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::item_counter< cds::atomicity::item_counter >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpt_less_stat()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpt_cmp_ic_stat()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpt_cmp_ic_stat_yield()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- , co::back_off< cds::backoff::yield >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpt_less_pool()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_gpt_less_pool_ic_stat()
- {
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
-} // namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_ellenbintree_map.h"
-#include <cds/urcu/signal_buffered.h>
-#include <cds/container/ellen_bintree_map_rcu.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_rcu.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace cc = cds::container;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
-
- typedef cc::ellen_bintree::map_node<rcu_type, EllenBinTreeMapHdrTest::key_type, EllenBinTreeMapHdrTest::value_type> tree_leaf_node;
- typedef cc::ellen_bintree::internal_node< EllenBinTreeMapHdrTest::key_type, tree_leaf_node > tree_internal_node;
- typedef cc::ellen_bintree::update_desc<tree_leaf_node, tree_internal_node> tree_update_desc;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
- }
-#endif
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_shb_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_shb_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_shb_cmpless()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::compare< compare >
- ,co::less< less >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_shb_less_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_shb_cmp_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::item_counter< cds::atomicity::item_counter >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_shb_less_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_shb_cmp_ic_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_shb_cmp_ic_stat_yield()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- , co::back_off< cds::backoff::yield >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_shb_less_pool()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_shb_less_pool_ic_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
-} // namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_ellenbintree_map.h"
-#include <cds/urcu/signal_threaded.h>
-#include <cds/container/ellen_bintree_map_rcu.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_rcu.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace cc = cds::container;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type;
-
- typedef cc::ellen_bintree::map_node<rcu_type, EllenBinTreeMapHdrTest::key_type, EllenBinTreeMapHdrTest::value_type> tree_leaf_node;
- typedef cc::ellen_bintree::internal_node< EllenBinTreeMapHdrTest::key_type, tree_leaf_node > tree_internal_node;
- typedef cc::ellen_bintree::update_desc<tree_leaf_node, tree_internal_node> tree_update_desc;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
- }
-#endif
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_sht_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_sht_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_sht_cmpless()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::compare< compare >
- ,co::less< less >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_sht_less_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_sht_cmp_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::item_counter< cds::atomicity::item_counter >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_sht_less_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_sht_cmp_ic_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_sht_cmp_ic_stat_yield()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- , co::back_off< cds::backoff::yield >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_sht_less_pool()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeMapHdrTest::EllenBinTree_rcu_sht_less_pool_ic_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_map_traits<
- co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
-} // namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef CDSTEST_HDR_ELLENBINTREE_SET_H
-#define CDSTEST_HDR_ELLENBINTREE_SET_H
-
-#include "cppunit/cppunit_proxy.h"
-#include "size_check.h"
-#include <functional> // ref
-#include <algorithm>
-
-namespace tree {
- using misc::check_size;
-
- class EllenBinTreeSetHdrTest: public CppUnitMini::TestCase
- {
- public:
- typedef int key_type;
-
- struct stat_data {
- size_t nInsertFuncCall;
- size_t nEnsureExistFuncCall;
- size_t nEnsureNewFuncCall;
- size_t nEraseFuncCall;
- size_t nFindFuncCall;
- size_t nFindConstFuncCall;
-
- stat_data()
- : nInsertFuncCall(0)
- , nEnsureExistFuncCall(0)
- , nEnsureNewFuncCall(0)
- , nEraseFuncCall(0)
- , nFindFuncCall(0)
- , nFindConstFuncCall(0)
- {}
- };
-
- struct value_type {
- key_type nKey;
- int nVal;
-
- stat_data stat;
-
- value_type()
- {}
-
- value_type( int key )
- : nKey( key )
- , nVal( key * 10 )
- {}
-
- value_type( int key, int v )
- : nKey( key )
- , nVal( v )
- {}
-
- value_type( std::pair<int,int> const& p )
- : nKey( p.first )
- , nVal( p.second )
- {}
- };
-
- struct key_extractor {
- void operator()( key_type& dest, value_type const& src ) const
- {
- dest = src.nKey;
- }
- };
-
- struct less {
- bool operator()( int k1, int k2 ) const
- {
- return k1 < k2;
- }
- bool operator()( value_type const& v1, value_type const& v2 ) const
- {
- return v1.nKey < v2.nKey;
- }
- bool operator()( value_type const& v, int k ) const
- {
- return v.nKey < k;
- }
- bool operator()( int k, value_type const& v ) const
- {
- return k < v.nKey;
- }
- bool operator()( std::pair<int,int> const& p, value_type& v ) const
- {
- return p.first < v.nKey;
- }
- bool operator()( value_type& v, std::pair<int,int> const& p ) const
- {
- return v.nKey < p.first;
- }
- bool operator()( std::pair<int,int> const& p, int v ) const
- {
- return p.first < v;
- }
- bool operator()( int v, std::pair<int,int> const& p ) const
- {
- return v < p.first;
- }
- };
-
- struct compare {
- int cmp( int k1, int k2 ) const
- {
- return k1 < k2 ? -1 : (k1 > k2 ? 1 : 0);
- }
- int operator()( int k1, int k2 ) const
- {
- return cmp( k1, k2 );
- }
- int operator()( value_type const& v1, value_type const& v2 ) const
- {
- return cmp( v1.nKey, v2.nKey );
- }
- int operator()( value_type const& v, int k ) const
- {
- return cmp( v.nKey, k );
- }
- int operator()( int k, value_type const& v ) const
- {
- return cmp( k, v.nKey );
- }
- int operator()( std::pair<int,int> const& p, value_type& v ) const
- {
- return cmp( p.first, v.nKey );
- }
- int operator()( value_type& v, std::pair<int,int> const& p ) const
- {
- return cmp( v.nKey, p.first );
- }
- int operator()( std::pair<int,int> const& p, int v ) const
- {
- return cmp( p.first, v );
- }
- int operator()( int v, std::pair<int,int> const& p ) const
- {
- return cmp( v, p.first );
- }
- };
-
- struct wrapped_int {
- int nKey;
-
- wrapped_int( int n )
- : nKey(n)
- {}
- };
-
- struct wrapped_less
- {
- bool operator()( wrapped_int const& w, int n ) const
- {
- return w.nKey < n;
- }
- bool operator()( int n, wrapped_int const& w ) const
- {
- return n < w.nKey;
- }
- template <typename T>
- bool operator()( wrapped_int const& w, T const& v ) const
- {
- return w.nKey < v.nKey;
- }
- template <typename T>
- bool operator()( T const& v, wrapped_int const& w ) const
- {
- return v.nKey < w.nKey;
- }
- };
-
- protected:
- static const size_t c_nItemCount = 10000;
-
- class data_array
- {
- int * pFirst;
- int * pLast;
-
- public:
- data_array()
- : pFirst( new int[c_nItemCount] )
- , pLast( pFirst + c_nItemCount )
- {
- int i = 0;
- for ( int * p = pFirst; p != pLast; ++p, ++i )
- *p = i;
-
- shuffle( pFirst, pLast );
- }
-
- ~data_array()
- {
- delete [] pFirst;
- }
-
- int operator[]( size_t i ) const
- {
- assert( i < size_t(pLast - pFirst) );
- return pFirst[i];
- }
- };
-
- struct find_functor
- {
- template <typename T>
- void operator()( value_type& i, T& /*val*/ )
- {
- ++i.stat.nFindFuncCall;
- }
- template <typename T>
- void operator()( value_type& i, T const& /*val*/ )
- {
- ++i.stat.nFindConstFuncCall;
- }
- };
-
- template <typename Item>
- struct copy_found
- {
- Item m_found;
-
- template <typename T>
- void operator()( Item& i, T& /*val*/ )
- {
- m_found = i;
- }
-
- void operator()( Item const& i )
- {
- m_found = i;
- }
- };
-
- struct insert_functor
- {
- template <typename Item>
- void operator()(Item& i )
- {
- i.nVal = i.nKey * 100;
- ++i.stat.nInsertFuncCall;
- }
- };
-
- template <typename Q>
- static void ensure_func( bool bNew, value_type& i, Q& /*val*/ )
- {
- if ( bNew )
- ++i.stat.nEnsureNewFuncCall;
- else
- ++i.stat.nEnsureExistFuncCall;
- }
-
- struct update_functor
- {
- template <typename Q>
- void operator()( bool bNew, value_type& i, Q& val )
- {
- ensure_func( bNew, i, val );
- }
- };
-
- struct extract_functor
- {
- int nKey;
-
- template <typename Q>
- void operator()( Q&, value_type& v )
- {
- nKey = v.nKey;
- }
- };
-
-
- protected:
- template <class Set>
- void test_with( Set& s)
- {
- value_type itm;
- int key;
-
- // insert/find test
- CPPUNIT_ASSERT( !s.contains( 10 ) );
- CPPUNIT_ASSERT( s.insert( 10 ));
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 1 ));
- CPPUNIT_ASSERT( s.contains( 10 ) );
-
- CPPUNIT_ASSERT( !s.insert( 10 ));
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 1 ));
-
- CPPUNIT_ASSERT( !s.contains( 20, less() ) );
- CPPUNIT_ASSERT( s.insert( std::make_pair(20, 25) ));
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 2 ));
- CPPUNIT_ASSERT( s.contains( 10, less() ) );
- CPPUNIT_ASSERT( s.contains( key = 20 ) );
- CPPUNIT_ASSERT( s.find_with( key, less(), find_functor() ) );
- {
- copy_found<value_type> f;
- f.m_found.nKey = 0;
- key = 20;
- CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
- CPPUNIT_ASSERT( f.m_found.nKey == 20 );
- CPPUNIT_ASSERT( f.m_found.nVal == 25 );
- CPPUNIT_ASSERT( f.m_found.stat.nFindFuncCall == 1 );
- CPPUNIT_ASSERT( f.m_found.stat.nFindConstFuncCall == 0 );
- }
- CPPUNIT_ASSERT( s.find( key, find_functor() ) );
- {
- copy_found<value_type> f;
- f.m_found.nKey = 0;
- key = 20;
- CPPUNIT_ASSERT( s.find_with( key, less(), std::ref( f ) ) );
- CPPUNIT_ASSERT( f.m_found.nKey == 20 );
- CPPUNIT_ASSERT( f.m_found.nVal == 25 );
- CPPUNIT_ASSERT( f.m_found.stat.nFindFuncCall == 2 );
- CPPUNIT_ASSERT( f.m_found.stat.nFindConstFuncCall == 0 );
- }
- CPPUNIT_ASSERT( s.find( 20, find_functor() ) );
- {
- copy_found<value_type> f;
- f.m_found.nKey = 0;
- CPPUNIT_ASSERT( s.find_with( 20, less(), std::ref( f ) ) );
- CPPUNIT_ASSERT( f.m_found.nKey == 20 );
- CPPUNIT_ASSERT( f.m_found.nVal == 25 );
- CPPUNIT_ASSERT( f.m_found.stat.nFindFuncCall == 2 );
- CPPUNIT_ASSERT( f.m_found.stat.nFindConstFuncCall == 1 );
- }
-
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 2 ));
-
- CPPUNIT_ASSERT( !s.contains( 25 ) );
- CPPUNIT_ASSERT( s.insert( std::make_pair(25, -1), insert_functor() ));
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 3 ));
- {
- copy_found<value_type> f;
- f.m_found.nKey = 0;
- key = 25;
- CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
- CPPUNIT_ASSERT( f.m_found.nKey == 25 );
- CPPUNIT_ASSERT( f.m_found.nVal == 2500 );
- CPPUNIT_ASSERT( f.m_found.stat.nInsertFuncCall == 1 );
- }
-
- // update test
- key = 10;
- {
- copy_found<value_type> f;
- f.m_found.nKey = 0;
- CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
- CPPUNIT_ASSERT( f.m_found.nKey == 10 );
- CPPUNIT_ASSERT( f.m_found.nVal == 100 );
- CPPUNIT_ASSERT( f.m_found.stat.nEnsureExistFuncCall == 0 );
- CPPUNIT_ASSERT( f.m_found.stat.nEnsureNewFuncCall == 0 );
- }
- std::pair<bool, bool> updateResult = s.update( key, update_functor(), false );
- CPPUNIT_ASSERT( updateResult.first && !updateResult.second );
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 3 ));
- {
- copy_found<value_type> f;
- f.m_found.nKey = 0;
- CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
- CPPUNIT_ASSERT( f.m_found.nKey == 10 );
- CPPUNIT_ASSERT( f.m_found.nVal == 100 );
- CPPUNIT_ASSERT( f.m_found.stat.nEnsureExistFuncCall == 1 );
- CPPUNIT_ASSERT( f.m_found.stat.nEnsureNewFuncCall == 0 );
- }
-
- updateResult = s.update( std::make_pair(13, 1300), update_functor(), false );
- CPPUNIT_ASSERT( !updateResult.first && !updateResult.second );
- updateResult = s.update( std::make_pair(13, 1300), update_functor());
- CPPUNIT_ASSERT( updateResult.first && updateResult.second );
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 4 ));
- {
- copy_found<value_type> f;
- f.m_found.nKey = 0;
- key = 13;
- CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
- CPPUNIT_ASSERT( f.m_found.nKey == 13 );
- CPPUNIT_ASSERT( f.m_found.nVal == 1300 );
- CPPUNIT_ASSERT( f.m_found.stat.nEnsureExistFuncCall == 0 );
- CPPUNIT_ASSERT( f.m_found.stat.nEnsureNewFuncCall == 1 );
- }
-
- // erase test
- CPPUNIT_ASSERT( s.erase(13) );
- CPPUNIT_ASSERT( !s.contains( 13 ));
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 3 ));
- CPPUNIT_ASSERT( !s.erase(13) );
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 3 ));
-
- CPPUNIT_ASSERT( s.contains( 10 ));
- CPPUNIT_ASSERT( s.erase_with( 10, less() ));
- CPPUNIT_ASSERT( !s.contains( 10 ));
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 2 ));
- CPPUNIT_ASSERT( !s.erase_with(10, less()) );
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 2 ));
-
- CPPUNIT_ASSERT( s.contains(20) );
- {
- copy_found<value_type> f;
- f.m_found.nKey = 0;
- CPPUNIT_ASSERT( s.erase( 20, std::ref( f ) ) );
- CPPUNIT_ASSERT( f.m_found.nKey == 20 );
- CPPUNIT_ASSERT( f.m_found.nVal == 25 );
-
- CPPUNIT_ASSERT( s.insert(235))
- CPPUNIT_ASSERT( s.erase_with( 235, less(), std::ref( f ) ) );
- CPPUNIT_ASSERT( f.m_found.nKey == 235 );
- CPPUNIT_ASSERT( f.m_found.nVal == 2350 );
- }
- CPPUNIT_ASSERT( !s.contains( 20 ));
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 1 ));
-
- s.clear();
- CPPUNIT_ASSERT( s.empty() );
- CPPUNIT_ASSERT( check_size( s, 0 ));
-
- // emplace test
- CPPUNIT_ASSERT( s.emplace( 151 )) ; // key = 151, val = 1510
- CPPUNIT_ASSERT( s.emplace( 174, 471 )) ; // key = 174, val = 471
- CPPUNIT_ASSERT( s.emplace( std::make_pair( 190, 91 ) )) ; // key == 190, val = 91
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, 3 ));
-
- CPPUNIT_ASSERT( s.contains(151));
- CPPUNIT_ASSERT( s.contains(174, less()));
- CPPUNIT_ASSERT( s.contains(190));
-
- {
- copy_found<value_type> f;
- f.m_found.nKey = 0;
- key = 151;
- CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
- CPPUNIT_ASSERT( f.m_found.nKey == 151 );
- CPPUNIT_ASSERT( f.m_found.nVal == 1510 );
-
- key = 174;
- CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
- CPPUNIT_ASSERT( f.m_found.nKey == 174 );
- CPPUNIT_ASSERT( f.m_found.nVal == 471 );
-
- key = 190;
- CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
- CPPUNIT_ASSERT( f.m_found.nKey == 190 );
- CPPUNIT_ASSERT( f.m_found.nVal == 91 );
- }
-
- s.clear();
- CPPUNIT_ASSERT( s.empty() );
- CPPUNIT_ASSERT( check_size( s, 0 ));
- }
-
- template <typename Set>
- void fill_set( Set& s, data_array& a )
- {
- CPPUNIT_ASSERT( s.empty() );
- for ( size_t i = 0; i < c_nItemCount; ++i ) {
- CPPUNIT_ASSERT( s.insert( a[i] ));
- }
- CPPUNIT_ASSERT( !s.empty() );
- CPPUNIT_ASSERT( check_size( s, c_nItemCount ));
-
- }
-
- template <class Set, class PrintStat>
- void test()
- {
- typedef Set set_type;
-
- set_type s;
-
- test_with( s );
-
- s.clear();
- CPPUNIT_ASSERT( s.empty() );
- CPPUNIT_ASSERT( check_size( s, 0 ));
-
- // extract min/max
- {
- typename Set::guarded_ptr gp;
-
- data_array arr;
- fill_set( s, arr );
-
- int i = 0;
- while ( !s.empty() ) {
- gp = s.extract_min();
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( gp->nKey == i );
- ++i;
- }
- CPPUNIT_ASSERT( s.empty() );
- CPPUNIT_ASSERT( check_size( s, 0 ));
-
- fill_set( s, arr );
- i = (int) c_nItemCount - 1;
- while ( !s.empty() ) {
- gp = s.extract_max();
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( gp->nKey == i );
- --i;
- }
- CPPUNIT_ASSERT( s.empty() );
- CPPUNIT_ASSERT( check_size( s, 0 ));
-
- fill_set( s, arr );
- for ( int i = 0; i < static_cast<int>( c_nItemCount ); ++i ) {
- int nKey = arr[i];
- gp = s.get( nKey );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->nKey == nKey );
-
- gp = s.extract( nKey );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->nKey == nKey );
-
- gp = s.get( nKey );
- CPPUNIT_CHECK( !gp );
- CPPUNIT_CHECK( gp.empty());
- CPPUNIT_CHECK( !s.extract( nKey ));
- CPPUNIT_CHECK( gp.empty());
- }
- CPPUNIT_ASSERT( s.empty() );
- CPPUNIT_ASSERT( check_size( s, 0 ));
-
- fill_set( s, arr );
- for ( int i = 0; i < static_cast<int>( c_nItemCount ); ++i ) {
- int nKey = arr[i];
- gp = s.get_with( wrapped_int( nKey ), wrapped_less() );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->nKey == nKey );
-
- gp = s.extract_with( wrapped_int( nKey ), wrapped_less() );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->nKey == nKey );
-
- gp = s.get_with( wrapped_int( nKey ), wrapped_less() );
- CPPUNIT_CHECK( !gp );
- CPPUNIT_CHECK( gp.empty());
- CPPUNIT_CHECK( !s.extract_with( wrapped_int(nKey), wrapped_less() ));
- CPPUNIT_CHECK( gp.empty());
- }
- CPPUNIT_ASSERT( s.empty() );
- CPPUNIT_ASSERT( check_size( s, 0 ));
- }
-
- PrintStat()( s );
- }
-
- template <class Set, class PrintStat>
- void test_rcu()
- {
- typedef Set set_type;
-
- set_type s;
-
- test_with( s );
-
- s.clear();
- CPPUNIT_ASSERT( s.empty() );
- CPPUNIT_ASSERT( check_size( s, 0 ));
-
- // extract min/max
- {
- typename set_type::exempt_ptr ep;
- data_array arr;
- fill_set( s, arr );
-
- int i = 0;
- value_type v;
- while ( !s.empty() ) {
- ep = s.extract_min();
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty());
- CPPUNIT_CHECK( ep->nKey == i );
- ++i;
- //ep.release();
- }
- ep.release();
- CPPUNIT_ASSERT( s.empty() );
- CPPUNIT_ASSERT( check_size( s, 0 ));
-
- fill_set( s, arr );
- i = (int) c_nItemCount - 1;
- while ( !s.empty() ) {
- ep = s.extract_max();
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty());
- CPPUNIT_CHECK( ep->nKey == i );
- --i;
- //ep.release();
- }
- ep.release();
- CPPUNIT_ASSERT( s.empty() );
- CPPUNIT_ASSERT( check_size( s, 0 ));
-
- fill_set( s, arr );
- for ( size_t i = 0; i < c_nItemCount; ++i ) {
- int nKey = arr[i];
- {
- typename set_type::rcu_lock l;
- value_type * p = s.get( nKey );
- CPPUNIT_ASSERT( p != nullptr );
- CPPUNIT_CHECK( p->nKey == nKey );
- }
- ep = s.extract( nKey );
- CPPUNIT_ASSERT( !ep.empty());
- CPPUNIT_CHECK( ep->nKey == nKey);
- //ep.release();
-
- {
- typename set_type::rcu_lock l;
- CPPUNIT_CHECK( s.get( nKey ) == nullptr );
- }
- ep = s.extract( nKey );
- CPPUNIT_CHECK( !ep );
- }
- CPPUNIT_ASSERT( s.empty() );
- CPPUNIT_ASSERT( check_size( s, 0 ));
-
- fill_set( s, arr );
- for ( size_t i = 0; i < c_nItemCount; ++i ) {
- int nKey = arr[i];
- {
- typename set_type::rcu_lock l;
- value_type * p = s.get_with( wrapped_int(nKey), wrapped_less() );
- CPPUNIT_ASSERT( p != nullptr );
- CPPUNIT_CHECK( p->nKey == nKey );
- }
- ep = s.extract_with( wrapped_int( nKey ), wrapped_less() );
- CPPUNIT_ASSERT( ep );
- CPPUNIT_ASSERT( !ep.empty());
- CPPUNIT_CHECK( ep->nKey == nKey);
- //ep.release();
-
- {
- typename set_type::rcu_lock l;
- CPPUNIT_CHECK( s.get_with( wrapped_int( nKey ), wrapped_less() ) == nullptr );
- }
- ep = s.extract_with( wrapped_int( nKey ), wrapped_less() );
- CPPUNIT_CHECK( !ep );
- }
- CPPUNIT_ASSERT( s.empty() );
- CPPUNIT_ASSERT( check_size( s, 0 ));
-
- }
-
- PrintStat()( s );
- }
-
- void EllenBinTree_hp_less();
- void EllenBinTree_hp_cmp();
- void EllenBinTree_hp_cmpless();
- void EllenBinTree_hp_less_ic();
- void EllenBinTree_hp_cmp_ic();
- void EllenBinTree_hp_less_stat();
- void EllenBinTree_hp_cmp_ic_stat();
- void EllenBinTree_hp_cmp_ic_stat_yield();
- void EllenBinTree_hp_less_pool();
- void EllenBinTree_hp_less_pool_ic_stat();
-
- void EllenBinTree_dhp_less();
- void EllenBinTree_dhp_cmp();
- void EllenBinTree_dhp_cmpless();
- void EllenBinTree_dhp_less_ic();
- void EllenBinTree_dhp_cmp_ic();
- void EllenBinTree_dhp_less_stat();
- void EllenBinTree_dhp_cmp_ic_stat();
- void EllenBinTree_dhp_cmp_ic_stat_yield();
- void EllenBinTree_dhp_less_pool();
- void EllenBinTree_dhp_less_pool_ic_stat();
-
- void EllenBinTree_rcu_gpi_less();
- void EllenBinTree_rcu_gpi_cmp();
- void EllenBinTree_rcu_gpi_cmpless();
- void EllenBinTree_rcu_gpi_less_ic();
- void EllenBinTree_rcu_gpi_cmp_ic();
- void EllenBinTree_rcu_gpi_less_stat();
- void EllenBinTree_rcu_gpi_cmp_ic_stat();
- void EllenBinTree_rcu_gpi_cmp_ic_stat_yield();
- void EllenBinTree_rcu_gpi_less_pool();
- void EllenBinTree_rcu_gpi_less_pool_ic_stat();
-
- void EllenBinTree_rcu_gpb_less();
- void EllenBinTree_rcu_gpb_cmp();
- void EllenBinTree_rcu_gpb_cmpless();
- void EllenBinTree_rcu_gpb_less_ic();
- void EllenBinTree_rcu_gpb_cmp_ic();
- void EllenBinTree_rcu_gpb_less_stat();
- void EllenBinTree_rcu_gpb_cmp_ic_stat();
- void EllenBinTree_rcu_gpb_cmp_ic_stat_yield();
- void EllenBinTree_rcu_gpb_less_pool();
- void EllenBinTree_rcu_gpb_less_pool_ic_stat();
-
- void EllenBinTree_rcu_gpt_less();
- void EllenBinTree_rcu_gpt_cmp();
- void EllenBinTree_rcu_gpt_cmpless();
- void EllenBinTree_rcu_gpt_less_ic();
- void EllenBinTree_rcu_gpt_cmp_ic();
- void EllenBinTree_rcu_gpt_less_stat();
- void EllenBinTree_rcu_gpt_cmp_ic_stat();
- void EllenBinTree_rcu_gpt_cmp_ic_stat_yield();
- void EllenBinTree_rcu_gpt_less_pool();
- void EllenBinTree_rcu_gpt_less_pool_ic_stat();
-
- void EllenBinTree_rcu_shb_less();
- void EllenBinTree_rcu_shb_cmp();
- void EllenBinTree_rcu_shb_cmpless();
- void EllenBinTree_rcu_shb_less_ic();
- void EllenBinTree_rcu_shb_cmp_ic();
- void EllenBinTree_rcu_shb_less_stat();
- void EllenBinTree_rcu_shb_cmp_ic_stat();
- void EllenBinTree_rcu_shb_cmp_ic_stat_yield();
- void EllenBinTree_rcu_shb_less_pool();
- void EllenBinTree_rcu_shb_less_pool_ic_stat();
-
- void EllenBinTree_rcu_sht_less();
- void EllenBinTree_rcu_sht_cmp();
- void EllenBinTree_rcu_sht_cmpless();
- void EllenBinTree_rcu_sht_less_ic();
- void EllenBinTree_rcu_sht_cmp_ic();
- void EllenBinTree_rcu_sht_less_stat();
- void EllenBinTree_rcu_sht_cmp_ic_stat();
- void EllenBinTree_rcu_sht_cmp_ic_stat_yield();
- void EllenBinTree_rcu_sht_less_pool();
- void EllenBinTree_rcu_sht_less_pool_ic_stat();
-
- CPPUNIT_TEST_SUITE(EllenBinTreeSetHdrTest)
- CPPUNIT_TEST(EllenBinTree_hp_less)
- CPPUNIT_TEST(EllenBinTree_hp_cmp)
- CPPUNIT_TEST(EllenBinTree_hp_less_stat)
- CPPUNIT_TEST(EllenBinTree_hp_cmpless)
- CPPUNIT_TEST(EllenBinTree_hp_less_ic)
- CPPUNIT_TEST(EllenBinTree_hp_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_hp_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_hp_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_hp_less_pool )
- CPPUNIT_TEST(EllenBinTree_hp_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_dhp_less)
- CPPUNIT_TEST(EllenBinTree_dhp_cmp)
- CPPUNIT_TEST(EllenBinTree_dhp_less_stat)
- CPPUNIT_TEST(EllenBinTree_dhp_cmpless)
- CPPUNIT_TEST(EllenBinTree_dhp_less_ic)
- CPPUNIT_TEST(EllenBinTree_dhp_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_dhp_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_dhp_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_dhp_less_pool )
- CPPUNIT_TEST(EllenBinTree_dhp_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_less)
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_cmp)
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_less_stat)
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_cmpless)
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_less_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_rcu_gpi_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_rcu_gpi_less_pool )
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_less)
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_cmp)
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_less_stat)
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_cmpless)
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_less_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_rcu_gpb_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_rcu_gpb_less_pool )
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_less)
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_cmp)
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_less_stat)
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_cmpless)
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_less_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_rcu_gpt_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_rcu_gpt_less_pool )
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_rcu_shb_less)
- CPPUNIT_TEST(EllenBinTree_rcu_shb_cmp)
- CPPUNIT_TEST(EllenBinTree_rcu_shb_less_stat)
- CPPUNIT_TEST(EllenBinTree_rcu_shb_cmpless)
- CPPUNIT_TEST(EllenBinTree_rcu_shb_less_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_shb_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_shb_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_rcu_shb_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_rcu_shb_less_pool )
- CPPUNIT_TEST(EllenBinTree_rcu_shb_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_rcu_sht_less)
- CPPUNIT_TEST(EllenBinTree_rcu_sht_cmp)
- CPPUNIT_TEST(EllenBinTree_rcu_sht_less_stat)
- CPPUNIT_TEST(EllenBinTree_rcu_sht_cmpless)
- CPPUNIT_TEST(EllenBinTree_rcu_sht_less_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_sht_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_sht_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_rcu_sht_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_rcu_sht_less_pool )
- CPPUNIT_TEST(EllenBinTree_rcu_sht_less_pool_ic_stat)
-
- CPPUNIT_TEST_SUITE_END()
- };
-} // namespace tree
-
-#endif // #ifndef CDSTEST_HDR_ELLENBINTREE_SET_H
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_ellenbintree_set.h"
-#include <cds/container/ellen_bintree_set_dhp.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_dhp.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
- namespace cc = cds::container;
- namespace co = cds::opt;
- namespace {
- typedef cds::gc::DHP gc_type;
-
- typedef cc::ellen_bintree::node<gc_type, EllenBinTreeSetHdrTest::value_type> tree_leaf_node;
- typedef cc::ellen_bintree::internal_node< EllenBinTreeSetHdrTest::key_type, tree_leaf_node > tree_internal_node;
- typedef cc::ellen_bintree::update_desc<tree_leaf_node, tree_internal_node> tree_update_desc;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
-
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_dhp_less()
- {
- struct set_traits: public cc::ellen_bintree::traits{
- typedef EllenBinTreeSetHdrTest::key_extractor key_extractor;
- typedef EllenBinTreeSetHdrTest::less less;
- };
- typedef cc::EllenBinTreeSet< gc_type, key_type, value_type, set_traits > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_dhp_cmp()
- {
- typedef cc::EllenBinTreeSet< gc_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_dhp_cmpless()
- {
- typedef cc::EllenBinTreeSet< gc_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::compare< compare >
- ,co::less< less >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_dhp_less_ic()
- {
- typedef cc::EllenBinTreeSet< gc_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_dhp_cmp_ic()
- {
- typedef cc::EllenBinTreeSet< gc_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_dhp_less_stat()
- {
- typedef cc::EllenBinTreeSet< gc_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_dhp_cmp_ic_stat()
- {
- typedef cc::EllenBinTreeSet< gc_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_dhp_cmp_ic_stat_yield()
- {
- typedef cc::EllenBinTreeSet< gc_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- , co::back_off< cds::backoff::yield >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_dhp_less_pool()
- {
- typedef cc::EllenBinTreeSet< gc_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_dhp::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_dhp::update_desc_pool_accessor > >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_dhp_less_pool_ic_stat()
- {
- typedef cc::EllenBinTreeSet< gc_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_dhp::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_dhp::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
-} // namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_ellenbintree_set.h"
-#include <cds/container/ellen_bintree_set_hp.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_hp.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
- namespace cc = cds::container;
- namespace co = cds::opt;
- namespace {
- typedef cds::gc::HP gc_type;
-
- typedef cc::ellen_bintree::node<gc_type, EllenBinTreeSetHdrTest::value_type> tree_leaf_node;
- typedef cc::ellen_bintree::internal_node< EllenBinTreeSetHdrTest::key_type, tree_leaf_node > tree_internal_node;
- typedef cc::ellen_bintree::update_desc<tree_leaf_node, tree_internal_node> tree_update_desc;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_hp_less()
- {
- struct set_traits : public cc::ellen_bintree::traits{
- typedef EllenBinTreeSetHdrTest::key_extractor key_extractor;
- typedef EllenBinTreeSetHdrTest::less less;
- };
- typedef cc::EllenBinTreeSet< gc_type, key_type, value_type, set_traits > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_hp_cmp()
- {
- typedef cc::EllenBinTreeSet< gc_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_hp_cmpless()
- {
- typedef cc::EllenBinTreeSet< gc_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::compare< compare >
- ,co::less< less >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_hp_less_ic()
- {
- typedef cc::EllenBinTreeSet< gc_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_hp_cmp_ic()
- {
- typedef cc::EllenBinTreeSet< gc_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_hp_less_stat()
- {
- typedef cc::EllenBinTreeSet< gc_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_hp_cmp_ic_stat()
- {
- typedef cc::EllenBinTreeSet< gc_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_hp_cmp_ic_stat_yield()
- {
- typedef cc::EllenBinTreeSet< gc_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- , co::back_off< cds::backoff::yield >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_hp_less_pool()
- {
- typedef cc::EllenBinTreeSet< gc_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_hp::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_hp::update_desc_pool_accessor > >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_hp_less_pool_ic_stat()
- {
- typedef cc::EllenBinTreeSet< gc_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_hp::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_hp::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test<set_type, print_stat>();
- }
-
-} // namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_ellenbintree_set.h"
-#include <cds/urcu/general_buffered.h>
-#include <cds/container/ellen_bintree_set_rcu.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_rcu.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
- namespace cc = cds::container;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type;
-
- typedef cc::ellen_bintree::node<rcu_type, EllenBinTreeSetHdrTest::value_type> tree_leaf_node;
- typedef cc::ellen_bintree::internal_node< EllenBinTreeSetHdrTest::key_type, tree_leaf_node > tree_internal_node;
- typedef cc::ellen_bintree::update_desc<tree_leaf_node, tree_internal_node> tree_update_desc;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpb_less()
- {
- struct set_traits : public cc::ellen_bintree::traits{
- typedef EllenBinTreeSetHdrTest::key_extractor key_extractor;
- typedef EllenBinTreeSetHdrTest::less less;
- };
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type, set_traits > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpb_cmp()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpb_cmpless()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::compare< compare >
- ,co::less< less >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpb_less_ic()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpb_cmp_ic()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpb_less_stat()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpb_cmp_ic_stat()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpb_cmp_ic_stat_yield()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- , co::back_off< cds::backoff::yield >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpb_less_pool()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpb_less_pool_ic_stat()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
-} // namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_ellenbintree_set.h"
-#include <cds/urcu/general_instant.h>
-#include <cds/container/ellen_bintree_set_rcu.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_rcu.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
- namespace cc = cds::container;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type;
-
- typedef cc::ellen_bintree::node<rcu_type, EllenBinTreeSetHdrTest::value_type> tree_leaf_node;
- typedef cc::ellen_bintree::internal_node< EllenBinTreeSetHdrTest::key_type, tree_leaf_node > tree_internal_node;
- typedef cc::ellen_bintree::update_desc<tree_leaf_node, tree_internal_node> tree_update_desc;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
-
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpi_less()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpi_cmp()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpi_cmpless()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::compare< compare >
- ,co::less< less >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpi_less_ic()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpi_cmp_ic()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpi_less_stat()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpi_cmp_ic_stat()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpi_cmp_ic_stat_yield()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- , co::back_off< cds::backoff::yield >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpi_less_pool()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpi_less_pool_ic_stat()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
-} // namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_ellenbintree_set.h"
-#include <cds/urcu/general_threaded.h>
-#include <cds/container/ellen_bintree_set_rcu.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_rcu.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
- namespace cc = cds::container;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type;
-
- typedef cc::ellen_bintree::node<rcu_type, EllenBinTreeSetHdrTest::value_type> tree_leaf_node;
- typedef cc::ellen_bintree::internal_node< EllenBinTreeSetHdrTest::key_type, tree_leaf_node > tree_internal_node;
- typedef cc::ellen_bintree::update_desc<tree_leaf_node, tree_internal_node> tree_update_desc;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
-
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpt_less()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpt_cmp()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpt_cmpless()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::compare< compare >
- ,co::less< less >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpt_less_ic()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpt_cmp_ic()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpt_less_stat()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpt_cmp_ic_stat()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpt_cmp_ic_stat_yield()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- , co::back_off< cds::backoff::yield >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpt_less_pool()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_gpt_less_pool_ic_stat()
- {
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
- }
-
-} // namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_ellenbintree_set.h"
-#include <cds/urcu/signal_buffered.h>
-#include <cds/container/ellen_bintree_set_rcu.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_rcu.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace cc = cds::container;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
-
- typedef cc::ellen_bintree::node<rcu_type, EllenBinTreeSetHdrTest::value_type> tree_leaf_node;
- typedef cc::ellen_bintree::internal_node< EllenBinTreeSetHdrTest::key_type, tree_leaf_node > tree_internal_node;
- typedef cc::ellen_bintree::update_desc<tree_leaf_node, tree_internal_node> tree_update_desc;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
- }
-#endif
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_shb_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_shb_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_shb_cmpless()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::compare< compare >
- ,co::less< less >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_shb_less_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_shb_cmp_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_shb_less_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_shb_cmp_ic_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_shb_cmp_ic_stat_yield()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- , co::back_off< cds::backoff::yield >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_shb_less_pool()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_shb_less_pool_ic_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
-} // namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_ellenbintree_set.h"
-#include <cds/urcu/signal_threaded.h>
-#include <cds/container/ellen_bintree_set_rcu.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_rcu.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace cc = cds::container;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type;
-
- typedef cc::ellen_bintree::node<rcu_type, EllenBinTreeSetHdrTest::value_type> tree_leaf_node;
- typedef cc::ellen_bintree::internal_node< EllenBinTreeSetHdrTest::key_type, tree_leaf_node > tree_internal_node;
- typedef cc::ellen_bintree::update_desc<tree_leaf_node, tree_internal_node> tree_update_desc;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
- }
-#endif
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_sht_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_sht_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_sht_cmpless()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::compare< compare >
- ,co::less< less >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_sht_less_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_sht_cmp_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_sht_less_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_sht_cmp_ic_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_sht_cmp_ic_stat_yield()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- , co::back_off< cds::backoff::yield >
- ,co::compare< compare >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_sht_less_pool()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
- void EllenBinTreeSetHdrTest::EllenBinTree_rcu_sht_less_pool_ic_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef cc::EllenBinTreeSet< rcu_type, key_type, value_type,
- cc::ellen_bintree::make_set_traits<
- cc::ellen_bintree::key_extractor< key_extractor >
- ,co::less< less >
- ,co::node_allocator< cds::memory::pool_allocator< tree_internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< tree_update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< cc::ellen_bintree::stat<> >
- >::type
- > set_type;
-
- test_rcu<set_type, print_stat>();
-#endif
- }
-
-} // namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef CDSTEST_HDR_INTRUSIVE_BINTREE_H
-#define CDSTEST_HDR_INTRUSIVE_BINTREE_H
-
-#include "cppunit/cppunit_proxy.h"
-#include "size_check.h"
-#include <algorithm>
-
-namespace tree {
-
- class IntrusiveBinTreeHdrTest: public CppUnitMini::TestCase
- {
- public:
- typedef int key_type;
-
- struct stat_data {
- size_t nDisposeCount;
- size_t nWaitingDispCount;
- size_t nInsertFuncCall;
- size_t nEnsureExistFuncCall;
- size_t nEnsureNewFuncCall;
- size_t nEraseFuncCall;
- size_t nFindFuncCall;
- size_t nFindConstFuncCall;
-
- stat_data()
- : nDisposeCount(0)
- , nWaitingDispCount(0)
- , nInsertFuncCall(0)
- , nEnsureExistFuncCall(0)
- , nEnsureNewFuncCall(0)
- , nEraseFuncCall(0)
- , nFindFuncCall(0)
- , nFindConstFuncCall(0)
- {}
- };
-
- template <typename Hook>
- struct base_hook_value: public Hook
- {
- int nKey;
- int nValue;
- mutable stat_data stat;
-
- base_hook_value()
- {}
-
- base_hook_value( int key )
- : nKey(key)
- , nValue(key * 2)
- {}
-
- base_hook_value( int key, int val )
- : nKey(key)
- , nValue(val)
- {}
-
- base_hook_value( base_hook_value&& s )
- : Hook()
- , nKey(s.nKey)
- , nValue(s.nValue)
- {}
- base_hook_value& operator=( base_hook_value const& s )
- {
- nKey = s.nKey;
- nValue = s.nValue;
- return *this;
- }
- };
-
- template <typename Hook>
- struct member_hook_value
- {
- int nKey;
- int nValue;
- Hook hook;
- mutable stat_data stat;
-
- member_hook_value()
- {}
-
- member_hook_value( int key )
- : nKey(key)
- , nValue(key * 2)
- {}
-
- member_hook_value( int key, int val )
- : nKey(key)
- , nValue(val)
- {}
-
- member_hook_value( member_hook_value&& s )
- : nKey(s.nKey)
- , nValue(s.nValue)
- , hook()
- {}
- member_hook_value& operator=( member_hook_value const& s )
- {
- nKey = s.nKey;
- nValue = s.nValue;
- return *this;
- }
- };
-
- template <typename ValueType>
- struct less {
- typedef ValueType value_type;
-
- bool operator()( int k1, int k2 ) const
- {
- return k1 < k2;
- }
- bool operator()( value_type const& v1, value_type const& v2 ) const
- {
- return v1.nKey < v2.nKey;
- }
- bool operator()( value_type const& v, int k ) const
- {
- return v.nKey < k;
- }
- bool operator()( int k, value_type const& v ) const
- {
- return k < v.nKey;
- }
- };
-
- template <typename ValueType>
- struct compare {
- typedef ValueType value_type;
-
- int cmp( int k1, int k2 ) const
- {
- return k1 < k2 ? -1 : (k1 > k2 ? 1 : 0);
- }
- int operator()( int k1, int k2 ) const
- {
- return cmp( k1, k2 );
- }
- int operator()( value_type const& v1, value_type const& v2 ) const
- {
- return cmp( v1.nKey, v2.nKey );
- }
- int operator()( value_type const& v, int k ) const
- {
- return cmp( v.nKey, k );
- }
- int operator()( int k, value_type const& v ) const
- {
- return cmp( k, v.nKey );
- }
- };
-
- struct wrapped_int {
- int nKey;
-
- wrapped_int( int n )
- : nKey(n)
- {}
- };
-
- template <typename T>
- struct wrapped_less
- {
- bool operator()( wrapped_int const& w, int n ) const
- {
- return w.nKey < n;
- }
- bool operator()( int n, wrapped_int const& w ) const
- {
- return n < w.nKey;
- }
- bool operator()( wrapped_int const& w, T const& v ) const
- {
- return w.nKey < v.nKey;
- }
- bool operator()( T const& v, wrapped_int const& w ) const
- {
- return v.nKey < w.nKey;
- }
- };
-
- template <typename ValueType>
- struct key_extractor {
- void operator()( int& dest, ValueType const& src ) const
- {
- dest = src.nKey;
- }
- };
-
- template <typename ValueType>
- struct disposer {
- void operator()( ValueType * v ) const
- {
- ++v->stat.nDisposeCount;
- }
- };
-
- struct insert_functor {
- template <typename T>
- void operator()( T& v ) const
- {
- ++v.stat.nInsertFuncCall;
- }
- };
-
- struct update_functor {
- template <typename T>
- void operator()( bool bNew, T& dest, T& src) const
- {
- if ( bNew )
- ++dest.stat.nEnsureNewFuncCall;
- else {
- dest.nValue *= 2;
- ++src.stat.nEnsureExistFuncCall;
- }
- }
- };
-
- struct erase_functor {
- template <typename T>
- void operator()( T const& v ) const
- {
- ++v.stat.nEraseFuncCall;
- }
- };
-
- struct find_functor {
- template <typename T, typename Q>
- void operator()( T const& v, Q& /*q*/ ) const
- {
- ++v.stat.nFindFuncCall;
- }
- template <typename T, typename Q>
- void operator()( T const& v, Q const& /*q*/ ) const
- {
- ++v.stat.nFindConstFuncCall;
- }
- };
-
- protected:
- static const size_t c_nItemCount = 10000;
-
- template <typename T>
- class data_array
- {
- T * pFirst;
- T * pLast;
-
- public:
- data_array()
- : pFirst( new T[c_nItemCount] )
- , pLast( pFirst + c_nItemCount )
- {
- int i = 0;
- for ( T * p = pFirst; p != pLast; ++p, ++i ) {
- p->nKey = i;
- p->nValue = i * 2;
- }
-
- shuffle( pFirst, pLast );
- }
-
- ~data_array()
- {
- delete [] pFirst;
- }
-
- T * begin() { return pFirst; }
- T * end() { return pLast ; }
- };
-
- protected:
- template <typename Tree>
- void test_common( Tree& t )
- {
- typedef Tree tree_type;
- typedef typename tree_type::key_type key_type;
- typedef typename tree_type::value_type value_type;
-
- {
- value_type v1( 10, 100 );
- value_type v2( 20, 200 );
- value_type v3( 30, 300 );
- value_type v4( 25, 250 );
- value_type v5( -50, -500 );
-
- // insert/update
- CPPUNIT_ASSERT( t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 0 ));
- CPPUNIT_CHECK( !t.contains( v1.nKey ));
- CPPUNIT_CHECK( !t.contains( v1 ));
- CPPUNIT_CHECK( !t.contains( v2.nKey ));
- CPPUNIT_CHECK( !t.contains( v2 ));
- CPPUNIT_CHECK( !t.contains( v3.nKey ));
- CPPUNIT_CHECK( !t.contains( v3 ));
- CPPUNIT_CHECK( !t.contains( v4.nKey ));
- CPPUNIT_CHECK( !t.contains( v4 ));
- CPPUNIT_CHECK( !t.contains( v5.nKey ));
- CPPUNIT_CHECK( !t.contains( v5 ));
-
- CPPUNIT_ASSERT( t.insert( v1 ));
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( !t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 1 ));
- CPPUNIT_CHECK( t.contains( v1.nKey ));
- CPPUNIT_CHECK( t.contains( v1 ));
- CPPUNIT_CHECK( !t.contains( v2.nKey ));
- CPPUNIT_CHECK( !t.contains( v2 ));
- CPPUNIT_CHECK( !t.contains( v3.nKey ));
- CPPUNIT_CHECK( !t.contains( v3 ));
- CPPUNIT_CHECK( !t.contains( v4.nKey ));
- CPPUNIT_CHECK( !t.contains( v4 ));
- CPPUNIT_CHECK( !t.contains( v5.nKey ));
- CPPUNIT_CHECK( !t.contains( v5 ));
-
- CPPUNIT_ASSERT( v2.stat.nInsertFuncCall == 0 );
- CPPUNIT_ASSERT( t.insert( v2, insert_functor() ));
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( v2.stat.nInsertFuncCall == 1 );
- CPPUNIT_ASSERT( t.contains( v1.nKey ));
- CPPUNIT_ASSERT( t.contains( v1 ));
- CPPUNIT_ASSERT( t.contains( v2.nKey ));
- CPPUNIT_ASSERT( t.contains( v2 ));
- CPPUNIT_ASSERT( !t.contains( v3.nKey ));
- CPPUNIT_ASSERT( !t.contains( v3 ));
- CPPUNIT_ASSERT( !t.contains( v4.nKey ));
- CPPUNIT_ASSERT( !t.contains( v4 ));
- CPPUNIT_ASSERT( !t.contains( v5.nKey ));
- CPPUNIT_ASSERT( !t.contains( v5 ));
- CPPUNIT_ASSERT( !t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 2 ));
-
- std::pair<bool, bool> updateResult;
- CPPUNIT_ASSERT( v3.stat.nEnsureNewFuncCall == 0 );
- CPPUNIT_ASSERT( v3.stat.nEnsureExistFuncCall == 0 );
- updateResult = t.update( v3, update_functor(), false );
- CPPUNIT_ASSERT( !updateResult.first && !updateResult.second );
- CPPUNIT_ASSERT( v3.stat.nEnsureNewFuncCall == 0 );
- CPPUNIT_ASSERT( v3.stat.nEnsureExistFuncCall == 0 );
- updateResult = t.update( v3, update_functor(), true );
- CPPUNIT_ASSERT( updateResult.first && updateResult.second );
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( v3.stat.nEnsureNewFuncCall == 1 );
- CPPUNIT_ASSERT( v3.stat.nEnsureExistFuncCall == 0 );
- CPPUNIT_ASSERT( v3.nValue == 300 );
- updateResult = t.update( v3, update_functor(), false );
- CPPUNIT_ASSERT( updateResult.first && !updateResult.second );
- CPPUNIT_ASSERT( v3.stat.nEnsureNewFuncCall == 1 );
- CPPUNIT_ASSERT( v3.stat.nEnsureExistFuncCall == 1 );
- CPPUNIT_ASSERT( v3.nValue == 600 );
- CPPUNIT_ASSERT( t.contains( v1.nKey ));
- CPPUNIT_ASSERT( t.contains( v1 ));
- CPPUNIT_ASSERT( t.contains( v2.nKey ));
- CPPUNIT_ASSERT( t.contains( v2 ));
- CPPUNIT_ASSERT( t.contains( v3.nKey ));
- CPPUNIT_ASSERT( t.contains( v3 ));
- CPPUNIT_ASSERT( !t.contains( v4.nKey ));
- CPPUNIT_ASSERT( !t.contains( v4 ));
- CPPUNIT_ASSERT( !t.contains( v5.nKey ));
- CPPUNIT_ASSERT( !t.contains( v5 ));
- CPPUNIT_ASSERT( !t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 3 ));
-
- {
- value_type v( v3.nKey, v3.nValue );
- CPPUNIT_ASSERT( v.stat.nEnsureExistFuncCall == 0 );
- CPPUNIT_ASSERT( v3.stat.nEnsureNewFuncCall == 1 );
- CPPUNIT_ASSERT( v3.stat.nEnsureExistFuncCall == 1 );
- CPPUNIT_ASSERT( v3.nValue == 600 );
- CPPUNIT_ASSERT( !t.update( v, update_functor() ).second );
- CPPUNIT_ASSERT( v3.stat.nEnsureNewFuncCall == 1 );
- CPPUNIT_ASSERT( v.stat.nEnsureExistFuncCall == 1 );
- CPPUNIT_ASSERT( v3.nValue == 1200 );
-
- }
- v3.nValue = 300;
- CPPUNIT_ASSERT( !t.insert( v3 ));
-
- CPPUNIT_ASSERT( t.insert( v4 ));
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( t.contains( v1.nKey ));
- CPPUNIT_ASSERT( t.contains( v1 ));
- CPPUNIT_ASSERT( t.contains( v2.nKey ));
- CPPUNIT_ASSERT( t.contains( v2 ));
- CPPUNIT_ASSERT( t.contains( v3.nKey ));
- CPPUNIT_ASSERT( t.contains( v3 ));
- CPPUNIT_ASSERT( t.contains( v4.nKey ));
- CPPUNIT_ASSERT( t.contains( v4 ));
- CPPUNIT_ASSERT( !t.contains( v5.nKey ));
- CPPUNIT_ASSERT( !t.contains( v5 ));
- CPPUNIT_ASSERT( !t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 4 ));
-
- CPPUNIT_ASSERT( t.insert( v5 ));
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( t.contains( v1.nKey ));
- CPPUNIT_ASSERT( t.contains( v1 ));
- CPPUNIT_ASSERT( t.contains( v2.nKey ));
- CPPUNIT_ASSERT( t.contains( v2 ));
- CPPUNIT_ASSERT( t.contains( v3.nKey ));
- CPPUNIT_ASSERT( t.contains( v3 ));
- CPPUNIT_ASSERT( t.contains( v4.nKey ));
- CPPUNIT_ASSERT( t.contains( v4 ));
- CPPUNIT_ASSERT( t.contains( v5.nKey ));
- CPPUNIT_ASSERT( t.contains( v5 ));
- CPPUNIT_ASSERT( !t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 5 ));
-
- //unlink/erase
- ++v1.stat.nWaitingDispCount;
- CPPUNIT_ASSERT( t.unlink(v1));
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( !t.contains( v1.nKey ));
- CPPUNIT_ASSERT( !t.contains( v1 ));
- CPPUNIT_ASSERT( !t.unlink(v1));
- CPPUNIT_ASSERT( t.contains( v2.nKey ));
- CPPUNIT_ASSERT( t.contains( v2 ));
- CPPUNIT_ASSERT( t.contains( v3.nKey ));
- CPPUNIT_ASSERT( t.contains( v3 ));
- CPPUNIT_ASSERT( t.contains( v4.nKey ));
- CPPUNIT_ASSERT( t.contains( v4 ));
- CPPUNIT_ASSERT( t.contains( v5.nKey ));
- CPPUNIT_ASSERT( t.contains( v5 ));
- CPPUNIT_ASSERT( !t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 4 ));
-
- ++v2.stat.nWaitingDispCount;
- CPPUNIT_ASSERT( t.erase( v2.nKey ));
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( !t.contains( v1.nKey ));
- CPPUNIT_ASSERT( !t.contains( v1 ));
- CPPUNIT_ASSERT( !t.contains( v2.nKey ));
- CPPUNIT_ASSERT( !t.contains( v2 ));
- CPPUNIT_ASSERT( !t.erase(v2));
- CPPUNIT_ASSERT( t.contains( v3.nKey ));
- CPPUNIT_ASSERT( t.contains( v3 ));
- CPPUNIT_ASSERT( t.contains( v4.nKey ));
- CPPUNIT_ASSERT( t.contains( v4 ));
- CPPUNIT_ASSERT( t.contains( v5.nKey ));
- CPPUNIT_ASSERT( t.contains( v5 ));
- CPPUNIT_ASSERT( !t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 3 ));
-
- ++v3.stat.nWaitingDispCount;
- CPPUNIT_ASSERT( t.erase_with( v3.nKey, less<value_type>() ));
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( !t.contains( v1.nKey ));
- CPPUNIT_ASSERT( !t.contains( v1 ));
- CPPUNIT_ASSERT( !t.contains( v2.nKey ));
- CPPUNIT_ASSERT( !t.contains( v2 ));
- CPPUNIT_ASSERT( !t.contains( v3.nKey ));
- CPPUNIT_ASSERT( !t.contains( v3 ));
- CPPUNIT_ASSERT( !t.erase_with(v3, less<value_type>() ));
- CPPUNIT_ASSERT( t.contains( v4.nKey ));
- CPPUNIT_ASSERT( t.contains( v4 ));
- CPPUNIT_ASSERT( t.contains( v5.nKey ));
- CPPUNIT_ASSERT( t.contains( v5 ));
- CPPUNIT_ASSERT( !t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 2 ));
-
- ++v4.stat.nWaitingDispCount;
- CPPUNIT_ASSERT( v4.stat.nEraseFuncCall == 0 );
- CPPUNIT_ASSERT( t.erase( v4.nKey, erase_functor() ));
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( v4.stat.nEraseFuncCall == 1 );
- CPPUNIT_ASSERT( !t.contains( v1.nKey ));
- CPPUNIT_ASSERT( !t.contains( v1 ));
- CPPUNIT_ASSERT( !t.contains( v2.nKey ));
- CPPUNIT_ASSERT( !t.contains( v2 ));
- CPPUNIT_ASSERT( !t.contains( v3.nKey ));
- CPPUNIT_ASSERT( !t.contains( v3 ));
- CPPUNIT_ASSERT( !t.contains( v4.nKey ));
- CPPUNIT_ASSERT( !t.contains( v4 ));
- CPPUNIT_ASSERT( !t.erase( v4.nKey, erase_functor() ));
- CPPUNIT_ASSERT( v4.stat.nEraseFuncCall == 1 );
- CPPUNIT_ASSERT( t.contains( v5.nKey ));
- CPPUNIT_ASSERT( t.contains( v5 ));
- CPPUNIT_ASSERT( !t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 1 ));
-
- ++v5.stat.nWaitingDispCount;
- CPPUNIT_ASSERT( t.erase_with( v5.nKey, less<value_type>(), erase_functor() ));
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( v5.stat.nEraseFuncCall == 1 );
- CPPUNIT_ASSERT( !t.contains( v1.nKey ));
- CPPUNIT_ASSERT( !t.contains( v1 ));
- CPPUNIT_ASSERT( !t.contains( v2.nKey ));
- CPPUNIT_ASSERT( !t.contains( v2 ));
- CPPUNIT_ASSERT( !t.contains( v3.nKey ));
- CPPUNIT_ASSERT( !t.contains( v3 ));
- CPPUNIT_ASSERT( !t.erase_with(v5, less<value_type>(), erase_functor() ));
- CPPUNIT_ASSERT( !t.contains( v4.nKey ));
- CPPUNIT_ASSERT( !t.contains( v4 ));
- CPPUNIT_ASSERT( !t.contains( v5.nKey ));
- CPPUNIT_ASSERT( !t.contains( v5 ));
- CPPUNIT_ASSERT( t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 0 ));
-
- tree_type::gc::force_dispose();
-
- // contains
- CPPUNIT_ASSERT( t.insert( v1 ));
- CPPUNIT_ASSERT( t.insert( v2 ));
- CPPUNIT_ASSERT( t.insert( v3 ));
- CPPUNIT_ASSERT( t.insert( v4 ));
- CPPUNIT_ASSERT( t.insert( v5 ));
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( !t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 5 ));
-
- CPPUNIT_ASSERT( t.contains( 10 ));
- CPPUNIT_ASSERT( !t.contains( 11 ));
- CPPUNIT_ASSERT( t.contains( v1 ));
- CPPUNIT_ASSERT( t.contains( v2.nKey ));
- CPPUNIT_ASSERT( t.contains( v3 ));
- CPPUNIT_ASSERT( t.contains( v4.nKey ));
- CPPUNIT_ASSERT( t.contains( v5.nKey ));
-
- // contains
- CPPUNIT_ASSERT( t.contains( 10, less<value_type>() ));
- CPPUNIT_ASSERT( !t.contains( wrapped_int(11), wrapped_less<value_type>() ));
- CPPUNIT_ASSERT( t.contains( v1, less<value_type>() ));
- CPPUNIT_ASSERT( t.contains( wrapped_int(v2.nKey), wrapped_less<value_type>() ));
- CPPUNIT_ASSERT( t.contains( v3, less<value_type>() ));
- CPPUNIT_ASSERT( t.contains( v4.nKey, less<value_type>() ));
- CPPUNIT_ASSERT( t.contains( v5.nKey, less<value_type>() ));
-
- // find<Func>
- CPPUNIT_ASSERT( v1.stat.nFindFuncCall == 0 );
- CPPUNIT_ASSERT( v1.stat.nFindConstFuncCall == 0 );
- CPPUNIT_ASSERT( t.find( 10, find_functor() ));
- CPPUNIT_ASSERT( v1.stat.nFindFuncCall == 0 );
- CPPUNIT_ASSERT( v1.stat.nFindConstFuncCall == 1 );
-
- CPPUNIT_ASSERT( !t.find( 11, find_functor() ));
-
- CPPUNIT_ASSERT( t.find( v1, find_functor() ));
- CPPUNIT_ASSERT( v1.stat.nFindFuncCall == 1 );
- CPPUNIT_ASSERT( v1.stat.nFindConstFuncCall == 1 );
-
- CPPUNIT_ASSERT( v2.stat.nFindFuncCall == 0 );
- CPPUNIT_ASSERT( v2.stat.nFindConstFuncCall == 0 );
- CPPUNIT_ASSERT( t.find( v2.nKey, find_functor() ));
- CPPUNIT_ASSERT( v2.stat.nFindFuncCall == 1 );
- CPPUNIT_ASSERT( v2.stat.nFindConstFuncCall == 0 );
-
- CPPUNIT_ASSERT( v3.stat.nFindFuncCall == 0 );
- CPPUNIT_ASSERT( v3.stat.nFindConstFuncCall == 0 );
- CPPUNIT_ASSERT( t.find( v3, find_functor() ));
- CPPUNIT_ASSERT( v3.stat.nFindFuncCall == 1 );
- CPPUNIT_ASSERT( v3.stat.nFindConstFuncCall == 0 );
-
- CPPUNIT_ASSERT( v4.stat.nFindFuncCall == 0 );
- CPPUNIT_ASSERT( v4.stat.nFindConstFuncCall == 0 );
- CPPUNIT_ASSERT( t.find( (value_type const&) v4, find_functor() ));
- CPPUNIT_ASSERT( v4.stat.nFindFuncCall == 0 );
- CPPUNIT_ASSERT( v4.stat.nFindConstFuncCall == 1 );
-
- CPPUNIT_ASSERT( v5.stat.nFindFuncCall == 0 );
- CPPUNIT_ASSERT( v5.stat.nFindConstFuncCall == 0 );
- CPPUNIT_ASSERT( t.find( v5.nKey, find_functor() ));
- CPPUNIT_ASSERT( v5.stat.nFindFuncCall == 1 );
- CPPUNIT_ASSERT( v5.stat.nFindConstFuncCall == 0 );
-
- // find_with<Func>
- CPPUNIT_ASSERT( v1.stat.nFindFuncCall == 1 );
- CPPUNIT_ASSERT( v1.stat.nFindConstFuncCall == 1 );
- CPPUNIT_ASSERT( t.find_with( 10, less<value_type>(), find_functor() ));
- CPPUNIT_ASSERT( v1.stat.nFindFuncCall == 1 );
- CPPUNIT_ASSERT( v1.stat.nFindConstFuncCall == 2 );
-
- CPPUNIT_ASSERT( !t.find_with( 11, less<value_type>(), find_functor() ));
-
- CPPUNIT_ASSERT( t.find_with( v1, less<value_type>(), find_functor() ));
- CPPUNIT_ASSERT( v1.stat.nFindFuncCall == 2 );
- CPPUNIT_ASSERT( v1.stat.nFindConstFuncCall == 2 );
-
- CPPUNIT_ASSERT( v2.stat.nFindFuncCall == 1 );
- CPPUNIT_ASSERT( v2.stat.nFindConstFuncCall == 0 );
- CPPUNIT_ASSERT( t.find_with( v2.nKey, less<value_type>(), find_functor() ));
- CPPUNIT_ASSERT( v2.stat.nFindFuncCall == 2 );
- CPPUNIT_ASSERT( v2.stat.nFindConstFuncCall == 0 );
-
- CPPUNIT_ASSERT( v3.stat.nFindFuncCall == 1 );
- CPPUNIT_ASSERT( v3.stat.nFindConstFuncCall == 0 );
- CPPUNIT_ASSERT( t.find_with( wrapped_int(v3.nKey), wrapped_less<value_type>(), find_functor() ));
- CPPUNIT_ASSERT( v3.stat.nFindFuncCall == 1 );
- CPPUNIT_ASSERT( v3.stat.nFindConstFuncCall == 1 );
-
- CPPUNIT_ASSERT( v4.stat.nFindFuncCall == 0 );
- CPPUNIT_ASSERT( v4.stat.nFindConstFuncCall == 1 );
- CPPUNIT_ASSERT( t.find_with( (value_type const&) v4, less<value_type>(), find_functor() ));
- CPPUNIT_ASSERT( v4.stat.nFindFuncCall == 0 );
- CPPUNIT_ASSERT( v4.stat.nFindConstFuncCall == 2 );
-
- CPPUNIT_ASSERT( v5.stat.nFindFuncCall == 1 );
- CPPUNIT_ASSERT( v5.stat.nFindConstFuncCall == 0 );
- CPPUNIT_ASSERT( t.find_with( v5.nKey, less<value_type>(), find_functor() ));
- CPPUNIT_ASSERT( v5.stat.nFindFuncCall == 2 );
- CPPUNIT_ASSERT( v5.stat.nFindConstFuncCall == 0 );
-
- CPPUNIT_ASSERT( t.check_consistency() );
- t.clear();
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 0 ));
-
- tree_type::gc::force_dispose();
- CPPUNIT_CHECK_EX( v1.stat.nWaitingDispCount + 1 == v1.stat.nDisposeCount,
- "v1.stat.nWaitingDispCount=" << v1.stat.nWaitingDispCount << ", v1.stat.nDisposeCount=" << v1.stat.nDisposeCount );
- CPPUNIT_CHECK_EX( v2.stat.nWaitingDispCount + 1 == v2.stat.nDisposeCount,
- "v2.stat.nWaitingDispCount=" << v2.stat.nWaitingDispCount << ", v2.stat.nDisposeCount=" << v2.stat.nDisposeCount );
- CPPUNIT_CHECK_EX( v3.stat.nWaitingDispCount + 1 == v3.stat.nDisposeCount,
- "v3.stat.nWaitingDispCount=" << v3.stat.nWaitingDispCount << ", v3.stat.nDisposeCount=" << v3.stat.nDisposeCount );
- CPPUNIT_CHECK_EX( v4.stat.nWaitingDispCount + 1 == v4.stat.nDisposeCount,
- "v4.stat.nWaitingDispCount=" << v4.stat.nWaitingDispCount << ", v4.stat.nDisposeCount=" << v4.stat.nDisposeCount );
- CPPUNIT_CHECK_EX( v5.stat.nWaitingDispCount + 1 == v5.stat.nDisposeCount,
- "v5.stat.nWaitingDispCount=" << v5.stat.nWaitingDispCount << ", v5.stat.nDisposeCount=" << v5.stat.nDisposeCount );
- }
-
- {
- data_array< value_type> arr;
- value_type * pFirst = arr.begin();
- value_type * pLast = arr.end();
-
- for ( value_type * p = pFirst; p != pLast; ++p ) {
- CPPUNIT_ASSERT( t.insert( *p ) );
- CPPUNIT_ASSERT( !t.insert( *p ));
- }
- CPPUNIT_ASSERT( !t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, c_nItemCount ));
- CPPUNIT_ASSERT( t.check_consistency() );
-
- for ( int n = 0; n < (int) c_nItemCount; ++n ) {
- CPPUNIT_ASSERT_MSG( t.contains( n ), n );
- }
- for ( value_type * p = pFirst; p != pLast; ++p ) {
- CPPUNIT_ASSERT( t.contains( *p ));
- CPPUNIT_ASSERT( t.contains( p->nKey ));
- CPPUNIT_ASSERT( t.unlink( *p ) );
- CPPUNIT_ASSERT( !t.unlink( *p ) );
- CPPUNIT_ASSERT( !t.contains( p->nKey ));
- }
-
- tree_type::gc::force_dispose();
- }
- }
-
- template <class Tree, class PrintStat>
- void test()
- {
- typedef Tree tree_type;
- typedef typename tree_type::key_type key_type;
- typedef typename tree_type::value_type value_type;
-
- tree_type t;
- test_common(t);
-
- {
- value_type v1( 10, 100 );
- value_type v2( 20, 200 );
- value_type v3( 30, 300 );
- value_type v4( 25, 250 );
- value_type v5( -50, -500 );
-
- // extract/extract_min/extract_max
- CPPUNIT_ASSERT( t.insert( v1 ));
- CPPUNIT_ASSERT( t.insert( v2 ));
- CPPUNIT_ASSERT( t.insert( v3 ));
- CPPUNIT_ASSERT( t.insert( v4 ));
- CPPUNIT_ASSERT( t.insert( v5 ));
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( !t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 5 ));
-
- {
- typename tree_type::guarded_ptr gp;
-
- gp = t.get( v2.nKey );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->nKey == v2.nKey );
- gp = t.extract( v2.nKey );
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( !t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 4 ));
- CPPUNIT_ASSERT( gp->nKey == v2.nKey );
- gp = t.extract( v2.nKey );
- CPPUNIT_ASSERT( !gp );
- gp = t.get( v2.nKey );
- CPPUNIT_CHECK( !gp );
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( !t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 4 ));
-
- gp = t.extract_min();
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( !t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 3 ));
- CPPUNIT_ASSERT( gp->nKey == v5.nKey );
-
- gp = t.extract_min();
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( !t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 2 ));
- CPPUNIT_ASSERT( gp->nKey == v1.nKey );
-
- gp = t.extract_min();
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( !t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 1 ));
- CPPUNIT_ASSERT( gp->nKey == v4.nKey );
-
- gp = t.extract_min();
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 0 ));
- CPPUNIT_ASSERT( gp->nKey == v3.nKey );
-
- gp = t.extract_min();
- CPPUNIT_ASSERT( !gp );
- CPPUNIT_ASSERT( !t.extract_max());
- CPPUNIT_ASSERT( !t.extract( v1.nKey ));
- }
-
- tree_type::gc::force_dispose();
-
- {
- typename tree_type::guarded_ptr gp;
-
- CPPUNIT_ASSERT( t.insert( v1 ));
- CPPUNIT_ASSERT( t.insert( v2 ));
- CPPUNIT_ASSERT( t.insert( v3 ));
- CPPUNIT_ASSERT( t.insert( v4 ));
- CPPUNIT_ASSERT( t.insert( v5 ));
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( !t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 5 ));
-
- gp = t.get_with( wrapped_int( v4.nKey ), wrapped_less<value_type>());
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->nKey == v4.nKey );
- gp = t.extract_with( wrapped_int( v4.nKey ), wrapped_less<value_type>());
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( !t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 4 ));
- CPPUNIT_ASSERT( gp->nKey == v4.nKey );
-
- gp = t.extract_with( v4.nKey, less<value_type>());
- CPPUNIT_ASSERT( !gp );
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( !t.get_with( v4.nKey, less<value_type>() ) );
-
- gp = t.extract_max();
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( !t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 3 ));
- CPPUNIT_ASSERT( gp->nKey == v3.nKey );
-
- gp = t.extract_max();
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( !t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 2 ));
- CPPUNIT_ASSERT( gp->nKey == v2.nKey );
-
- gp = t.extract_max();
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( !t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 1 ));
- CPPUNIT_ASSERT( gp->nKey == v1.nKey );
-
- gp = t.extract_max();
- CPPUNIT_ASSERT( gp );
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 0 ));
- CPPUNIT_ASSERT( gp->nKey == v5.nKey );
- }
-
- tree_type::gc::force_dispose();
- }
-
- {
- data_array< value_type> arr;
- value_type * pFirst = arr.begin();
- value_type * pLast = arr.end();
-
- for ( value_type * p = pFirst; p != pLast; ++p ) {
- CPPUNIT_ASSERT( t.update( *p, update_functor()).second );
- }
- for ( int n = 0; n < (int) c_nItemCount; ++n ) {
- typename tree_type::guarded_ptr gp( t.extract_min() );
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->nKey == n );
- }
-
- for ( value_type * p = pFirst; p != pLast; ++p ) {
- CPPUNIT_ASSERT( t.insert( *p ) );
- }
- for ( int n = (int) c_nItemCount - 1; n >= 0; --n ) {
- typename tree_type::guarded_ptr gp( t.extract_max());
- CPPUNIT_ASSERT( !gp.empty());
- CPPUNIT_CHECK( gp->nKey == n );
- }
-
- tree_type::gc::force_dispose();
- }
-
- PrintStat()( t );
- }
-
- template <class Tree, class PrintStat>
- void test_rcu()
- {
- typedef Tree tree_type;
- typedef typename tree_type::key_type key_type;
- typedef typename tree_type::value_type value_type;
-
- tree_type t;
- test_common(t);
-
- // extract/get
- {
- value_type v1( 10, 100 );
- value_type v2( 20, 200 );
- value_type v3( 30, 300 );
- value_type v4( 25, 250 );
- value_type v5( -50, -500 );
-
- // extract/extract_min/extract_max
- CPPUNIT_ASSERT( t.insert( v1 ));
- CPPUNIT_ASSERT( t.insert( v2 ));
- CPPUNIT_ASSERT( t.insert( v3 ));
- CPPUNIT_ASSERT( t.insert( v4 ));
- CPPUNIT_ASSERT( t.insert( v5 ));
- CPPUNIT_ASSERT( t.check_consistency() );
- CPPUNIT_ASSERT( !t.empty() );
- CPPUNIT_ASSERT( misc::check_size( t, 5 ));
-
- typename tree_type::exempt_ptr ep;
- typename tree_type::value_type * pVal;
- {
- typename tree_type::rcu_lock l;
- pVal = t.get( v1.nKey );
- CPPUNIT_ASSERT( pVal != nullptr );
- CPPUNIT_CHECK( pVal == &v1 );
- }
- ep = t.extract( v1.nKey );
- CPPUNIT_ASSERT( !ep.empty());
- CPPUNIT_CHECK( ep->nKey == v1.nKey );
- {
- typename tree_type::rcu_lock l;
- CPPUNIT_CHECK( t.get( v1.nKey ) == nullptr );
- }
- ep.release();
- ep = t.extract( v1.nKey );
- CPPUNIT_ASSERT( ep.empty());
-
- ep = t.extract_min();
- CPPUNIT_ASSERT( !ep.empty() );
- CPPUNIT_CHECK( ep->nKey == v5.nKey );
- {
- typename tree_type::rcu_lock l;
- CPPUNIT_CHECK( t.get( v5.nKey ) == nullptr );
- }
-
- ep = t.extract( v5.nKey );
- CPPUNIT_ASSERT( ep.empty() );
-
- ep = t.extract_max();
- CPPUNIT_ASSERT( !ep.empty());
- CPPUNIT_CHECK( ep->nKey == v3.nKey );
- {
- typename tree_type::rcu_lock l;
- CPPUNIT_CHECK( t.get( v3.nKey ) == nullptr );
- }
- ep.release();
-
- {
- typename tree_type::rcu_lock l;
- pVal = t.get_with( wrapped_int(v2.nKey), wrapped_less<value_type>() );
- CPPUNIT_ASSERT( pVal != nullptr );
- CPPUNIT_CHECK( pVal == &v2 );
- }
- ep = t.extract_with( wrapped_int( v2.nKey ), wrapped_less<value_type>() );
- CPPUNIT_ASSERT( !ep.empty() );
- CPPUNIT_CHECK( ep->nKey == v2.nKey );
- {
- typename tree_type::rcu_lock l;
- CPPUNIT_CHECK( t.get_with( wrapped_int( v2.nKey ), wrapped_less<value_type>() ) == nullptr );
- }
- //ep.release();
- ep = t.extract_with( wrapped_int( v2.nKey ), wrapped_less<value_type>() );
- CPPUNIT_CHECK( ep.empty());
-
- ep = t.extract( v4.nKey );
- CPPUNIT_ASSERT( ep );
- CPPUNIT_CHECK( ep->nKey == v4.nKey );
- ep.release();
-
- tree_type::gc::force_dispose();
-
- CPPUNIT_CHECK( t.empty());
- CPPUNIT_ASSERT( misc::check_size( t, 0 ));
-
- {
- typename tree_type::rcu_lock l;
- CPPUNIT_CHECK( t.get( v1.nKey ) == nullptr );
- CPPUNIT_CHECK( t.get( v2.nKey ) == nullptr );
- CPPUNIT_CHECK( t.get( v3.nKey ) == nullptr );
- CPPUNIT_CHECK( t.get( v4.nKey ) == nullptr );
- CPPUNIT_CHECK( t.get( v5.nKey ) == nullptr );
- }
-
- CPPUNIT_CHECK( !t.extract(v1.nKey));
- CPPUNIT_CHECK( !t.extract(v2.nKey));
- CPPUNIT_CHECK( !t.extract(v3.nKey));
- CPPUNIT_CHECK( !t.extract(v4.nKey));
- CPPUNIT_CHECK( !t.extract(v5.nKey));
-
- tree_type::gc::force_dispose();
- }
-
- PrintStat()( t );
- }
-
- void EllenBinTree_hp_base_less();
- void EllenBinTree_hp_base_cmp();
- void EllenBinTree_hp_base_cmpless();
- void EllenBinTree_hp_base_less_ic();
- void EllenBinTree_hp_base_cmp_ic();
- void EllenBinTree_hp_base_less_stat();
- void EllenBinTree_hp_base_cmp_ic_stat();
- void EllenBinTree_hp_base_cmp_ic_stat_yield();
- void EllenBinTree_hp_base_less_pool();
- void EllenBinTree_hp_base_less_pool_ic_stat();
-
- void EllenBinTree_hp_member_less();
- void EllenBinTree_hp_member_cmp();
- void EllenBinTree_hp_member_cmpless();
- void EllenBinTree_hp_member_less_ic();
- void EllenBinTree_hp_member_cmp_ic();
- void EllenBinTree_hp_member_less_stat();
- void EllenBinTree_hp_member_cmp_ic_stat();
- void EllenBinTree_hp_member_cmp_ic_stat_yield();
- void EllenBinTree_hp_member_less_pool();
- void EllenBinTree_hp_member_less_pool_ic_stat();
-
- void EllenBinTree_dhp_base_less();
- void EllenBinTree_dhp_base_cmp();
- void EllenBinTree_dhp_base_cmpless();
- void EllenBinTree_dhp_base_less_ic();
- void EllenBinTree_dhp_base_cmp_ic();
- void EllenBinTree_dhp_base_less_stat();
- void EllenBinTree_dhp_base_cmp_ic_stat();
- void EllenBinTree_dhp_base_cmp_ic_stat_yield();
- void EllenBinTree_dhp_base_less_pool();
- void EllenBinTree_dhp_base_less_pool_ic_stat();
-
- void EllenBinTree_dhp_member_less();
- void EllenBinTree_dhp_member_cmp();
- void EllenBinTree_dhp_member_cmpless();
- void EllenBinTree_dhp_member_less_ic();
- void EllenBinTree_dhp_member_cmp_ic();
- void EllenBinTree_dhp_member_less_stat();
- void EllenBinTree_dhp_member_cmp_ic_stat();
- void EllenBinTree_dhp_member_cmp_ic_stat_yield();
- void EllenBinTree_dhp_member_less_pool();
- void EllenBinTree_dhp_member_less_pool_ic_stat();
-
- void EllenBinTree_rcu_gpi_base_less();
- void EllenBinTree_rcu_gpi_base_cmp();
- void EllenBinTree_rcu_gpi_base_cmpless();
- void EllenBinTree_rcu_gpi_base_less_ic();
- void EllenBinTree_rcu_gpi_base_cmp_ic();
- void EllenBinTree_rcu_gpi_base_less_stat();
- void EllenBinTree_rcu_gpi_base_cmp_ic_stat();
- void EllenBinTree_rcu_gpi_base_cmp_ic_stat_yield();
- void EllenBinTree_rcu_gpi_base_less_pool();
- void EllenBinTree_rcu_gpi_base_less_pool_ic_stat();
-
- void EllenBinTree_rcu_gpi_member_less();
- void EllenBinTree_rcu_gpi_member_cmp();
- void EllenBinTree_rcu_gpi_member_cmpless();
- void EllenBinTree_rcu_gpi_member_less_ic();
- void EllenBinTree_rcu_gpi_member_cmp_ic();
- void EllenBinTree_rcu_gpi_member_less_stat();
- void EllenBinTree_rcu_gpi_member_cmp_ic_stat();
- void EllenBinTree_rcu_gpi_member_cmp_ic_stat_yield();
- void EllenBinTree_rcu_gpi_member_less_pool();
- void EllenBinTree_rcu_gpi_member_less_pool_ic_stat();
-
- void EllenBinTree_rcu_gpb_base_less();
- void EllenBinTree_rcu_gpb_base_cmp();
- void EllenBinTree_rcu_gpb_base_cmpless();
- void EllenBinTree_rcu_gpb_base_less_ic();
- void EllenBinTree_rcu_gpb_base_cmp_ic();
- void EllenBinTree_rcu_gpb_base_less_stat();
- void EllenBinTree_rcu_gpb_base_cmp_ic_stat();
- void EllenBinTree_rcu_gpb_base_cmp_ic_stat_yield();
- void EllenBinTree_rcu_gpb_base_less_pool();
- void EllenBinTree_rcu_gpb_base_less_pool_ic_stat();
-
- void EllenBinTree_rcu_gpb_member_less();
- void EllenBinTree_rcu_gpb_member_cmp();
- void EllenBinTree_rcu_gpb_member_cmpless();
- void EllenBinTree_rcu_gpb_member_less_ic();
- void EllenBinTree_rcu_gpb_member_cmp_ic();
- void EllenBinTree_rcu_gpb_member_less_stat();
- void EllenBinTree_rcu_gpb_member_cmp_ic_stat();
- void EllenBinTree_rcu_gpb_member_cmp_ic_stat_yield();
- void EllenBinTree_rcu_gpb_member_less_pool();
- void EllenBinTree_rcu_gpb_member_less_pool_ic_stat();
-
- void EllenBinTree_rcu_gpt_base_less();
- void EllenBinTree_rcu_gpt_base_cmp();
- void EllenBinTree_rcu_gpt_base_cmpless();
- void EllenBinTree_rcu_gpt_base_less_ic();
- void EllenBinTree_rcu_gpt_base_cmp_ic();
- void EllenBinTree_rcu_gpt_base_less_stat();
- void EllenBinTree_rcu_gpt_base_cmp_ic_stat();
- void EllenBinTree_rcu_gpt_base_cmp_ic_stat_yield();
- void EllenBinTree_rcu_gpt_base_less_pool();
- void EllenBinTree_rcu_gpt_base_less_pool_ic_stat();
-
- void EllenBinTree_rcu_gpt_member_less();
- void EllenBinTree_rcu_gpt_member_cmp();
- void EllenBinTree_rcu_gpt_member_cmpless();
- void EllenBinTree_rcu_gpt_member_less_ic();
- void EllenBinTree_rcu_gpt_member_cmp_ic();
- void EllenBinTree_rcu_gpt_member_less_stat();
- void EllenBinTree_rcu_gpt_member_cmp_ic_stat();
- void EllenBinTree_rcu_gpt_member_cmp_ic_stat_yield();
- void EllenBinTree_rcu_gpt_member_less_pool();
- void EllenBinTree_rcu_gpt_member_less_pool_ic_stat();
-
- void EllenBinTree_rcu_shb_base_less();
- void EllenBinTree_rcu_shb_base_cmp();
- void EllenBinTree_rcu_shb_base_cmpless();
- void EllenBinTree_rcu_shb_base_less_ic();
- void EllenBinTree_rcu_shb_base_cmp_ic();
- void EllenBinTree_rcu_shb_base_less_stat();
- void EllenBinTree_rcu_shb_base_cmp_ic_stat();
- void EllenBinTree_rcu_shb_base_cmp_ic_stat_yield();
- void EllenBinTree_rcu_shb_base_less_pool();
- void EllenBinTree_rcu_shb_base_less_pool_ic_stat();
-
- void EllenBinTree_rcu_shb_member_less();
- void EllenBinTree_rcu_shb_member_cmp();
- void EllenBinTree_rcu_shb_member_cmpless();
- void EllenBinTree_rcu_shb_member_less_ic();
- void EllenBinTree_rcu_shb_member_cmp_ic();
- void EllenBinTree_rcu_shb_member_less_stat();
- void EllenBinTree_rcu_shb_member_cmp_ic_stat();
- void EllenBinTree_rcu_shb_member_cmp_ic_stat_yield();
- void EllenBinTree_rcu_shb_member_less_pool();
- void EllenBinTree_rcu_shb_member_less_pool_ic_stat();
-
- void EllenBinTree_rcu_sht_base_less();
- void EllenBinTree_rcu_sht_base_cmp();
- void EllenBinTree_rcu_sht_base_cmpless();
- void EllenBinTree_rcu_sht_base_less_ic();
- void EllenBinTree_rcu_sht_base_cmp_ic();
- void EllenBinTree_rcu_sht_base_less_stat();
- void EllenBinTree_rcu_sht_base_cmp_ic_stat();
- void EllenBinTree_rcu_sht_base_cmp_ic_stat_yield();
- void EllenBinTree_rcu_sht_base_less_pool();
- void EllenBinTree_rcu_sht_base_less_pool_ic_stat();
-
- void EllenBinTree_rcu_sht_member_less();
- void EllenBinTree_rcu_sht_member_cmp();
- void EllenBinTree_rcu_sht_member_cmpless();
- void EllenBinTree_rcu_sht_member_less_ic();
- void EllenBinTree_rcu_sht_member_cmp_ic();
- void EllenBinTree_rcu_sht_member_less_stat();
- void EllenBinTree_rcu_sht_member_cmp_ic_stat();
- void EllenBinTree_rcu_sht_member_cmp_ic_stat_yield();
- void EllenBinTree_rcu_sht_member_less_pool();
- void EllenBinTree_rcu_sht_member_less_pool_ic_stat();
-
- CPPUNIT_TEST_SUITE(IntrusiveBinTreeHdrTest)
- CPPUNIT_TEST(EllenBinTree_hp_base_less)
- CPPUNIT_TEST(EllenBinTree_hp_base_cmp)
- CPPUNIT_TEST(EllenBinTree_hp_base_less_stat)
- CPPUNIT_TEST(EllenBinTree_hp_base_cmpless)
- CPPUNIT_TEST(EllenBinTree_hp_base_less_ic)
- CPPUNIT_TEST(EllenBinTree_hp_base_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_hp_base_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_hp_base_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_hp_base_less_pool )
- CPPUNIT_TEST(EllenBinTree_hp_base_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_hp_member_less)
- CPPUNIT_TEST(EllenBinTree_hp_member_cmp)
- CPPUNIT_TEST(EllenBinTree_hp_member_less_stat)
- CPPUNIT_TEST(EllenBinTree_hp_member_cmpless)
- CPPUNIT_TEST(EllenBinTree_hp_member_less_ic)
- CPPUNIT_TEST(EllenBinTree_hp_member_cmp_ic)
- CPPUNIT_TEST( EllenBinTree_hp_member_cmp_ic_stat )
- CPPUNIT_TEST( EllenBinTree_hp_member_cmp_ic_stat_yield )
- CPPUNIT_TEST(EllenBinTree_hp_member_less_pool)
- CPPUNIT_TEST(EllenBinTree_hp_member_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_dhp_base_less)
- CPPUNIT_TEST(EllenBinTree_dhp_base_cmp)
- CPPUNIT_TEST(EllenBinTree_dhp_base_less_stat)
- CPPUNIT_TEST(EllenBinTree_dhp_base_cmpless)
- CPPUNIT_TEST(EllenBinTree_dhp_base_less_ic)
- CPPUNIT_TEST(EllenBinTree_dhp_base_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_dhp_base_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_dhp_base_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_dhp_base_less_pool )
- CPPUNIT_TEST(EllenBinTree_dhp_base_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_dhp_member_less)
- CPPUNIT_TEST(EllenBinTree_dhp_member_cmp)
- CPPUNIT_TEST(EllenBinTree_dhp_member_less_stat)
- CPPUNIT_TEST(EllenBinTree_dhp_member_cmpless)
- CPPUNIT_TEST(EllenBinTree_dhp_member_less_ic)
- CPPUNIT_TEST(EllenBinTree_dhp_member_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_dhp_member_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_dhp_member_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_dhp_member_less_pool )
- CPPUNIT_TEST(EllenBinTree_dhp_member_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_base_less)
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_base_cmp)
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_base_less_stat)
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_base_cmpless)
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_base_less_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_base_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_base_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_rcu_gpi_base_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_rcu_gpi_base_less_pool )
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_base_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_member_less)
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_member_cmp)
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_member_less_stat)
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_member_cmpless)
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_member_less_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_member_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_member_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_rcu_gpi_member_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_rcu_gpi_member_less_pool )
- CPPUNIT_TEST(EllenBinTree_rcu_gpi_member_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_base_less)
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_base_cmp)
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_base_less_stat)
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_base_cmpless)
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_base_less_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_base_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_base_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_rcu_gpb_base_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_rcu_gpb_base_less_pool )
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_base_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_member_less)
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_member_cmp)
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_member_less_stat)
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_member_cmpless)
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_member_less_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_member_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_member_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_rcu_gpb_member_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_rcu_gpb_member_less_pool )
- CPPUNIT_TEST(EllenBinTree_rcu_gpb_member_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_base_less)
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_base_cmp)
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_base_less_stat)
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_base_cmpless)
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_base_less_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_base_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_base_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_rcu_gpt_base_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_rcu_gpt_base_less_pool )
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_base_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_member_less)
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_member_cmp)
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_member_less_stat)
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_member_cmpless)
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_member_less_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_member_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_member_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_rcu_gpt_member_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_rcu_gpt_member_less_pool )
- CPPUNIT_TEST(EllenBinTree_rcu_gpt_member_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_rcu_shb_base_less)
- CPPUNIT_TEST(EllenBinTree_rcu_shb_base_cmp)
- CPPUNIT_TEST(EllenBinTree_rcu_shb_base_less_stat)
- CPPUNIT_TEST(EllenBinTree_rcu_shb_base_cmpless)
- CPPUNIT_TEST(EllenBinTree_rcu_shb_base_less_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_shb_base_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_shb_base_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_rcu_shb_base_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_rcu_shb_base_less_pool )
- CPPUNIT_TEST(EllenBinTree_rcu_shb_base_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_rcu_shb_member_less)
- CPPUNIT_TEST(EllenBinTree_rcu_shb_member_cmp)
- CPPUNIT_TEST(EllenBinTree_rcu_shb_member_less_stat)
- CPPUNIT_TEST(EllenBinTree_rcu_shb_member_cmpless)
- CPPUNIT_TEST(EllenBinTree_rcu_shb_member_less_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_shb_member_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_shb_member_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_rcu_shb_member_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_rcu_shb_member_less_pool )
- CPPUNIT_TEST(EllenBinTree_rcu_shb_member_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_rcu_sht_base_less)
- CPPUNIT_TEST(EllenBinTree_rcu_sht_base_cmp)
- CPPUNIT_TEST(EllenBinTree_rcu_sht_base_less_stat)
- CPPUNIT_TEST(EllenBinTree_rcu_sht_base_cmpless)
- CPPUNIT_TEST(EllenBinTree_rcu_sht_base_less_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_sht_base_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_sht_base_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_rcu_sht_base_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_rcu_sht_base_less_pool )
- CPPUNIT_TEST(EllenBinTree_rcu_sht_base_less_pool_ic_stat)
-
- CPPUNIT_TEST(EllenBinTree_rcu_sht_member_less)
- CPPUNIT_TEST(EllenBinTree_rcu_sht_member_cmp)
- CPPUNIT_TEST(EllenBinTree_rcu_sht_member_less_stat)
- CPPUNIT_TEST(EllenBinTree_rcu_sht_member_cmpless)
- CPPUNIT_TEST(EllenBinTree_rcu_sht_member_less_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_sht_member_cmp_ic)
- CPPUNIT_TEST(EllenBinTree_rcu_sht_member_cmp_ic_stat)
- CPPUNIT_TEST( EllenBinTree_rcu_sht_member_cmp_ic_stat_yield )
- CPPUNIT_TEST( EllenBinTree_rcu_sht_member_less_pool )
- CPPUNIT_TEST(EllenBinTree_rcu_sht_member_less_pool_ic_stat)
-
- CPPUNIT_TEST_SUITE_END()
- };
-} // namespace tree
-
-#endif // #ifndef CDSTEST_HDR_INTRUSIVE_BINTREE_H
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_intrusive_bintree.h"
-#include <cds/intrusive/ellen_bintree_dhp.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_dhp.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
- namespace ci = cds::intrusive;
- namespace co = cds::opt;
- namespace {
- typedef ci::ellen_bintree::node<cds::gc::DHP> leaf_node;
- typedef IntrusiveBinTreeHdrTest::base_hook_value< leaf_node > base_value;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
-
- typedef ci::ellen_bintree::internal_node< IntrusiveBinTreeHdrTest::key_type, leaf_node > internal_node;
- typedef ci::ellen_bintree::update_desc< leaf_node, internal_node > update_desc;
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_dhp_base_less()
- {
- struct tree_traits : public ci::ellen_bintree::traits
- {
- typedef ci::ellen_bintree::base_hook< co::gc< cds::gc::DHP >> hook;
- typedef IntrusiveBinTreeHdrTest::key_extractor< base_value > key_extractor;
- typedef IntrusiveBinTreeHdrTest::less< base_value > less;
- typedef IntrusiveBinTreeHdrTest::disposer< base_value > disposer;
- };
- typedef ci::EllenBinTree< cds::gc::DHP, key_type, base_value, tree_traits > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_dhp_base_less_stat()
- {
- typedef ci::EllenBinTree< cds::gc::DHP, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< cds::gc::DHP > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_dhp_base_cmp()
- {
- typedef ci::EllenBinTree< cds::gc::DHP, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< cds::gc::DHP > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_dhp_base_cmpless()
- {
- typedef ci::EllenBinTree< cds::gc::DHP, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< cds::gc::DHP > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_dhp_base_less_ic()
- {
- typedef ci::EllenBinTree< cds::gc::DHP, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< cds::gc::DHP > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_dhp_base_cmp_ic()
- {
- typedef ci::EllenBinTree< cds::gc::DHP, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< cds::gc::DHP > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_dhp_base_cmp_ic_stat()
- {
- typedef ci::EllenBinTree< cds::gc::DHP, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< cds::gc::DHP > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_dhp_base_cmp_ic_stat_yield()
- {
- typedef ci::EllenBinTree< cds::gc::DHP, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< cds::gc::DHP > > >
- , ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- , co::compare< compare< base_value > >
- , ci::opt::disposer< disposer< base_value > >
- , co::item_counter< cds::atomicity::item_counter >
- , co::stat< ci::ellen_bintree::stat<> >
- , co::back_off< cds::backoff::yield >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_dhp_base_less_pool()
- {
- typedef ci::EllenBinTree< cds::gc::DHP, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< cds::gc::DHP > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_dhp::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_dhp::update_desc_pool_accessor > >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_dhp_base_less_pool_ic_stat()
- {
- typedef ci::EllenBinTree< cds::gc::DHP, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< cds::gc::DHP > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_dhp::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_dhp::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
-
-} //namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_intrusive_bintree.h"
-#include <cds/intrusive/ellen_bintree_dhp.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_dhp.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
- namespace ci = cds::intrusive;
- namespace co = cds::opt;
- namespace {
- typedef ci::ellen_bintree::node<cds::gc::DHP> leaf_node;
- typedef IntrusiveBinTreeHdrTest::member_hook_value< leaf_node > member_value;
-
- typedef ci::opt::hook< ci::ellen_bintree::member_hook< offsetof(member_value, hook), co::gc< cds::gc::DHP > > > member_hook;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
-
- typedef ci::ellen_bintree::internal_node< IntrusiveBinTreeHdrTest::key_type, leaf_node > internal_node;
- typedef ci::ellen_bintree::update_desc< leaf_node, internal_node > update_desc;
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_dhp_member_less()
- {
- struct tree_traits : public ci::ellen_bintree::traits
- {
- typedef ci::ellen_bintree::member_hook< offsetof( member_value, hook ), co::gc< cds::gc::DHP >> hook;
- typedef IntrusiveBinTreeHdrTest::key_extractor< member_value > key_extractor;
- typedef IntrusiveBinTreeHdrTest::less< member_value > less;
- typedef IntrusiveBinTreeHdrTest::disposer< member_value > disposer;
- };
- typedef ci::EllenBinTree< cds::gc::DHP, key_type, member_value, tree_traits > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_dhp_member_less_stat()
- {
- typedef ci::EllenBinTree< cds::gc::DHP, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_dhp_member_cmp()
- {
- typedef ci::EllenBinTree< cds::gc::DHP, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_dhp_member_cmpless()
- {
- typedef ci::EllenBinTree< cds::gc::DHP, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_dhp_member_less_ic()
- {
- typedef ci::EllenBinTree< cds::gc::DHP, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_dhp_member_cmp_ic()
- {
- typedef ci::EllenBinTree< cds::gc::DHP, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_dhp_member_cmp_ic_stat()
- {
- typedef ci::EllenBinTree< cds::gc::DHP, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_dhp_member_cmp_ic_stat_yield()
- {
- typedef ci::EllenBinTree< cds::gc::DHP, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- ,co::back_off< cds::backoff::yield >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_dhp_member_less_pool()
- {
- typedef ci::EllenBinTree< cds::gc::DHP, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_dhp::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_dhp::update_desc_pool_accessor > >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_dhp_member_less_pool_ic_stat()
- {
- typedef ci::EllenBinTree< cds::gc::DHP, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_dhp::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_dhp::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
-
-} //namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_intrusive_bintree.h"
-#include <cds/intrusive/ellen_bintree_hp.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_hp.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
- namespace ci = cds::intrusive;
- namespace co = cds::opt;
- namespace {
- typedef ci::ellen_bintree::node<cds::gc::HP> leaf_node;
- typedef IntrusiveBinTreeHdrTest::base_hook_value< leaf_node > base_value;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
-
- typedef ci::ellen_bintree::internal_node< IntrusiveBinTreeHdrTest::key_type, leaf_node > internal_node;
- typedef ci::ellen_bintree::update_desc< leaf_node, internal_node > update_desc;
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_hp_base_less()
- {
- struct tree_traits : public ci::ellen_bintree::traits
- {
- typedef ci::ellen_bintree::base_hook< co::gc< cds::gc::HP >> hook;
- typedef IntrusiveBinTreeHdrTest::key_extractor< base_value > key_extractor;
- typedef IntrusiveBinTreeHdrTest::less< base_value > less;
- typedef IntrusiveBinTreeHdrTest::disposer< base_value > disposer;
- };
- typedef ci::EllenBinTree< cds::gc::HP, key_type, base_value, tree_traits > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_hp_base_less_stat()
- {
- typedef ci::EllenBinTree< cds::gc::HP, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< cds::gc::HP > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_hp_base_cmp()
- {
- typedef ci::EllenBinTree< cds::gc::HP, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< cds::gc::HP > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_hp_base_cmpless()
- {
- typedef ci::EllenBinTree< cds::gc::HP, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< cds::gc::HP > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_hp_base_less_ic()
- {
- typedef ci::EllenBinTree< cds::gc::HP, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< cds::gc::HP > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_hp_base_cmp_ic()
- {
- typedef ci::EllenBinTree< cds::gc::HP, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< cds::gc::HP > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_hp_base_cmp_ic_stat()
- {
- typedef ci::EllenBinTree< cds::gc::HP, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< cds::gc::HP > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_hp_base_cmp_ic_stat_yield()
- {
- typedef ci::EllenBinTree< cds::gc::HP, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< cds::gc::HP > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- , co::back_off< cds::backoff::yield >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_hp_base_less_pool()
- {
- typedef ci::EllenBinTree< cds::gc::HP, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< cds::gc::HP > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_hp::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_hp::update_desc_pool_accessor > >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_hp_base_less_pool_ic_stat()
- {
- typedef ci::EllenBinTree< cds::gc::HP, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< cds::gc::HP > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_hp::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_hp::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
-
-} //namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_intrusive_bintree.h"
-#include <cds/intrusive/ellen_bintree_hp.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_hp.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
- namespace ci = cds::intrusive;
- namespace co = cds::opt;
- namespace {
- typedef ci::ellen_bintree::node<cds::gc::HP> leaf_node;
- typedef IntrusiveBinTreeHdrTest::member_hook_value< leaf_node > member_value;
-
- typedef ci::opt::hook< ci::ellen_bintree::member_hook< offsetof(member_value, hook), co::gc< cds::gc::HP > > > member_hook;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
-
- typedef ci::ellen_bintree::internal_node< IntrusiveBinTreeHdrTest::key_type, leaf_node > internal_node;
- typedef ci::ellen_bintree::update_desc< leaf_node, internal_node > update_desc;
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_hp_member_less()
- {
- struct tree_traits : public ci::ellen_bintree::traits
- {
- typedef ci::ellen_bintree::member_hook< offsetof( member_value, hook ), co::gc< cds::gc::HP >> hook;
- typedef IntrusiveBinTreeHdrTest::key_extractor< member_value > key_extractor;
- typedef IntrusiveBinTreeHdrTest::less< member_value > less;
- typedef IntrusiveBinTreeHdrTest::disposer< member_value > disposer;
- };
- typedef ci::EllenBinTree< cds::gc::HP, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_hp_member_less_stat()
- {
- typedef ci::EllenBinTree< cds::gc::HP, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_hp_member_cmp()
- {
- typedef ci::EllenBinTree< cds::gc::HP, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_hp_member_cmpless()
- {
- typedef ci::EllenBinTree< cds::gc::HP, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_hp_member_less_ic()
- {
- typedef ci::EllenBinTree< cds::gc::HP, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_hp_member_cmp_ic()
- {
- typedef ci::EllenBinTree< cds::gc::HP, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_hp_member_cmp_ic_stat()
- {
- typedef ci::EllenBinTree< cds::gc::HP, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_hp_member_cmp_ic_stat_yield()
- {
- typedef ci::EllenBinTree< cds::gc::HP, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- , co::back_off< cds::backoff::yield >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_hp_member_less_pool()
- {
- typedef ci::EllenBinTree< cds::gc::HP, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_hp::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_hp::update_desc_pool_accessor > >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_hp_member_less_pool_ic_stat()
- {
- typedef ci::EllenBinTree< cds::gc::HP, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_hp::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_hp::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test<tree_type, print_stat>();
- }
-
-
-} //namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef CDSTEST_HDR_INTRUSIVE_ELLEN_BINTREE_POOL_DHP_H
-#define CDSTEST_HDR_INTRUSIVE_ELLEN_BINTREE_POOL_DHP_H
-
-#include "tree/hdr_intrusive_bintree.h"
-#include <cds/intrusive/ellen_bintree_dhp.h>
-
-#include <cds/memory/vyukov_queue_pool.h>
-#include <cds/memory/pool_allocator.h>
-
-namespace tree {
-
- namespace ellen_bintree_dhp {
- typedef cds::intrusive::ellen_bintree::node_types<cds::gc::DHP, IntrusiveBinTreeHdrTest::key_type> node_types;
- typedef node_types::leaf_node_type leaf_node;
- typedef IntrusiveBinTreeHdrTest::base_hook_value< leaf_node > base_value;
- typedef node_types::internal_node_type internal_node;
- typedef node_types::update_desc_type update_desc;
-
-
- // Internal node pool based on Vyukov's queue
- struct internal_node_pool_traits : public cds::memory::vyukov_queue_pool_traits
- {
- typedef cds::opt::v::dynamic_buffer< cds::any_type > buffer;
- };
- typedef cds::memory::lazy_vyukov_queue_pool< internal_node, internal_node_pool_traits > internal_node_pool_type;
- extern internal_node_pool_type s_InternalNodePool;
-
- struct internal_node_pool_accessor {
- typedef internal_node_pool_type::value_type value_type;
-
- internal_node_pool_type& operator()() const
- {
- return s_InternalNodePool;
- }
- };
-
- // Update descriptor pool based on Vyukov's queue
- struct update_desc_pool_traits : public cds::memory::vyukov_queue_pool_traits
- {
- typedef cds::opt::v::static_buffer< cds::any_type, 16 > buffer;
- };
- typedef cds::memory::vyukov_queue_pool< update_desc, update_desc_pool_traits > update_desc_pool_type;
- extern update_desc_pool_type s_UpdateDescPool;
-
- struct update_desc_pool_accessor {
- typedef update_desc_pool_type::value_type value_type;
-
- update_desc_pool_type& operator()() const
- {
- return s_UpdateDescPool;
- }
- };
-
- } // namespace ellen_bintree_dhp
-
-} // namespace tree
-
-#endif // #ifndef CDSTEST_HDR_INTRUSIVE_ELLEN_BINTREE_POOL_DHP_H
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef CDSTEST_HDR_INTRUSIVE_ELLEN_BINTREE_POOL_HP_H
-#define CDSTEST_HDR_INTRUSIVE_ELLEN_BINTREE_POOL_HP_H
-
-#include "tree/hdr_intrusive_bintree.h"
-#include <cds/intrusive/ellen_bintree_hp.h>
-
-#include <cds/memory/vyukov_queue_pool.h>
-#include <cds/memory/pool_allocator.h>
-
-namespace tree {
-
- namespace ellen_bintree_hp {
- typedef cds::intrusive::ellen_bintree::node_types<cds::gc::HP, IntrusiveBinTreeHdrTest::key_type> node_types;
- typedef node_types::leaf_node_type leaf_node;
- typedef IntrusiveBinTreeHdrTest::base_hook_value< leaf_node > base_value;
- typedef node_types::internal_node_type internal_node;
- typedef node_types::update_desc_type update_desc;
-
- // Internal node pool based on Vyukov's queue
- struct internal_node_pool_traits : public cds::memory::vyukov_queue_pool_traits
- {
- typedef cds::opt::v::dynamic_buffer< cds::any_type > buffer;
- };
- typedef cds::memory::lazy_vyukov_queue_pool< internal_node, internal_node_pool_traits > internal_node_pool_type;
- extern internal_node_pool_type s_InternalNodePool;
-
- struct internal_node_pool_accessor {
- typedef internal_node_pool_type::value_type value_type;
-
- internal_node_pool_type& operator()() const
- {
- return s_InternalNodePool;
- }
- };
-
- // Update descriptor pool based on Vyukov's queue
- struct update_desc_pool_traits : public cds::memory::vyukov_queue_pool_traits
- {
- typedef cds::opt::v::static_buffer< cds::any_type, 16 > buffer;
- };
- typedef cds::memory::vyukov_queue_pool< update_desc, update_desc_pool_traits > update_desc_pool_type;
- extern update_desc_pool_type s_UpdateDescPool;
-
- struct update_desc_pool_accessor {
- typedef update_desc_pool_type::value_type value_type;
-
- update_desc_pool_type& operator()() const
- {
- return s_UpdateDescPool;
- }
- };
-
- } // namespace ellen_bintree_hp
-
-} // namespace tree
-
-#endif // #ifndef CDSTEST_HDR_INTRUSIVE_ELLEN_BINTREE_POOL_HP_H
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef CDSTEST_HDR_INTRUSIVE_ELLEN_BINTREE_POOL_RCU_H
-#define CDSTEST_HDR_INTRUSIVE_ELLEN_BINTREE_POOL_RCU_H
-
-#include "tree/hdr_intrusive_bintree.h"
-#include <cds/urcu/general_instant.h>
-#include <cds/intrusive/ellen_bintree_rcu.h>
-
-#include <cds/memory/vyukov_queue_pool.h>
-#include <cds/memory/pool_allocator.h>
-
-namespace tree {
-
- namespace ellen_bintree_rcu {
- typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type;
-
- typedef cds::intrusive::ellen_bintree::node_types<rcu_type, IntrusiveBinTreeHdrTest::key_type> node_types;
- typedef node_types::leaf_node_type leaf_node;
- typedef IntrusiveBinTreeHdrTest::base_hook_value< leaf_node > base_value;
- typedef node_types::internal_node_type internal_node;
- typedef node_types::update_desc_type update_desc;
-
-
- // Internal node pool based on Vyukov's queue
- struct internal_node_pool_traits : public cds::memory::vyukov_queue_pool_traits
- {
- typedef cds::opt::v::dynamic_buffer< cds::any_type > buffer;
- };
- typedef cds::memory::lazy_vyukov_queue_pool< internal_node, internal_node_pool_traits > internal_node_pool_type;
- extern internal_node_pool_type s_InternalNodePool;
-
- struct internal_node_pool_accessor {
- typedef internal_node_pool_type::value_type value_type;
-
- internal_node_pool_type& operator()() const
- {
- return s_InternalNodePool;
- }
- };
-
- // Update descriptor pool based on Vyukov's queue
- struct update_desc_pool_traits : public cds::memory::vyukov_queue_pool_traits
- {
- typedef cds::opt::v::static_buffer< cds::any_type, 16 > buffer;
- };
- typedef cds::memory::vyukov_queue_pool< update_desc, update_desc_pool_traits > update_desc_pool_type;
- extern update_desc_pool_type s_UpdateDescPool;
-
- struct update_desc_pool_accessor {
- typedef update_desc_pool_type::value_type value_type;
-
- update_desc_pool_type& operator()() const
- {
- return s_UpdateDescPool;
- }
- };
-
- } // namespace ellen_bintree_rcu
-
-} // namespace tree
-
-#endif // #ifndef CDSTEST_HDR_INTRUSIVE_ELLEN_BINTREE_POOL_RCU_H
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_intrusive_bintree.h"
-#include <cds/urcu/general_buffered.h>
-#include <cds/intrusive/ellen_bintree_rcu.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_rcu.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
- namespace ci = cds::intrusive;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type;
-
- typedef ci::ellen_bintree::node<rcu_type> leaf_node;
- typedef IntrusiveBinTreeHdrTest::base_hook_value< leaf_node > base_value;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
-
- typedef ci::ellen_bintree::internal_node< IntrusiveBinTreeHdrTest::key_type, leaf_node > internal_node;
- typedef ci::ellen_bintree::update_desc< leaf_node, internal_node > update_desc;
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpb_base_less()
- {
- struct tree_traits : public ci::ellen_bintree::traits
- {
- typedef ci::ellen_bintree::base_hook< co::gc< rcu_type >> hook;
- typedef IntrusiveBinTreeHdrTest::key_extractor< base_value > key_extractor;
- typedef IntrusiveBinTreeHdrTest::less< base_value > less;
- typedef IntrusiveBinTreeHdrTest::disposer< base_value > disposer;
- };
- typedef ci::EllenBinTree< rcu_type, key_type, base_value, tree_traits > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpb_base_less_stat()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpb_base_cmp()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpb_base_cmpless()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpb_base_less_ic()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpb_base_cmp_ic()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpb_base_cmp_ic_stat()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpb_base_cmp_ic_stat_yield()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- , co::back_off< cds::backoff::yield >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpb_base_less_pool()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpb_base_less_pool_ic_stat()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
-
-} //namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_intrusive_bintree.h"
-#include <cds/urcu/general_buffered.h>
-#include <cds/intrusive/ellen_bintree_rcu.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_rcu.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
- namespace ci = cds::intrusive;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type;
-
- typedef ci::ellen_bintree::node<rcu_type> leaf_node;
- typedef IntrusiveBinTreeHdrTest::member_hook_value< leaf_node > member_value;
-
- typedef ci::opt::hook< ci::ellen_bintree::member_hook< offsetof(member_value, hook), co::gc< rcu_type > > > member_hook;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
-
- typedef ci::ellen_bintree::internal_node< IntrusiveBinTreeHdrTest::key_type, leaf_node > internal_node;
- typedef ci::ellen_bintree::update_desc< leaf_node, internal_node > update_desc;
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpb_member_less()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpb_member_less_stat()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpb_member_cmp()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpb_member_cmpless()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpb_member_less_ic()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpb_member_cmp_ic()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpb_member_cmp_ic_stat()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpb_member_cmp_ic_stat_yield()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- , co::back_off< cds::backoff::yield >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpb_member_less_pool()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpb_member_less_pool_ic_stat()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
-
-} //namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_intrusive_bintree.h"
-#include <cds/urcu/general_instant.h>
-#include <cds/intrusive/ellen_bintree_rcu.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_rcu.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
- namespace ci = cds::intrusive;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type;
-
- typedef ci::ellen_bintree::node<rcu_type> leaf_node;
- typedef IntrusiveBinTreeHdrTest::base_hook_value< leaf_node > base_value;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
-
- typedef ci::ellen_bintree::internal_node< IntrusiveBinTreeHdrTest::key_type, leaf_node > internal_node;
- typedef ci::ellen_bintree::update_desc< leaf_node, internal_node > update_desc;
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpi_base_less()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpi_base_less_stat()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpi_base_cmp()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpi_base_cmpless()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpi_base_less_ic()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpi_base_cmp_ic()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpi_base_cmp_ic_stat()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpi_base_cmp_ic_stat_yield()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- , co::back_off< cds::backoff::yield >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpi_base_less_pool()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpi_base_less_pool_ic_stat()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
-
-} //namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_intrusive_bintree.h"
-#include <cds/urcu/general_instant.h>
-#include <cds/intrusive/ellen_bintree_rcu.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_rcu.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
- namespace ci = cds::intrusive;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type;
-
- typedef ci::ellen_bintree::node<rcu_type> leaf_node;
- typedef IntrusiveBinTreeHdrTest::member_hook_value< leaf_node > member_value;
-
- typedef ci::opt::hook< ci::ellen_bintree::member_hook< offsetof(member_value, hook), co::gc< rcu_type > > > member_hook;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
-
- typedef ci::ellen_bintree::internal_node< IntrusiveBinTreeHdrTest::key_type, leaf_node > internal_node;
- typedef ci::ellen_bintree::update_desc< leaf_node, internal_node > update_desc;
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpi_member_less()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpi_member_less_stat()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpi_member_cmp()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpi_member_cmpless()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpi_member_less_ic()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpi_member_cmp_ic()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpi_member_cmp_ic_stat()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpi_member_cmp_ic_stat_yield()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- , co::back_off< cds::backoff::yield >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpi_member_less_pool()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpi_member_less_pool_ic_stat()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
-
-} //namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_intrusive_bintree.h"
-#include <cds/urcu/general_threaded.h>
-#include <cds/intrusive/ellen_bintree_rcu.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_rcu.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
- namespace ci = cds::intrusive;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type;
-
- typedef ci::ellen_bintree::node<rcu_type> leaf_node;
- typedef IntrusiveBinTreeHdrTest::base_hook_value< leaf_node > base_value;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
-
- typedef ci::ellen_bintree::internal_node< IntrusiveBinTreeHdrTest::key_type, leaf_node > internal_node;
- typedef ci::ellen_bintree::update_desc< leaf_node, internal_node > update_desc;
-}
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpt_base_less()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpt_base_less_stat()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpt_base_cmp()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpt_base_cmpless()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpt_base_less_ic()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpt_base_cmp_ic()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpt_base_cmp_ic_stat()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpt_base_cmp_ic_stat_yield()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- , co::back_off< cds::backoff::yield >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpt_base_less_pool()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpt_base_less_pool_ic_stat()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
-
-} //namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_intrusive_bintree.h"
-#include <cds/urcu/general_threaded.h>
-#include <cds/intrusive/ellen_bintree_rcu.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_rcu.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
- namespace ci = cds::intrusive;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type;
-
- typedef ci::ellen_bintree::node<rcu_type> leaf_node;
- typedef IntrusiveBinTreeHdrTest::member_hook_value< leaf_node > member_value;
-
- typedef ci::opt::hook< ci::ellen_bintree::member_hook< offsetof(member_value, hook), co::gc< rcu_type > > > member_hook;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
-
- typedef ci::ellen_bintree::internal_node< IntrusiveBinTreeHdrTest::key_type, leaf_node > internal_node;
- typedef ci::ellen_bintree::update_desc< leaf_node, internal_node > update_desc;
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpt_member_less()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpt_member_less_stat()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpt_member_cmp()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpt_member_cmpless()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpt_member_less_ic()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpt_member_cmp_ic()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpt_member_cmp_ic_stat()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpt_member_cmp_ic_stat_yield()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- , co::back_off< cds::backoff::yield >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpt_member_less_pool()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_gpt_member_less_pool_ic_stat()
- {
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
- }
-
-
-} //namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_intrusive_bintree.h"
-#include <cds/urcu/signal_buffered.h>
-#include <cds/intrusive/ellen_bintree_rcu.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_rcu.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace ci = cds::intrusive;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
-
- typedef ci::ellen_bintree::node<rcu_type> leaf_node;
- typedef IntrusiveBinTreeHdrTest::base_hook_value< leaf_node > base_value;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
-
- typedef ci::ellen_bintree::internal_node< IntrusiveBinTreeHdrTest::key_type, leaf_node > internal_node;
- typedef ci::ellen_bintree::update_desc< leaf_node, internal_node > update_desc;
- }
-#endif
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_shb_base_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_shb_base_less_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_shb_base_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_shb_base_cmpless()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_shb_base_less_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_shb_base_cmp_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_shb_base_cmp_ic_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_shb_base_cmp_ic_stat_yield()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- ,co::back_off< cds::backoff::yield >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_shb_base_less_pool()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_shb_base_less_pool_ic_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
-
-} //namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_intrusive_bintree.h"
-#include <cds/urcu/signal_buffered.h>
-#include <cds/intrusive/ellen_bintree_rcu.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_rcu.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace ci = cds::intrusive;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_type;
-
- typedef ci::ellen_bintree::node<rcu_type> leaf_node;
- typedef IntrusiveBinTreeHdrTest::member_hook_value< leaf_node > member_value;
-
- typedef ci::opt::hook< ci::ellen_bintree::member_hook< offsetof(member_value, hook), co::gc< rcu_type > > > member_hook;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
-
- typedef ci::ellen_bintree::internal_node< IntrusiveBinTreeHdrTest::key_type, leaf_node > internal_node;
- typedef ci::ellen_bintree::update_desc< leaf_node, internal_node > update_desc;
- }
-#endif
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_shb_member_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_shb_member_less_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_shb_member_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_shb_member_cmpless()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_shb_member_less_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_shb_member_cmp_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_shb_member_cmp_ic_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_shb_member_cmp_ic_stat_yield()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- ,co::back_off< cds::backoff::yield >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_shb_member_less_pool()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_shb_member_less_pool_ic_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
-} //namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_intrusive_bintree.h"
-#include <cds/urcu/signal_threaded.h>
-#include <cds/intrusive/ellen_bintree_rcu.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_rcu.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace ci = cds::intrusive;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type;
-
- typedef ci::ellen_bintree::node<rcu_type> leaf_node;
- typedef IntrusiveBinTreeHdrTest::base_hook_value< leaf_node > base_value;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
-
- typedef ci::ellen_bintree::internal_node< IntrusiveBinTreeHdrTest::key_type, leaf_node > internal_node;
- typedef ci::ellen_bintree::update_desc< leaf_node, internal_node > update_desc;
- }
-#endif
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_sht_base_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_sht_base_less_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_sht_base_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_sht_base_cmpless()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_sht_base_less_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_sht_base_cmp_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_sht_base_cmp_ic_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_sht_base_cmp_ic_stat_yield()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::compare< compare< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- ,co::back_off< cds::backoff::yield >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_sht_base_less_pool()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_sht_base_less_pool_ic_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, base_value,
- ci::ellen_bintree::make_traits<
- ci::opt::hook< ci::ellen_bintree::base_hook< co::gc< rcu_type > > >
- ,ci::ellen_bintree::key_extractor< key_extractor< base_value > >
- ,co::less< less< base_value > >
- ,ci::opt::disposer< disposer< base_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
-} //namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_intrusive_bintree.h"
-#include <cds/urcu/signal_threaded.h>
-#include <cds/intrusive/ellen_bintree_rcu.h>
-
-#include "tree/hdr_intrusive_ellen_bintree_pool_rcu.h"
-#include "unit/print_ellenbintree_stat.h"
-
-namespace tree {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- namespace ci = cds::intrusive;
- namespace co = cds::opt;
- namespace {
- typedef cds::urcu::gc< cds::urcu::signal_threaded<> > rcu_type;
-
- typedef ci::ellen_bintree::node<rcu_type> leaf_node;
- typedef IntrusiveBinTreeHdrTest::member_hook_value< leaf_node > member_value;
-
- typedef ci::opt::hook< ci::ellen_bintree::member_hook< offsetof(member_value, hook), co::gc< rcu_type > > > member_hook;
-
- struct print_stat {
- template <typename Tree>
- void operator()( Tree const& t)
- {
- std::cout << t.statistics();
- }
- };
-
- typedef ci::ellen_bintree::internal_node< IntrusiveBinTreeHdrTest::key_type, leaf_node > internal_node;
- typedef ci::ellen_bintree::update_desc< leaf_node, internal_node > update_desc;
- }
-#endif
-
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_sht_member_less()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_sht_member_less_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_sht_member_cmp()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_sht_member_cmpless()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_sht_member_less_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_sht_member_cmp_ic()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_sht_member_cmp_ic_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_sht_member_cmp_ic_stat_yield()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::compare< compare< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- ,co::back_off< cds::backoff::yield >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_sht_member_less_pool()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
- void IntrusiveBinTreeHdrTest::EllenBinTree_rcu_sht_member_less_pool_ic_stat()
- {
-#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
- typedef ci::EllenBinTree< rcu_type, key_type, member_value,
- ci::ellen_bintree::make_traits<
- member_hook
- ,ci::ellen_bintree::key_extractor< key_extractor< member_value > >
- ,co::less< less< member_value > >
- ,ci::opt::disposer< disposer< member_value > >
- ,co::node_allocator< cds::memory::pool_allocator< internal_node, ellen_bintree_rcu::internal_node_pool_accessor > >
- ,ci::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator< update_desc, ellen_bintree_rcu::update_desc_pool_accessor > >
- ,co::item_counter< cds::atomicity::item_counter >
- ,co::stat< ci::ellen_bintree::stat<> >
- >::type
- > tree_type;
-
- test_rcu<tree_type, print_stat>();
-#endif
- }
-
-} //namespace tree
+++ /dev/null
-/*
- This file is a part of libcds - Concurrent Data Structures library
-
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
-
- Source code repo: http://github.com/khizmax/libcds/
- Download: http://sourceforge.net/projects/libcds/files/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "tree/hdr_intrusive_bintree.h"
-#include "tree/hdr_intrusive_ellen_bintree_pool_rcu.h"
-#include "tree/hdr_intrusive_ellen_bintree_pool_hp.h"
-#include "tree/hdr_intrusive_ellen_bintree_pool_dhp.h"
-
-#include "tree/hdr_ellenbintree_set.h"
-#include "tree/hdr_ellenbintree_map.h"
-#include "tree/hdr_bronson_avltree_map.h"
-
-namespace tree {
- namespace ellen_bintree_rcu {
- internal_node_pool_type s_InternalNodePool( 1024 * 8 );
- update_desc_pool_type s_UpdateDescPool;
- }
- namespace ellen_bintree_hp {
- internal_node_pool_type s_InternalNodePool( 1024 * 8 );
- update_desc_pool_type s_UpdateDescPool;
- }
- namespace ellen_bintree_dhp {
- internal_node_pool_type s_InternalNodePool( 1024 * 8 );
- update_desc_pool_type s_UpdateDescPool;
- }
-}
-
-
-CPPUNIT_TEST_SUITE_REGISTRATION_(tree::IntrusiveBinTreeHdrTest, s_IntrusiveBinTreeHdrTest);
-CPPUNIT_TEST_SUITE_REGISTRATION_(tree::EllenBinTreeSetHdrTest, s_EllenBinTreeSetHdrTest);
-CPPUNIT_TEST_SUITE_REGISTRATION_(tree::EllenBinTreeMapHdrTest, s_EllenBinTreeMapHdrTest);
-CPPUNIT_TEST_SUITE_REGISTRATION_( tree::BronsonAVLTreeHdrTest, s_BronsonAVLTreeHdrTest );