diff --git a/doc/interprocess.qbk b/doc/interprocess.qbk index 3123486..9a2f2a5 100644 --- a/doc/interprocess.qbk +++ b/doc/interprocess.qbk @@ -512,8 +512,16 @@ POSIX: * Some UNIX systems don't fully support POSIX shared memory objects at all. In those platforms, shared memory is emulated with mapped files created -in the temporary files directory. Because of this emulation, shared memory -has filesystem lifetime in some of those systems. +in a "boost_interprocess" folder created in a temporary files directory. +In Windows platforms, if "Common AppData" key is present +in the registry, "boost_interprocess" folder is created in that directory +(in XP usually "C:\Documents and Settings\All Users\Application Data" and +in Vista "C:\ProgramData"). +For Windows platforms without that registry key and Unix systems, shared memory is +created in the system temporary files directory ("/tmp" or similar). + +Because of this emulation, shared memory has filesystem lifetime in some +of those systems. [endsect] @@ -542,8 +550,8 @@ shared memory object of this name exists (that is, trying to open an object with that name will fail and an object of the same name can be created again). In Windows operating systems, current version supports an usually acceptable emulation -of the UNIX unlink behaviour: the file is randomly renamed and marked as to be deleted when -the last open handle is closed. +of the UNIX unlink behaviour: the file is renamed with a random name and marked as ['to +be deleted when the last open handle is closed]. [endsect] @@ -1289,10 +1297,10 @@ region: A mutex can also be [*recursive] or [*non-recursive]: -* Recursive mutexes can be locked several types by the same thread. To fully unlock the - mutex, the thread has two unlock the mutex the same times it has locked it. +* Recursive mutexes can be locked several times by the same thread. To fully unlock the + mutex, the thread has to unlock the mutex the same times it has locked it. -* Non-recursive mutexes can't be locked several types by the same thread. If a mutex +* Non-recursive mutexes can't be locked several times by the same thread. If a mutex is locked twice by a thread, the result is undefined, it might throw an error or the thread could be blocked forever. @@ -6526,6 +6534,20 @@ warranty. [section:release_notes Release Notes] +[section:release_notes_boost_1_40_00 Boost 1.40 Release] + +* Windows shared memory is created in Shared Documents folder so that it can be shared + between services and processes +* Fixed bugs + [@https://svn.boost.org/trac/boost/ticket/2967 #2967], + [@https://svn.boost.org/trac/boost/ticket/2973 #2973], + [@https://svn.boost.org/trac/boost/ticket/2992 #2992], + [@https://svn.boost.org/trac/boost/ticket/3138 #3138], + [@https://svn.boost.org/trac/boost/ticket/3166 #3166], + [@https://svn.boost.org/trac/boost/ticket/3205 #3205]. + +[endsect] + [section:release_notes_boost_1_39_00 Boost 1.39 Release] * Added experimental `stable_vector` container. diff --git a/proj/to-do.txt b/proj/to-do.txt index 623bd5d..7325836 100644 --- a/proj/to-do.txt +++ b/proj/to-do.txt @@ -49,13 +49,11 @@ -> find a way to pass security attributes to shared memory --> Explain in docs that shared memory can't be used between different users in windows - -> Implement vector with memcpy/memmove for trivially copyable types. -> flat_xxx constructors are not documented --> operator >> eta antzekoek moved_value behar dute +-> operator >> and similar need moved_value -> Add cmath workaround for Boost < 1.37 diff --git a/proj/vc7ide/Interprocess.sln b/proj/vc7ide/Interprocess.sln index c13c8ef..bc16161 100644 --- a/proj/vc7ide/Interprocess.sln +++ b/proj/vc7ide/Interprocess.sln @@ -311,13 +311,139 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_shared_memory", "doc_sh ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_anonymous_conditionA", "doc_anonymous_conditionA.vcproj", "{5C1B8183-0296-4F83-1F22-001005220544}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_anonymous_conditionB", "doc_anonymous_conditionB.vcproj", "{58C1FE83-2906-E643-2F12-024410052254}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_anonymous_mutexA", "doc_anonymous_mutexA.vcproj", "{58C1B183-9026-4E63-12F2-005412200054}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shared_memory_mapping_test", "shared_memory_mappable_test.vcproj", "{5CE18C83-6025-36FE-A4F7-BA09176D3A11}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_anonymous_mutexB", "doc_anonymous_mutexB.vcproj", "{58C1B183-9026-4E63-12F2-005202441254}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_anonymous_semaphoreA", "doc_anonymous_semaphoreA.vcproj", "{5CB81183-29FB-F843-24FF-022050100544}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_anonymous_semaphoreB", "doc_anonymous_semaphoreB.vcproj", "{58FBE8C3-9026-FAB2-E643-000522441254}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_anonymous_upgradable_mutexA", "doc_anonymous_upgradable_mutexA.vcproj", "{5C18831B-F162-FA96-E6C3-FA5122040054}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_anonymous_upgradable_mutexB", "doc_anonymous_upgradable_mutexB.vcproj", "{5C1B1043-1EFF-2793-4E63-245241283054}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_cont", "doc_cont.vcproj", "{58CCE183-6092-48FE-A4F7-BA0D3A792653}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_file_mapping", "doc_file_mapping.vcproj", "{58DE18C3-3261-2F3E-FD47-83760B9FA761}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_message_queueA", "doc_message_queueA.vcproj", "{51B189C3-4E63-9026-12F2-12200AF54054}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_message_queueB", "doc_message_queueB.vcproj", "{5C1B1813-12C2-0296-4E63-244549126520}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_move_containers", "doc_move_containers.vcproj", "{58C1B183-0296-EA42-EF04-005120054104}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "string_test", "string_test.vcproj", "{58CCE183-6092-48FE-A4F7-BA0D4A792607}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tree_test", "tree_test.vcproj", "{58CCE183-6092-48FE-A4F7-BA0D3A792606}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vectorstream_test", "vectorstream_test.vcproj", "{58CCE183-6032-12FE-A4F7-BA893A767601}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "named_upgradable_mutex_test", "named_upgradable_mutex.vcproj", "{48C1FBE8-F7A4-0961-48FE-7D93A63B0A04}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_named_mutex", "doc_named_mutex.vcproj", "{58C181B3-9516-463E-2F12-122155400054}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doc_windows_shared_memory2", "doc_windows_shared_memory2.vcproj", "{5E1D6C83-31DE-4F6F-6132-87A9FB663041}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "flat_map_index_allocation_test", "flat_map_index_allocation_test.vcproj", "{51D8E9C3-2D65-48FE-3AA7-7922C0E36329}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shared_memory_test", "shared_memory_test.vcproj", "{5E2838CC-0916-8F4E-A4F7-93506BA0D310}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shared_ptr_test", "shared_ptr_test.vcproj", "{5371C383-6092-1238-A877-BAEB37867609}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "slist_test", "slist_test.vcproj", "{58CCE183-6092-48FE-A4F7-BA0D3A792608}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unique_ptr_test", "unique_ptr_test.vcproj", "{571C3383-6092-A877-1238-B3786BAE7605}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "upgradable_mutex_test", "upgradable_mutex.vcproj", "{4E88C1C2-0961-F7A4-F48E-A6A7D3B06004}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "user_buffer_test", "user_buffer_test.vcproj", "{58CCE183-6092-48FE-A4F7-BA0D3A792603}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vector_test", "vector_test.vcproj", "{5CE11C83-096A-84FE-4FA2-D3A6BA792002}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "iset_index_allocation_test", "iset_index_allocation_test.vcproj", "{58BD1CC3-6972-F3F7-84BE-0DB736035922}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "iunordered_set_index_allocation_test", "iunordered_set_index_allocation_test.vcproj", "{5BD1C7C3-3F7F-6972-84BE-B731D9236035}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "map_index_allocation_test", "map_index_allocation_test.vcproj", "{588CCD13-2962-83FE-F4B7-92230DB73629}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "named_condition_test", "named_condition_test.vcproj", "{58CC2563-6092-48FE-FAF7-BA046A792658}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug Release = Release EndGlobalSection - GlobalSection(ProjectDependencies) = postSolution - EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {59CEC183-8192-8F6D-4FB7-BA260A79D352}.Debug.ActiveCfg = Debug|Win32 {59CEC183-8192-8F6D-4FB7-BA260A79D352}.Debug.Build.0 = Debug|Win32 @@ -631,6 +757,134 @@ Global {58CCE183-6032-12FE-4FC7-83A79F760B61}.Debug.Build.0 = Debug|Win32 {58CCE183-6032-12FE-4FC7-83A79F760B61}.Release.ActiveCfg = Release|Win32 {58CCE183-6032-12FE-4FC7-83A79F760B61}.Release.Build.0 = Release|Win32 + {5C1B8183-0296-4F83-1F22-001005220544}.Debug.ActiveCfg = Debug|Win32 + {5C1B8183-0296-4F83-1F22-001005220544}.Debug.Build.0 = Debug|Win32 + {5C1B8183-0296-4F83-1F22-001005220544}.Release.ActiveCfg = Release|Win32 + {5C1B8183-0296-4F83-1F22-001005220544}.Release.Build.0 = Release|Win32 + {58C1FE83-2906-E643-2F12-024410052254}.Debug.ActiveCfg = Debug|Win32 + {58C1FE83-2906-E643-2F12-024410052254}.Debug.Build.0 = Debug|Win32 + {58C1FE83-2906-E643-2F12-024410052254}.Release.ActiveCfg = Release|Win32 + {58C1FE83-2906-E643-2F12-024410052254}.Release.Build.0 = Release|Win32 + {58C1B183-9026-4E63-12F2-005412200054}.Debug.ActiveCfg = Debug|Win32 + {58C1B183-9026-4E63-12F2-005412200054}.Debug.Build.0 = Debug|Win32 + {58C1B183-9026-4E63-12F2-005412200054}.Release.ActiveCfg = Release|Win32 + {58C1B183-9026-4E63-12F2-005412200054}.Release.Build.0 = Release|Win32 + {5CE18C83-6025-36FE-A4F7-BA09176D3A11}.Debug.ActiveCfg = Debug|Win32 + {5CE18C83-6025-36FE-A4F7-BA09176D3A11}.Debug.Build.0 = Debug|Win32 + {5CE18C83-6025-36FE-A4F7-BA09176D3A11}.Release.ActiveCfg = Release|Win32 + {5CE18C83-6025-36FE-A4F7-BA09176D3A11}.Release.Build.0 = Release|Win32 + {58C1B183-9026-4E63-12F2-005202441254}.Debug.ActiveCfg = Debug|Win32 + {58C1B183-9026-4E63-12F2-005202441254}.Debug.Build.0 = Debug|Win32 + {58C1B183-9026-4E63-12F2-005202441254}.Release.ActiveCfg = Release|Win32 + {58C1B183-9026-4E63-12F2-005202441254}.Release.Build.0 = Release|Win32 + {5CB81183-29FB-F843-24FF-022050100544}.Debug.ActiveCfg = Debug|Win32 + {5CB81183-29FB-F843-24FF-022050100544}.Debug.Build.0 = Debug|Win32 + {5CB81183-29FB-F843-24FF-022050100544}.Release.ActiveCfg = Release|Win32 + {5CB81183-29FB-F843-24FF-022050100544}.Release.Build.0 = Release|Win32 + {58FBE8C3-9026-FAB2-E643-000522441254}.Debug.ActiveCfg = Debug|Win32 + {58FBE8C3-9026-FAB2-E643-000522441254}.Debug.Build.0 = Debug|Win32 + {58FBE8C3-9026-FAB2-E643-000522441254}.Release.ActiveCfg = Release|Win32 + {58FBE8C3-9026-FAB2-E643-000522441254}.Release.Build.0 = Release|Win32 + {5C18831B-F162-FA96-E6C3-FA5122040054}.Debug.ActiveCfg = Debug|Win32 + {5C18831B-F162-FA96-E6C3-FA5122040054}.Debug.Build.0 = Debug|Win32 + {5C18831B-F162-FA96-E6C3-FA5122040054}.Release.ActiveCfg = Release|Win32 + {5C18831B-F162-FA96-E6C3-FA5122040054}.Release.Build.0 = Release|Win32 + {5C1B1043-1EFF-2793-4E63-245241283054}.Debug.ActiveCfg = Debug|Win32 + {5C1B1043-1EFF-2793-4E63-245241283054}.Debug.Build.0 = Debug|Win32 + {5C1B1043-1EFF-2793-4E63-245241283054}.Release.ActiveCfg = Release|Win32 + {5C1B1043-1EFF-2793-4E63-245241283054}.Release.Build.0 = Release|Win32 + {58CCE183-6092-48FE-A4F7-BA0D3A792653}.Debug.ActiveCfg = Debug|Win32 + {58CCE183-6092-48FE-A4F7-BA0D3A792653}.Debug.Build.0 = Debug|Win32 + {58CCE183-6092-48FE-A4F7-BA0D3A792653}.Release.ActiveCfg = Release|Win32 + {58CCE183-6092-48FE-A4F7-BA0D3A792653}.Release.Build.0 = Release|Win32 + {58DE18C3-3261-2F3E-FD47-83760B9FA761}.Debug.ActiveCfg = Debug|Win32 + {58DE18C3-3261-2F3E-FD47-83760B9FA761}.Debug.Build.0 = Debug|Win32 + {58DE18C3-3261-2F3E-FD47-83760B9FA761}.Release.ActiveCfg = Release|Win32 + {58DE18C3-3261-2F3E-FD47-83760B9FA761}.Release.Build.0 = Release|Win32 + {51B189C3-4E63-9026-12F2-12200AF54054}.Debug.ActiveCfg = Debug|Win32 + {51B189C3-4E63-9026-12F2-12200AF54054}.Debug.Build.0 = Debug|Win32 + {51B189C3-4E63-9026-12F2-12200AF54054}.Release.ActiveCfg = Release|Win32 + {51B189C3-4E63-9026-12F2-12200AF54054}.Release.Build.0 = Release|Win32 + {5C1B1813-12C2-0296-4E63-244549126520}.Debug.ActiveCfg = Debug|Win32 + {5C1B1813-12C2-0296-4E63-244549126520}.Debug.Build.0 = Debug|Win32 + {5C1B1813-12C2-0296-4E63-244549126520}.Release.ActiveCfg = Release|Win32 + {5C1B1813-12C2-0296-4E63-244549126520}.Release.Build.0 = Release|Win32 + {58C1B183-0296-EA42-EF04-005120054104}.Debug.ActiveCfg = Debug|Win32 + {58C1B183-0296-EA42-EF04-005120054104}.Debug.Build.0 = Debug|Win32 + {58C1B183-0296-EA42-EF04-005120054104}.Release.ActiveCfg = Release|Win32 + {58C1B183-0296-EA42-EF04-005120054104}.Release.Build.0 = Release|Win32 + {58CCE183-6092-48FE-A4F7-BA0D4A792607}.Debug.ActiveCfg = Debug|Win32 + {58CCE183-6092-48FE-A4F7-BA0D4A792607}.Debug.Build.0 = Debug|Win32 + {58CCE183-6092-48FE-A4F7-BA0D4A792607}.Release.ActiveCfg = Release|Win32 + {58CCE183-6092-48FE-A4F7-BA0D4A792607}.Release.Build.0 = Release|Win32 + {58CCE183-6092-48FE-A4F7-BA0D3A792606}.Debug.ActiveCfg = Debug|Win32 + {58CCE183-6092-48FE-A4F7-BA0D3A792606}.Debug.Build.0 = Debug|Win32 + {58CCE183-6092-48FE-A4F7-BA0D3A792606}.Release.ActiveCfg = Release|Win32 + {58CCE183-6092-48FE-A4F7-BA0D3A792606}.Release.Build.0 = Release|Win32 + {58CCE183-6032-12FE-A4F7-BA893A767601}.Debug.ActiveCfg = Debug|Win32 + {58CCE183-6032-12FE-A4F7-BA893A767601}.Debug.Build.0 = Debug|Win32 + {58CCE183-6032-12FE-A4F7-BA893A767601}.Release.ActiveCfg = Release|Win32 + {58CCE183-6032-12FE-A4F7-BA893A767601}.Release.Build.0 = Release|Win32 + {48C1FBE8-F7A4-0961-48FE-7D93A63B0A04}.Debug.ActiveCfg = Debug|Win32 + {48C1FBE8-F7A4-0961-48FE-7D93A63B0A04}.Debug.Build.0 = Debug|Win32 + {48C1FBE8-F7A4-0961-48FE-7D93A63B0A04}.Release.ActiveCfg = Release|Win32 + {48C1FBE8-F7A4-0961-48FE-7D93A63B0A04}.Release.Build.0 = Release|Win32 + {58C181B3-9516-463E-2F12-122155400054}.Debug.ActiveCfg = Debug|Win32 + {58C181B3-9516-463E-2F12-122155400054}.Debug.Build.0 = Debug|Win32 + {58C181B3-9516-463E-2F12-122155400054}.Release.ActiveCfg = Release|Win32 + {58C181B3-9516-463E-2F12-122155400054}.Release.Build.0 = Release|Win32 + {5E1D6C83-31DE-4F6F-6132-87A9FB663041}.Debug.ActiveCfg = Debug|Win32 + {5E1D6C83-31DE-4F6F-6132-87A9FB663041}.Debug.Build.0 = Debug|Win32 + {5E1D6C83-31DE-4F6F-6132-87A9FB663041}.Release.ActiveCfg = Release|Win32 + {5E1D6C83-31DE-4F6F-6132-87A9FB663041}.Release.Build.0 = Release|Win32 + {51D8E9C3-2D65-48FE-3AA7-7922C0E36329}.Debug.ActiveCfg = Debug|Win32 + {51D8E9C3-2D65-48FE-3AA7-7922C0E36329}.Debug.Build.0 = Debug|Win32 + {51D8E9C3-2D65-48FE-3AA7-7922C0E36329}.Release.ActiveCfg = Release|Win32 + {51D8E9C3-2D65-48FE-3AA7-7922C0E36329}.Release.Build.0 = Release|Win32 + {5E2838CC-0916-8F4E-A4F7-93506BA0D310}.Debug.ActiveCfg = Debug|Win32 + {5E2838CC-0916-8F4E-A4F7-93506BA0D310}.Debug.Build.0 = Debug|Win32 + {5E2838CC-0916-8F4E-A4F7-93506BA0D310}.Release.ActiveCfg = Release|Win32 + {5E2838CC-0916-8F4E-A4F7-93506BA0D310}.Release.Build.0 = Release|Win32 + {5371C383-6092-1238-A877-BAEB37867609}.Debug.ActiveCfg = Debug|Win32 + {5371C383-6092-1238-A877-BAEB37867609}.Debug.Build.0 = Debug|Win32 + {5371C383-6092-1238-A877-BAEB37867609}.Release.ActiveCfg = Release|Win32 + {5371C383-6092-1238-A877-BAEB37867609}.Release.Build.0 = Release|Win32 + {58CCE183-6092-48FE-A4F7-BA0D3A792608}.Debug.ActiveCfg = Debug|Win32 + {58CCE183-6092-48FE-A4F7-BA0D3A792608}.Debug.Build.0 = Debug|Win32 + {58CCE183-6092-48FE-A4F7-BA0D3A792608}.Release.ActiveCfg = Release|Win32 + {58CCE183-6092-48FE-A4F7-BA0D3A792608}.Release.Build.0 = Release|Win32 + {571C3383-6092-A877-1238-B3786BAE7605}.Debug.ActiveCfg = Debug|Win32 + {571C3383-6092-A877-1238-B3786BAE7605}.Debug.Build.0 = Debug|Win32 + {571C3383-6092-A877-1238-B3786BAE7605}.Release.ActiveCfg = Release|Win32 + {571C3383-6092-A877-1238-B3786BAE7605}.Release.Build.0 = Release|Win32 + {4E88C1C2-0961-F7A4-F48E-A6A7D3B06004}.Debug.ActiveCfg = Debug|Win32 + {4E88C1C2-0961-F7A4-F48E-A6A7D3B06004}.Debug.Build.0 = Debug|Win32 + {4E88C1C2-0961-F7A4-F48E-A6A7D3B06004}.Release.ActiveCfg = Release|Win32 + {4E88C1C2-0961-F7A4-F48E-A6A7D3B06004}.Release.Build.0 = Release|Win32 + {58CCE183-6092-48FE-A4F7-BA0D3A792603}.Debug.ActiveCfg = Debug|Win32 + {58CCE183-6092-48FE-A4F7-BA0D3A792603}.Debug.Build.0 = Debug|Win32 + {58CCE183-6092-48FE-A4F7-BA0D3A792603}.Release.ActiveCfg = Release|Win32 + {58CCE183-6092-48FE-A4F7-BA0D3A792603}.Release.Build.0 = Release|Win32 + {5CE11C83-096A-84FE-4FA2-D3A6BA792002}.Debug.ActiveCfg = Debug|Win32 + {5CE11C83-096A-84FE-4FA2-D3A6BA792002}.Debug.Build.0 = Debug|Win32 + {5CE11C83-096A-84FE-4FA2-D3A6BA792002}.Release.ActiveCfg = Release|Win32 + {5CE11C83-096A-84FE-4FA2-D3A6BA792002}.Release.Build.0 = Release|Win32 + {58BD1CC3-6972-F3F7-84BE-0DB736035922}.Debug.ActiveCfg = Debug|Win32 + {58BD1CC3-6972-F3F7-84BE-0DB736035922}.Debug.Build.0 = Debug|Win32 + {58BD1CC3-6972-F3F7-84BE-0DB736035922}.Release.ActiveCfg = Release|Win32 + {58BD1CC3-6972-F3F7-84BE-0DB736035922}.Release.Build.0 = Release|Win32 + {5BD1C7C3-3F7F-6972-84BE-B731D9236035}.Debug.ActiveCfg = Debug|Win32 + {5BD1C7C3-3F7F-6972-84BE-B731D9236035}.Debug.Build.0 = Debug|Win32 + {5BD1C7C3-3F7F-6972-84BE-B731D9236035}.Release.ActiveCfg = Release|Win32 + {5BD1C7C3-3F7F-6972-84BE-B731D9236035}.Release.Build.0 = Release|Win32 + {588CCD13-2962-83FE-F4B7-92230DB73629}.Debug.ActiveCfg = Debug|Win32 + {588CCD13-2962-83FE-F4B7-92230DB73629}.Debug.Build.0 = Debug|Win32 + {588CCD13-2962-83FE-F4B7-92230DB73629}.Release.ActiveCfg = Release|Win32 + {588CCD13-2962-83FE-F4B7-92230DB73629}.Release.Build.0 = Release|Win32 + {58CC2563-6092-48FE-FAF7-BA046A792658}.Debug.ActiveCfg = Debug|Win32 + {58CC2563-6092-48FE-FAF7-BA046A792658}.Debug.Build.0 = Debug|Win32 + {58CC2563-6092-48FE-FAF7-BA046A792658}.Release.ActiveCfg = Release|Win32 + {58CC2563-6092-48FE-FAF7-BA046A792658}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection diff --git a/test/vectorstream_test.cpp b/test/vectorstream_test.cpp index 8ec7bf8..efec5a5 100644 --- a/test/vectorstream_test.cpp +++ b/test/vectorstream_test.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -23,13 +24,32 @@ using namespace boost::interprocess; //Force instantiations to catch compile-time errors -typedef basic_vectorstream > my_stringstream_t; typedef basic_string my_string; +typedef basic_vectorstream my_stringstream_t; +typedef vector my_vector; +typedef basic_vectorstream my_vectorstream_t; template class basic_vectorstream; template class basic_vectorstream >; static int vectorstream_test() { + { //Test high watermarking initialization + my_stringstream_t my_stringstream; + int a (0); + my_stringstream << 11; + my_stringstream >> a; + if(a != 11) + return 1; + } + { //Test high watermarking initialization + my_vectorstream_t my_stringstream; + int a (0); + my_stringstream << 13; + my_stringstream >> a; + if(a != 13) + return 1; + } + //Pre-reserved string { my_stringstream_t my_stringstream; @@ -42,7 +62,7 @@ static int vectorstream_test() my_stringstream << "testline: " << i << std::endl; std_stringstream << "testline: " << i << std::endl; } - + if(std::strcmp(my_stringstream.vector().c_str(), std_stringstream.str().c_str()) != 0){ return 1; } @@ -114,15 +134,39 @@ static int vectorstream_test() } } } + + //Test seek + { + my_stringstream_t my_stringstream; + my_stringstream << "ABCDEFGHIJKLM"; + my_stringstream.seekp(0); + my_stringstream << "PQRST"; + string s("PQRSTFGHIJKLM"); + if(s != my_stringstream.vector()){ + return 1; + } + my_stringstream.seekp(0, std::ios_base::end); + my_stringstream << "NOPQRST"; + s ="PQRSTFGHIJKLMNOPQRST"; + if(s != my_stringstream.vector()){ + return 1; + } + int size = static_cast(my_stringstream.vector().size()); + my_stringstream.seekp(-size, std::ios_base::cur); + my_stringstream << "ABCDE"; + s ="ABCDEFGHIJKLMNOPQRST"; + if(s != my_stringstream.vector()){ + return 1; + } + } return 0; } int main () { - if(vectorstream_test()==-1){ + if(vectorstream_test()){ return 1; } - return 0; }