diff --git a/BeastConfig.h b/BeastConfig.h index 2fd855f78e..6c63d43cdd 100644 --- a/BeastConfig.h +++ b/BeastConfig.h @@ -1,6 +1,24 @@ +//------------------------------------------------------------------------------ +/* + This file is part of Beast: https://github.com/vinniefalco/Beast + Copyright 2013, Vinnie Falco -#ifndef BEAST_BEASTCONFIG_HEADER -#define BEAST_BEASTCONFIG_HEADER + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#ifndef BEAST_BEASTCONFIG_H_INCLUDED +#define BEAST_BEASTCONFIG_H_INCLUDED // beast_core flags: @@ -22,7 +40,7 @@ // beast_basics flags -#define BEAST_USE_BOOST 1 +#define BEAST_BOOST_IS_AVAILABLE 1 #ifndef BEAST_USE_LEAKCHECKED #define BEAST_USE_LEAKCHECKED BEAST_CHECK_MEMORY_LEAKS diff --git a/Builds/VisualStudio2012/Ripple.sln b/Builds/VisualStudio2012/Ripple.sln index 5995866ca7..0d2854aef6 100644 --- a/Builds/VisualStudio2012/Ripple.sln +++ b/Builds/VisualStudio2012/Ripple.sln @@ -23,10 +23,10 @@ Global {19465545-42EE-42FA-9CC8-F8975F8F1CC7}.Release|x64.Build.0 = Release|x64 {73C5A0F0-7629-4DE7-9194-BE7AC6C19535}.Debug|Win32.ActiveCfg = Debug|Win32 {73C5A0F0-7629-4DE7-9194-BE7AC6C19535}.Debug|Win32.Build.0 = Debug|Win32 - {73C5A0F0-7629-4DE7-9194-BE7AC6C19535}.Debug|x64.ActiveCfg = Debug|Win32 + {73C5A0F0-7629-4DE7-9194-BE7AC6C19535}.Debug|x64.ActiveCfg = Debug|x64 {73C5A0F0-7629-4DE7-9194-BE7AC6C19535}.Release|Win32.ActiveCfg = Release|Win32 {73C5A0F0-7629-4DE7-9194-BE7AC6C19535}.Release|Win32.Build.0 = Release|Win32 - {73C5A0F0-7629-4DE7-9194-BE7AC6C19535}.Release|x64.ActiveCfg = Release|Win32 + {73C5A0F0-7629-4DE7-9194-BE7AC6C19535}.Release|x64.ActiveCfg = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Subtrees/beast/Builds/VisualStudio2012/Beast.props b/Subtrees/beast/Builds/VisualStudio2012/Beast.props new file mode 100644 index 0000000000..ce63ed7590 --- /dev/null +++ b/Subtrees/beast/Builds/VisualStudio2012/Beast.props @@ -0,0 +1,12 @@ + + + + + + + + Level4 + + + + \ No newline at end of file diff --git a/Subtrees/beast/Builds/VisualStudio2012/BeastConfig.h b/Subtrees/beast/Builds/VisualStudio2012/BeastConfig.h index fa8485557a..42cf4e65c5 100644 --- a/Subtrees/beast/Builds/VisualStudio2012/BeastConfig.h +++ b/Subtrees/beast/Builds/VisualStudio2012/BeastConfig.h @@ -17,31 +17,87 @@ */ //============================================================================== -#ifndef BEAST_BEASTCONFIG_HEADER -#define BEAST_BEASTCONFIG_HEADER +#ifndef BEAST_BEASTCONFIG_H_INCLUDED +#define BEAST_BEASTCONFIG_H_INCLUDED -// beast_core flags: +//------------------------------------------------------------------------------ -#ifndef BEAST_FORCE_DEBUG - //#define BEAST_FORCE_DEBUG +/** Config: BEAST_FORCE_DEBUG + + Normally, BEAST_DEBUG is set to 1 or 0 based on compiler and project + settings, but if you define this value, you can override this to force it + to be true or false. +*/ +#ifndef BEAST_FORCE_DEBUG +//#define BEAST_FORCE_DEBUG 0 #endif -#ifndef BEAST_LOG_ASSERTIONS - //#define BEAST_LOG_ASSERTIONS 1 +//------------------------------------------------------------------------------ + +/** Config: BEAST_LOG_ASSERTIONS + + If this flag is enabled, the the bassert and bassertfalse macros will always + use Logger::writeToLog() to write a message when an assertion happens. + + Enabling it will also leave this turned on in release builds. When it's + disabled, however, the bassert and bassertfalse macros will not be compiled + in a release build. + + @see bassert, bassertfalse, Logger +*/ +#ifndef BEAST_LOG_ASSERTIONS +//#define BEAST_LOG_ASSERTIONS 0 #endif -#ifndef BEAST_CHECK_MEMORY_LEAKS - //#define BEAST_CHECK_MEMORY_LEAKS +//------------------------------------------------------------------------------ + +/** Config: BEAST_CHECK_MEMORY_LEAKS + + Enables a memory-leak check for certain objects when the app terminates. + See the LeakedObjectDetector and LeakChecked classes, and the + BEAST_LEAK_DETECTOR macro for more details about enabling leak checking for + specific classes. +*/ +#ifndef BEAST_CHECK_MEMORY_LEAKS +//#define BEAST_CHECK_MEMORY_LEAKS 1 #endif -#ifndef BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES - //#define BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES +//------------------------------------------------------------------------------ + +/** Config: BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES + + In a Visual C++ build, this can be used to stop the required system libs + being automatically added to the link stage. +*/ +#ifndef BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES +//#define BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES 1 #endif +//------------------------------------------------------------------------------ + +/** Config: BEAST_INCLUDE_ZLIB_CODE + + This can be used to disable Beast's embedded 3rd-party zlib code. + You might need to tweak this if you're linking to an external zlib library in your app, + but for normal apps, this option should be left alone. + + If you disable this, you might also want to set a value for BEAST_ZLIB_INCLUDE_PATH, to + specify the path where your zlib headers live. +*/ +#ifndef BEAST_INCLUDE_ZLIB_CODE +//#define BEAST_INCLUDE_ZLIB_CODE 0 +#endif + +#ifndef BEAST_ZLIB_INCLUDE_PATH +#define BEAST_ZLIB_INCLUDE_PATH +#endif + +//------------------------------------------------------------------------------ + // beast_basics flags -#ifndef BEAST_USE_BOOST -#define BEAST_USE_BOOST 0 +#ifndef BEAST_BOOST_IS_AVAILABLE +#define BEAST_BOOST_IS_AVAILABLE 0 #endif // Choose one to override default for platform @@ -50,7 +106,7 @@ //#define BEAST_BIND_USES_BOOST 1 #ifndef BEAST_USE_LEAKCHECKED -#define BEAST_USE_LEAKCHECKED BEAST_CHECK_MEMORY_LEAKS +#define BEAST_USE_LEAKCHECKED 1 #endif #endif diff --git a/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj b/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj index 5872be2984..195335e405 100644 --- a/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj +++ b/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj @@ -5,10 +5,18 @@ Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + @@ -18,68 +26,59 @@ true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true - - - - - - - - - - - - - - - - - - - - - @@ -91,7 +90,6 @@ - @@ -102,14 +100,25 @@ + + + + + + + + + + + @@ -117,6 +126,7 @@ + @@ -126,15 +136,22 @@ + + + + + + + @@ -184,6 +201,7 @@ + @@ -216,452 +234,658 @@ true + true true - - - true - true - - - true - true - - - true - true - - - true - true + true true + true true - - - true - true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true - - - true - true + true true + true true - - - true - true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + + + true + true + true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true true + true @@ -676,6 +900,12 @@ v110 Unicode + + StaticLibrary + true + v110 + Unicode + StaticLibrary false @@ -683,14 +913,31 @@ true Unicode + + StaticLibrary + false + v110 + true + Unicode + + + + + + + + + + + @@ -698,7 +945,19 @@ - Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + $(ProjectDir) + + + Windows + true + + + + + + Disabled WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) $(ProjectDir) @@ -710,7 +969,23 @@ - Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + $(ProjectDir) + + + Windows + true + true + true + + + + MaxSpeed diff --git a/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj.filters b/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj.filters index 5a57fbb7e9..99d27f2677 100644 --- a/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj.filters +++ b/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj.filters @@ -95,9 +95,6 @@ {e3a8f3eb-7f0f-4b81-b978-0dd0823f583b} - - {3e9389c0-c8f0-4657-ab11-cbbea889d3be} - {ba11b980-76dd-49a4-b2c7-878e9f08f8ce} @@ -119,6 +116,12 @@ {f58dddf7-fe43-49a2-8e57-91feba586119} + + {b70d6403-2d7a-4377-81ff-390830ab0276} + + + {69e28551-92ea-420b-a465-75ed248e3b59} + @@ -473,51 +476,12 @@ beast_basics - - beast_basics\containers - - - beast_basics\containers - - - beast_basics\containers - - - beast_basics\containers - - - beast_basics\containers - beast_basics\diagnostic - - beast_basics\diagnostic - - - beast_basics\diagnostic - - - beast_basics\diagnostic - - - beast_basics\diagnostic - - - beast_basics\diagnostic - - - beast_basics\diagnostic - beast_basics\events - - beast_basics\events - - - beast_basics\functor - beast_basics\functor @@ -533,21 +497,6 @@ beast_basics\memory - - beast_basics\memory - - - beast_basics\memory - - - beast_basics\memory - - - beast_basics\memory - - - beast_basics\memory - beast_basics\memory @@ -563,21 +512,12 @@ beast_basics\memory - - beast_basics\memory - beast_basics\memory beast_basics\memory - - beast_basics\memory - - - beast_basics\memory - beast_basics\threads @@ -611,15 +551,72 @@ beast_basics\threads - - beast_basics\threads - beast_basics\threads beast_basics\threads + + beast_core\containers + + + beast_core\functional + + + beast_core\memory + + + beast_core\memory + + + beast_core\memory + + + beast_core\memory + + + beast_core\memory + + + beast_core\memory + + + beast_core\containers + + + beast_core\containers + + + beast_core\threads + + + beast_core\memory + + + beast_core\containers + + + beast_core\containers + + + beast_core\diagnostic + + + beast_core\diagnostic + + + beast_core\diagnostic + + + beast_core\diagnostic + + + beast_core\diagnostic + + + beast_core\diagnostic + @@ -877,24 +874,9 @@ beast_basics\diagnostic - - beast_basics\diagnostic - - - beast_basics\diagnostic - - - beast_basics\diagnostic - - - beast_basics\diagnostic - beast_basics\events - - beast_basics\events - beast_basics\math @@ -913,15 +895,9 @@ beast_basics\native - - beast_basics\native - beast_basics\native - - beast_basics\native - beast_basics\threads @@ -964,5 +940,17 @@ beast_core\native + + beast_core\diagnostic + + + beast_core\diagnostic + + + beast_core\diagnostic + + + beast_core\diagnostic + \ No newline at end of file diff --git a/Subtrees/beast/modules/beast_basics/beast_basics.cpp b/Subtrees/beast/modules/beast_basics/beast_basics.cpp index f366a436ad..ef990ae610 100644 --- a/Subtrees/beast/modules/beast_basics/beast_basics.cpp +++ b/Subtrees/beast/modules/beast_basics/beast_basics.cpp @@ -41,27 +41,17 @@ namespace beast { #include "diagnostic/beast_CatchAny.cpp" -#include "diagnostic/beast_Debug.cpp" -#include "diagnostic/beast_Error.cpp" -#include "diagnostic/beast_FPUFlags.cpp" -#include "diagnostic/beast_LeakChecked.cpp" #include "events/beast_OncePerSecond.cpp" -#include "events/beast_PerformedAtExit.cpp" #include "math/beast_MurmurHash.cpp" #include "threads/beast_InterruptibleThread.cpp" #include "threads/beast_Semaphore.cpp" - -#if BEAST_USE_BOOST #include "memory/beast_FifoFreeStoreWithTLS.cpp" -#else #include "memory/beast_FifoFreeStoreWithoutTLS.cpp" -#endif #include "memory/beast_GlobalPagedFreeStore.cpp" #include "memory/beast_PagedFreeStore.cpp" - #include "threads/beast_CallQueue.cpp" #include "threads/beast_ConcurrentObject.cpp" #include "threads/beast_Listeners.cpp" @@ -74,11 +64,9 @@ namespace beast #if BEAST_WINDOWS #include "native/beast_win32_FPUFlags.cpp" -#include "native/beast_win32_Threads.cpp" #else #include "native/beast_posix_FPUFlags.cpp" -#include "native/beast_posix_Threads.cpp" #endif } @@ -86,21 +74,3 @@ namespace beast #if BEAST_MSVC #pragma warning (pop) #endif - -//------------------------------------------------------------------------------ - -#if BEAST_USE_BOOST -namespace boost { -namespace placeholders { -boost::arg<1> _1; -boost::arg<2> _2; -boost::arg<3> _3; -boost::arg<4> _4; -boost::arg<5> _5; -boost::arg<6> _6; -boost::arg<7> _7; -boost::arg<8> _8; -boost::arg<9> _9; -} -} -#endif diff --git a/Subtrees/beast/modules/beast_basics/beast_basics.h b/Subtrees/beast/modules/beast_basics/beast_basics.h index ec08e90d8c..5ab2fb0b82 100644 --- a/Subtrees/beast/modules/beast_basics/beast_basics.h +++ b/Subtrees/beast/modules/beast_basics/beast_basics.h @@ -23,330 +23,214 @@ @ingroup beast_basics */ -#ifndef BEAST_BASICS_BEASTHEADER -#define BEAST_BASICS_BEASTHEADER +#ifndef BEAST_BASICS_H_INCLUDED +#define BEAST_BASICS_H_INCLUDED -//============================================================================== +//------------------------------------------------------------------------------ + +/* If you fail to make sure that all your compile units are building Beast with + the same set of option flags, then there's a risk that different compile + units will treat the classes as having different memory layouts, leading to + very nasty memory corruption errors when they all get linked together. + That's why it's best to always include the BeastConfig.h file before any + beast headers. +*/ +#ifndef BEAST_BEASTCONFIG_H_INCLUDED +# ifdef _MSC_VER +# pragma message ("Have you included your BeastConfig.h file before including the Beast headers?") +# else +# warning "Have you included your BeastConfig.h file before including the Beast headers?" +# endif +#endif + +//------------------------------------------------------------------------------ /** - @mainpage Beast: A multipurpose library using parts of JUCE. - ### Version 1.1 +@mainpage Beast: A C++ library for server development. - Copyright (C) 2008 by Vinnie Falco \ ([e-mail][0]) +### Version 1.0 - Beast is a source code collection of individual modules containing - functionality for a variety of applications, with an emphasis on building - concurrent systems. Beast requires [JUCE][3] (Jules' Utility Class - Extensions), available from [Raw Material Software][4]. JUCE is available - under both the [GNU General Public License][5] and a [commercial license][6]. - Other than JUCE, Beast has no external dependencies. +Copyright 2008, 2013 by Vinnie Falco \ ([e-mail][0]) - Beast is hosted on Github at [https://github.com/vinniefalco/Beast][1] +Beast is a source code collection of individual modules containing +functionality for a variety of applications, with an emphasis on building +concurrent systems. Beast incorporates parts of [JUCE][3] (Jules' Utility +Class Extensions), available from [Raw Material Software][4]. Beast has no +external dependencies - The online documentation is at [http://vinniefalco.github.com/Beast][2] +Beast is hosted on Github at [https://github.com/vinniefalco/Beast][1] - ## Platforms +The online documentation is at [http://vinniefalco.github.com/Beast][2] - All platforms supported by JUCE are also supported by Beast. Currently these - platforms include: +## Platforms - - **Windows**: Applications and VST/RTAS/NPAPI/ActiveX plugins can be built - using MS Visual Studio. The results are all fully compatible with Windows - XP, Vista or Windows 7. +All platforms supported by JUCE are also supported by Beast. Currently these +platforms include: - - **Mac OS X**: Applications and VST/AudioUnit/RTAS/NPAPI plugins with Xcode. +- **Windows**: Applications and VST/RTAS/NPAPI/ActiveX plugins can be built +using MS Visual Studio. The results are all fully compatible with Windows +XP, Vista or Windows 7. - - **GNU/Linux**: Applications and plugins can be built for any kernel 2.6 or - later. +- **Mac OS X**: Applications and VST/AudioUnit/RTAS/NPAPI plugins with Xcode. - - **iOS**: Native iPhone and iPad apps. +- **GNU/Linux**: Applications and plugins can be built for any kernel 2.6 or +later. - - **Android**: Supported. +- **FreeBSD**: Kernel version 8.4 or higher required. - ## Prerequisites +- **iOS**: Native iPhone and iPad apps. - This documentation assumes that the reader has a working knowledge of JUCE. - Some modules built on external libraries assume that the reader understands - the operation of those external libraries. Certain modules assume that the - reader understands additional domain-specific information. Modules with - additional prerequisites are marked in the documentation. +- **Android**: Supported. - ## External Modules +## Prerequisites - Some modules bring in functionality provided by external libraries. For - example, the @ref beast_bzip2 module provides the compression and decompression - algorithms in [bZip2][7]. Usage of these external library modules is optional. - They come with complete source code, as well as options for using either - system or user provided variants of the external libraries: it is not - necessary to download additional source code packages to use these modules. +This documentation assumes that the reader has a working knowledge of JUCE. +Some modules built on external libraries assume that the reader understands +the operation of those external libraries. Certain modules assume that the +reader understands additional domain-specific information. Modules with +additional prerequisites are marked in the documentation. - External code incorporated into Beast is covered by separate licenses. See - the licensing information and notes in the corresponding source files for - copyright information and terms of use. +## External Modules - ## Integration +Some modules bring in functionality provided by external libraries. For +example, the @ref beast_bzip2 module provides the compression and decompression +algorithms in [bZip2][7]. Usage of these external library modules is optional. +They come with complete source code, as well as options for using either +system or user provided variants of the external libraries: it is not +necessary to download additional source code packages to use these modules. - Beast requires recent versions of JUCE. It won't work with versions 1.53 or - earlier. To use the library it is necessary to first download JUCE to a - location where your development environment can find it. Or, you can use your - existing installation of JUCE. +External code incorporated into Beast is covered by separate licenses. See +the licensing information and notes in the corresponding source files for +copyright information and terms of use. - This library uses the same modularized organizational structure as JUCE. To - use a module, first add a path to the list of includes searched by your - development environment or project, which points to the Beast directory. Then, - add the single corresponding .c or .cpp file to your existing project which - already uses JUCE. For example, to use the @ref beast_core module, add the file - beast_core.cpp to your project. Some modules depend on other modules. +## Integration - To use a module, include the appropriate header from within your source code. - For example, to access classes in the @ref beast_concurrent module, use this: +Beast requires recent versions of JUCE. It won't work with versions 1.53 or +earlier. To use the library it is necessary to first download JUCE to a +location where your development environment can find it. Or, you can use your +existing installation of JUCE. - @code +This library uses the same modularized organizational structure as JUCE. To +use a module, first add a path to the list of includes searched by your +development environment or project, which points to the Beast directory. Then, +add the single corresponding .c or .cpp file to your existing project which +already uses JUCE. For example, to use the @ref beast_core module, add the file +beast_core.cpp to your project. Some modules depend on other modules. - #include "modules/beast_concurrent/beast_concurrent.h" +To use a module, include the appropriate header from within your source code. +For example, to access classes in the @ref beast_concurrent module, use this: - @endcode +@code - Then add the corresponding file beast_concurrent.cpp to your build. +#include "modules/beast_concurrent/beast_concurrent.h" - ## AppConfig +@endcode - Some Beast features can be controlled at compilation time through - preprocessor directives. The available choices of compilation options are - described in AppConfig.h, located in the AppConfigTemplate directory. Copy - the provided settings into your existing AppConfig.h (a file used by JUCE - convention). +Then add the corresponding file beast_concurrent.cpp to your build. - ## License +## AppConfig - This library contains portions of other open source products covered by - separate licenses. Please see the corresponding source files for specific - terms. +Some Beast features can be controlled at compilation time through +preprocessor directives. The available choices of compilation options are +described in AppConfig.h, located in the AppConfigTemplate directory. Copy +the provided settings into your existing AppConfig.h (a file used by JUCE +convention). - Beast is provided under the terms of The MIT License (MIT): +## License - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: +This library contains portions of other open source products covered by +separate licenses. Please see the corresponding source files for specific +terms. - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. +Beast is provided under the terms of The ISC License: - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. - Some files contain portions of these external projects, licensed separately: +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - [bZip2][7] is Copyright (C) 1996-2010 Julian R Seward. All rights +Some files contain portions of these external projects, licensed separately: + +- [bZip2][7] is Copyright (C) 1996-2010 Julian R Seward. All rights reserved. See the corresponding file LICENSE for licensing terms. - - Portions of the software are Copyright (C) 1996-2001, 2006 by [The FreeType - Project][8]. All rights reserved. [FreeType][8] is distributed - under both the [GNU General Public License][5], or the - [FreeType License][9]. - - - Portions of this software are Copyright (C) 1994-2012 [Lua.org][10], PUC-Rio. - Lua is distributed under the terms of the [MIT License][11]. - - - [Luabridge][12] is Copyright (C) 2012 by Vinnie Falco and Copyrighted (C) - 2007 by Nathan Reed. [Luabridge][12] is distributed under the terms of the - [MIT License][11]. - - - [Soci][13] is Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton, and +- [Soci][13] is Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton, and various others noted in the corresponding source files. Soci is distributed under the [Boost Software License, Version 1.0][14]. - - [SQLite][15], placed in the public domain. +- [SQLite][15], placed in the public domain. - - [TagLib][16] is distributed under both the [GNU Lesser General Public License, - Version 2.1][17] and the [Mozilla Public License][18]. +[0]: mailto:vinnie.falco@gmail.com "Vinnie Falco (Email)" +[1]: https://github.com/vinniefalco/Beast "Beast Project" +[2]: http://vinniefalco.github.com/Beast/ "Beast Documentation" +[3]: http://rawmaterialsoftware.com/juce.php "JUCE" +[4]: http://rawmaterialsoftware.com/ "Raw Material Software" +[5]: http://www.gnu.org/licenses/gpl-2.0.html "GNU General Public License, version 2" +[6]: http://rawmaterialsoftware.com/jucelicense.php "JUCE Licenses" +[7]: http://www.bzip.org/ "bZip2: Home" +[8]: http://freetype.org/ "The FreeType Project" +[9]: http://www.freetype.org/FTL.TXT "The FreeType Project License" +[10]: http://www.lua.org/ "The Programming Language Lua" +[11]: http://opensource.org/licenses/ISC "The ISC License" +[12]: https://github.com/vinniefalco/LuaBridge +[13]: http://soci.sourceforge.net/ "SOCI" +[14]: http://www.boost.org/LICENSE_1_0.txt "Boost Software License, Version 1.0" +[15]: http://sqlite.org/ "SQLite Home Page" +[16]: http://developer.kde.org/~wheeler/taglib.html "TagLib" +[17]: http://www.gnu.org/licenses/lgpl-2.1.html "Gnu Lesser General Public License, version 2.1" +[18]: http://www.mozilla.org/MPL/1.1/ "Mozilla Public License" - [0]: mailto:vinnie.falco@gmail.com "Vinnie Falco (Email)" - [1]: https://github.com/vinniefalco/Beast "Beast Project" - [2]: http://vinniefalco.github.com/Beast/ "Beast Documentation" - [3]: http://rawmaterialsoftware.com/juce.php "JUCE" - [4]: http://rawmaterialsoftware.com/ "Raw Material Software" - [5]: http://www.gnu.org/licenses/gpl-2.0.html "GNU General Public License, version 2" - [6]: http://rawmaterialsoftware.com/jucelicense.php "JUCE Licenses" - [7]: http://www.bzip.org/ "bZip2: Home" - [8]: http://freetype.org/ "The FreeType Project" - [9]: http://www.freetype.org/FTL.TXT "The FreeType Project License" - [10]: http://www.lua.org/ "The Programming Language Lua" - [11]: http://www.opensource.org/licenses/mit-license.html "The MIT License" - [12]: https://github.com/vinniefalco/LuaBridge - [13]: http://soci.sourceforge.net/ "SOCI" - [14]: http://www.boost.org/LICENSE_1_0.txt "Boost Software License, Version 1.0" - [15]: http://sqlite.org/ "SQLite Home Page" - [16]: http://developer.kde.org/~wheeler/taglib.html "TagLib" - [17]: http://www.gnu.org/licenses/lgpl-2.1.html "Gnu Lesser General Public License, version 2.1" - [18]: http://www.mozilla.org/MPL/1.1/ "Mozilla Public License" - - @copyright Copyright (C) 2008 by Vinnie Falco \ ([e-mail][0]) - @copyright Provided under the [MIT License][11] +@copyright Copyright 2008-2013 by Vinnie Falco \ ([e-mail][0]) +@copyright Provided under the [ISC LIcense][11] */ -/*============================================================================*/ -/** - @internal +//------------------------------------------------------------------------------ - Implementation classes. +/** Implementation classes. - Thase classes are used internally. + Thase classes are used internally. - @defgroup internal internal + @defgroup internal internal + @internal */ -/*============================================================================*/ -/** - External modules. +//------------------------------------------------------------------------------ - These modules bring in functionality from third party or system libraries. +/** External modules. - @defgroup external external + These modules bring in functionality from third party or system libraries. + + @defgroup external external */ -/*============================================================================*/ -/** - Core classes. +//------------------------------------------------------------------------------ - This module provides core required functionality, and classes useful for - general development. All other modules require this module. +/** Core classes. - @todo Discuss the treatment of exceptions versus Error objects in the library. + This module provides core required functionality, and classes useful for + general development. All other modules require this module. - @todo Discuss the additions to BeastConfig.h + @todo Discuss the treatment of exceptions versus Error objects in the + library. - @defgroup beast_core beast_core + @todo Discuss the additions to BeastConfig.h + + @defgroup beast_core beast_core */ -/* See the JUCE notes regarding BeastConfig.h - - This file must always be included before any Juce headers. - - There are some Beast specific build options that may be placed - into this file. See the AppConfig.h provided with Beast. -*/ - -/* BeastConfig.h must be included before this file */ - -/* Use sensible default configurations if they forgot - to append the necessary macros into their BeastConfig.h. -*/ -#ifndef BEAST_USE_BOOST -#define BEAST_USE_BOOST 0 -#endif - -#ifndef BEAST_USE_LEAKCHECKED -#define BEAST_USE_LEAKCHECKED BEAST_CHECK_MEMORY_LEAKS -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - /* Get this early so we can use it. */ #include "../beast_core/system/beast_TargetPlatform.h" //------------------------------------------------------------------------------ -// This is a hack to fix boost's goofy placeholders -#if BEAST_USE_BOOST -#ifdef BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED -#error must not be included before this file -#endif -// Prevent from being included -#define BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED -#include -#include -// This based on -namespace boost { -namespace placeholders { -extern boost::arg<1> _1; -extern boost::arg<2> _2; -extern boost::arg<3> _3; -extern boost::arg<4> _4; -extern boost::arg<5> _5; -extern boost::arg<6> _6; -extern boost::arg<7> _7; -extern boost::arg<8> _8; -extern boost::arg<9> _9; -} -using namespace placeholders; -} -#endif - -//------------------------------------------------------------------------------ - -// Choose a source of bind, placeholders, and function - -#if !BEAST_BIND_USES_STD && !BEAST_BIND_USES_TR1 && !BEAST_BIND_USES_BOOST -# if BEAST_MSVC -# define BEAST_BIND_USES_STD 1 -# elif BEAST_IOS || BEAST_MAC -# include // detect version of std::lib -# if BEAST_IOS && BEAST_USE_BOOST // Work-around for iOS bugs with bind. -# define BEAST_BIND_USES_BOOST 1 -# elif _LIBCPP_VERSION // libc++ -# define BEAST_BIND_USES_STD 1 -# else // libstdc++ (GNU) -# define BEAST_BIND_USES_TR1 1 -# endif -# elif BEAST_LINUX || BEAST_BSD -# define BEAST_BIND_USES_TR1 1 -# else -# define BEAST_BIND_USES_STD 1 -# endif -#endif - -#if BEAST_BIND_USES_STD -# include -#elif BEAST_BIND_USES_TR1 -# include -#elif BEAST_BIND_USES_BOOST -# include -# include -#endif - -//------------------------------------------------------------------------------ - -#if BEAST_USE_BOOST +#if BEAST_BOOST_IS_AVAILABLE #include #endif @@ -415,63 +299,24 @@ using namespace placeholders; namespace beast { -// This group must come first since other files need it -#include "memory/beast_Uncopyable.h" -#include "diagnostic/beast_CatchAny.h" -#include "diagnostic/beast_Debug.h" -#include "diagnostic/beast_Error.h" -#include "diagnostic/beast_FPUFlags.h" -#include "diagnostic/beast_LeakChecked.h" -#include "diagnostic/beast_SafeBool.h" -#include "diagnostic/beast_Throw.h" +// Order matters -#include "containers/beast_List.h" -#include "containers/beast_LockFreeStack.h" -#include "containers/beast_LockFreeQueue.h" -#include "containers/beast_SharedTable.h" -#include "containers/beast_SortedLookupTable.h" - -#include "events/beast_OncePerSecond.h" -#include "events/beast_PerformedAtExit.h" - -#include "functor/beast_Bind.h" #include "functor/beast_Function.h" - +#include "diagnostic/beast_CatchAny.h" +#include "events/beast_OncePerSecond.h" #include "math/beast_Interval.h" #include "math/beast_Math.h" #include "math/beast_MurmurHash.h" - -#include "memory/beast_MemoryAlignment.h" -#include "memory/beast_StaticObject.h" -#include "memory/beast_AtomicCounter.h" -#include "memory/beast_AtomicFlag.h" -#include "memory/beast_AtomicPointer.h" -#include "memory/beast_AtomicState.h" #include "memory/beast_AllocatedBy.h" #include "memory/beast_RefCountedSingleton.h" -#include "memory/beast_FifoFreeStore.h" -#if BEAST_USE_BOOST -#include "memory/beast_FifoFreeStoreWithTLS.h" -#else -#include "memory/beast_FifoFreeStoreWithoutTLS.h" -#endif -#include "memory/beast_GlobalFifoFreeStore.h" -#include "memory/beast_GlobalPagedFreeStore.h" #include "memory/beast_PagedFreeStore.h" - -#if BEAST_MSVC -#pragma warning (push) -#pragma warning (disable: 4100) // unreferenced formal parmaeter -#pragma warning (disable: 4355) // 'this' used in base member -#endif -#include "memory/beast_CacheLine.h" -#if BEAST_MSVC -#pragma warning (pop) -#endif - +#include "memory/beast_GlobalPagedFreeStore.h" +#include "memory/beast_FifoFreeStoreWithTLS.h" +#include "memory/beast_FifoFreeStoreWithoutTLS.h" +#include "memory/beast_FifoFreeStore.h" +#include "memory/beast_GlobalFifoFreeStore.h" #include "threads/beast_Semaphore.h" #include "threads/beast_SerialFor.h" -#include "threads/beast_SpinDelay.h" #include "threads/beast_InterruptibleThread.h" #include "threads/beast_ReadWriteMutex.h" #include "threads/beast_ThreadGroup.h" diff --git a/Subtrees/beast/modules/beast_basics/diagnostic/beast_CatchAny.h b/Subtrees/beast/modules/beast_basics/diagnostic/beast_CatchAny.h index 0d8e3ebecc..22df5ca2fc 100644 --- a/Subtrees/beast/modules/beast_basics/diagnostic/beast_CatchAny.h +++ b/Subtrees/beast/modules/beast_basics/diagnostic/beast_CatchAny.h @@ -20,8 +20,6 @@ #ifndef BEAST_CATCHANY_BEASTHEADER #define BEAST_CATCHANY_BEASTHEADER -#include "../functor/beast_Function.h" - /** Exception catcher. diff --git a/Subtrees/beast/modules/beast_basics/events/beast_OncePerSecond.h b/Subtrees/beast/modules/beast_basics/events/beast_OncePerSecond.h index 2c5075aa2e..24b47913db 100644 --- a/Subtrees/beast/modules/beast_basics/events/beast_OncePerSecond.h +++ b/Subtrees/beast/modules/beast_basics/events/beast_OncePerSecond.h @@ -20,8 +20,6 @@ #ifndef BEAST_ONCEPERSECOND_BEASTHEADER #define BEAST_ONCEPERSECOND_BEASTHEADER -#include "../containers/beast_List.h" - /*============================================================================*/ /** Provides a once per second notification. @@ -32,7 +30,7 @@ @ingroup beast_core */ -class OncePerSecond : Uncopyable +class BEAST_API OncePerSecond : Uncopyable { public: OncePerSecond (); diff --git a/Subtrees/beast/modules/beast_basics/math/beast_MurmurHash.h b/Subtrees/beast/modules/beast_basics/math/beast_MurmurHash.h index a406615b13..f412bff897 100644 --- a/Subtrees/beast/modules/beast_basics/math/beast_MurmurHash.h +++ b/Subtrees/beast/modules/beast_basics/math/beast_MurmurHash.h @@ -31,7 +31,7 @@ extern void MurmurHash3_x86_32 (const void* key, int len, uint32 seed, void* ou extern void MurmurHash3_x86_128 (const void* key, int len, uint32 seed, void* out); extern void MurmurHash3_x64_128 (const void* key, int len, uint32 seed, void* out); -// Uses Juce to choose an appropriate routine +// Uses Beast to choose an appropriate routine // This handy template deduces which size hash is desired template @@ -44,15 +44,15 @@ inline void Hash (const void* key, int len, uint32 seed, HashType* out) break; #if BEAST_64BIT - case 128: MurmurHash3_x64_128 (key, len, seed, out); break; -#else +#else case 128: MurmurHash3_x86_128 (key, len, seed, out); break; + #endif default: diff --git a/Subtrees/beast/modules/beast_basics/memory/beast_FifoFreeStore.h b/Subtrees/beast/modules/beast_basics/memory/beast_FifoFreeStore.h index 452053bfd8..fafa2eeb26 100644 --- a/Subtrees/beast/modules/beast_basics/memory/beast_FifoFreeStore.h +++ b/Subtrees/beast/modules/beast_basics/memory/beast_FifoFreeStore.h @@ -20,19 +20,11 @@ #ifndef BEAST_FIFOFREESTORE_BEASTHEADER #define BEAST_FIFOFREESTORE_BEASTHEADER -#if BEAST_USE_BOOST -#include "beast_FifoFreeStoreWithTLS.h" - -#else -#include "beast_FifoFreeStoreWithoutTLS.h" - -#endif - /** Selected free store based on compilation settings. @ingroup beast_concurrent */ -#if BEAST_USE_BOOST +#if BEAST_BOOST_IS_AVAILABLE typedef FifoFreeStoreWithTLS FifoFreeStoreType; #else typedef FifoFreeStoreWithoutTLS FifoFreeStoreType; diff --git a/Subtrees/beast/modules/beast_basics/memory/beast_FifoFreeStoreWithTLS.cpp b/Subtrees/beast/modules/beast_basics/memory/beast_FifoFreeStoreWithTLS.cpp index 51c93ae8f1..b868937eb3 100644 --- a/Subtrees/beast/modules/beast_basics/memory/beast_FifoFreeStoreWithTLS.cpp +++ b/Subtrees/beast/modules/beast_basics/memory/beast_FifoFreeStoreWithTLS.cpp @@ -32,6 +32,8 @@ // affecting performance. // +#if BEAST_BOOST_IS_AVAILABLE + // This precedes every allocation // struct FifoFreeStoreWithTLS::Header @@ -192,3 +194,5 @@ void FifoFreeStoreWithTLS::deallocate (void* p) if (page->release ()) deletePage (page); } + +#endif diff --git a/Subtrees/beast/modules/beast_basics/memory/beast_FifoFreeStoreWithTLS.h b/Subtrees/beast/modules/beast_basics/memory/beast_FifoFreeStoreWithTLS.h index 5382c3737f..4ecbe90b70 100644 --- a/Subtrees/beast/modules/beast_basics/memory/beast_FifoFreeStoreWithTLS.h +++ b/Subtrees/beast/modules/beast_basics/memory/beast_FifoFreeStoreWithTLS.h @@ -20,7 +20,7 @@ #ifndef BEAST_FIFOFREESTOREWITHTLS_BEASTHEADER #define BEAST_FIFOFREESTOREWITHTLS_BEASTHEADER -#include "beast_GlobalPagedFreeStore.h" +#if BEAST_BOOST_IS_AVAILABLE /*============================================================================*/ /** @@ -39,7 +39,7 @@ @ingroup beast_concurrent */ -class FifoFreeStoreWithTLS +class BEAST_API FifoFreeStoreWithTLS { public: FifoFreeStoreWithTLS (); @@ -65,3 +65,5 @@ private: }; #endif + +#endif diff --git a/Subtrees/beast/modules/beast_basics/memory/beast_FifoFreeStoreWithoutTLS.h b/Subtrees/beast/modules/beast_basics/memory/beast_FifoFreeStoreWithoutTLS.h index acfe2043f3..4b666a39cb 100644 --- a/Subtrees/beast/modules/beast_basics/memory/beast_FifoFreeStoreWithoutTLS.h +++ b/Subtrees/beast/modules/beast_basics/memory/beast_FifoFreeStoreWithoutTLS.h @@ -20,8 +20,6 @@ #ifndef BEAST_FIFOFREESTOREWITHOUTTLS_BEASTHEADER #define BEAST_FIFOFREESTOREWITHOUTTLS_BEASTHEADER -#include "beast_GlobalPagedFreeStore.h" - /*============================================================================*/ /** Lock-free FIFO memory allocator. @@ -40,7 +38,7 @@ @ingroup beast_concurrent */ -class FifoFreeStoreWithoutTLS +class BEAST_API FifoFreeStoreWithoutTLS { public: explicit FifoFreeStoreWithoutTLS (); diff --git a/Subtrees/beast/modules/beast_basics/memory/beast_GlobalFifoFreeStore.h b/Subtrees/beast/modules/beast_basics/memory/beast_GlobalFifoFreeStore.h index 96b9184fe6..6b159d38c6 100644 --- a/Subtrees/beast/modules/beast_basics/memory/beast_GlobalFifoFreeStore.h +++ b/Subtrees/beast/modules/beast_basics/memory/beast_GlobalFifoFreeStore.h @@ -20,8 +20,6 @@ #ifndef BEAST_GLOBALFIFOFREESTORE_BEASTHEADER #define BEAST_GLOBALFIFOFREESTORE_BEASTHEADER -#include "beast_FifoFreeStore.h" - /*============================================================================*/ /** A @ref FifoFreeStoreType singleton. diff --git a/Subtrees/beast/modules/beast_basics/memory/beast_GlobalPagedFreeStore.h b/Subtrees/beast/modules/beast_basics/memory/beast_GlobalPagedFreeStore.h index ff17214868..1adc9b595f 100644 --- a/Subtrees/beast/modules/beast_basics/memory/beast_GlobalPagedFreeStore.h +++ b/Subtrees/beast/modules/beast_basics/memory/beast_GlobalPagedFreeStore.h @@ -20,15 +20,13 @@ #ifndef BEAST_GLOBALPAGEDFREESTORE_BEASTHEADER #define BEAST_GLOBALPAGEDFREESTORE_BEASTHEADER -#include "beast_PagedFreeStore.h" - /*============================================================================*/ /** A PagedFreeStore singleton. @ingroup beast_concurrent */ -class GlobalPagedFreeStore +class BEAST_API GlobalPagedFreeStore : public RefCountedSingleton , LeakChecked { diff --git a/Subtrees/beast/modules/beast_basics/memory/beast_PagedFreeStore.h b/Subtrees/beast/modules/beast_basics/memory/beast_PagedFreeStore.h index 078a383fd3..14b647cfe5 100644 --- a/Subtrees/beast/modules/beast_basics/memory/beast_PagedFreeStore.h +++ b/Subtrees/beast/modules/beast_basics/memory/beast_PagedFreeStore.h @@ -29,7 +29,7 @@ @ingroup beast_concurrent */ -class PagedFreeStore : private OncePerSecond +class BEAST_API PagedFreeStore : private OncePerSecond { public: explicit PagedFreeStore (const size_t pageBytes); diff --git a/Subtrees/beast/modules/beast_basics/memory/beast_RefCountedSingleton.h b/Subtrees/beast/modules/beast_basics/memory/beast_RefCountedSingleton.h index 54ce76dcbb..c96e3b9522 100644 --- a/Subtrees/beast/modules/beast_basics/memory/beast_RefCountedSingleton.h +++ b/Subtrees/beast/modules/beast_basics/memory/beast_RefCountedSingleton.h @@ -20,9 +20,6 @@ #ifndef BEAST_REFERENCECOUNTEDSINGLETON_BEASTHEADER #define BEAST_REFERENCECOUNTEDSINGLETON_BEASTHEADER -#include "../events/beast_PerformedAtExit.h" -#include "../memory/beast_StaticObject.h" - /** Thread-safe singleton which comes into existence on first use. Use this instead of creating objects with static storage duration. These singletons @@ -36,20 +33,18 @@ @ingroup beast_core */ /** @{ */ -class SingletonLifetime +class BEAST_API SingletonLifetime { // "base classes dependent on a template parameter // aren't part of lookup." - ville public: - /** - Construction options for RefCountedSingleton + /** Construction options for RefCountedSingleton - @ingroup beast_core + @ingroup beast_core */ enum Lifetime { - /** Singleton is created on first use and destroyed when - the last reference is removed. + /** Created on first use, destroyed when the last reference is removed. */ createOnDemand, diff --git a/Subtrees/beast/modules/beast_basics/native/beast_posix_Threads.cpp b/Subtrees/beast/modules/beast_basics/native/beast_posix_Threads.cpp deleted file mode 100644 index b6865169f0..0000000000 --- a/Subtrees/beast/modules/beast_basics/native/beast_posix_Threads.cpp +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -/* - This file is part of Beast: https://github.com/vinniefalco/Beast - Copyright 2013, Vinnie Falco - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ -//============================================================================== diff --git a/Subtrees/beast/modules/beast_basics/native/beast_win32_Threads.cpp b/Subtrees/beast/modules/beast_basics/native/beast_win32_Threads.cpp deleted file mode 100644 index b6865169f0..0000000000 --- a/Subtrees/beast/modules/beast_basics/native/beast_win32_Threads.cpp +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------------------------ -/* - This file is part of Beast: https://github.com/vinniefalco/Beast - Copyright 2013, Vinnie Falco - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ -//============================================================================== diff --git a/Subtrees/beast/modules/beast_basics/threads/beast_CallQueue.h b/Subtrees/beast/modules/beast_basics/threads/beast_CallQueue.h index 4a59e121c7..8589007afc 100644 --- a/Subtrees/beast/modules/beast_basics/threads/beast_CallQueue.h +++ b/Subtrees/beast/modules/beast_basics/threads/beast_CallQueue.h @@ -131,7 +131,7 @@ @ingroup beast_concurrent */ -class CallQueue +class BEAST_API CallQueue { public: //============================================================================ diff --git a/Subtrees/beast/modules/beast_basics/threads/beast_ConcurrentObject.h b/Subtrees/beast/modules/beast_basics/threads/beast_ConcurrentObject.h index 4f2f531ec0..de0dc327ba 100644 --- a/Subtrees/beast/modules/beast_basics/threads/beast_ConcurrentObject.h +++ b/Subtrees/beast/modules/beast_basics/threads/beast_ConcurrentObject.h @@ -41,7 +41,7 @@ @ingroup beast_concurrent */ -class ConcurrentObject : Uncopyable +class BEAST_API ConcurrentObject : Uncopyable { public: inline void incReferenceCount () noexcept diff --git a/Subtrees/beast/modules/beast_basics/threads/beast_GlobalThreadGroup.h b/Subtrees/beast/modules/beast_basics/threads/beast_GlobalThreadGroup.h index 6940ebde51..995bbcce3b 100644 --- a/Subtrees/beast/modules/beast_basics/threads/beast_GlobalThreadGroup.h +++ b/Subtrees/beast/modules/beast_basics/threads/beast_GlobalThreadGroup.h @@ -28,7 +28,7 @@ @ingroup beast_concurrent */ -class GlobalThreadGroup : public ThreadGroup, +class BEAST_API GlobalThreadGroup : public ThreadGroup, public RefCountedSingleton { private: diff --git a/Subtrees/beast/modules/beast_basics/threads/beast_InterruptibleThread.h b/Subtrees/beast/modules/beast_basics/threads/beast_InterruptibleThread.h index 2c56e9dc67..f81dfc213d 100644 --- a/Subtrees/beast/modules/beast_basics/threads/beast_InterruptibleThread.h +++ b/Subtrees/beast/modules/beast_basics/threads/beast_InterruptibleThread.h @@ -20,9 +20,6 @@ #ifndef BEAST_INTERRUPTIBLETHREAD_BEASTHEADER #define BEAST_INTERRUPTIBLETHREAD_BEASTHEADER -#include "../diagnostic/beast_SafeBool.h" -#include "../functor/beast_Function.h" - //============================================================================== /** A thread with soft interruption support. @@ -36,7 +33,7 @@ @ingroup beast_core */ -class InterruptibleThread +class BEAST_API InterruptibleThread { public: /** InterruptibleThread entry point. diff --git a/Subtrees/beast/modules/beast_basics/threads/beast_Listeners.h b/Subtrees/beast/modules/beast_basics/threads/beast_Listeners.h index 9236771890..75093dd993 100644 --- a/Subtrees/beast/modules/beast_basics/threads/beast_Listeners.h +++ b/Subtrees/beast/modules/beast_basics/threads/beast_Listeners.h @@ -205,7 +205,7 @@ @class Listeners @ingroup beast_concurrent */ -class ListenersBase +class BEAST_API ListenersBase { public: struct ListenersStructureTag { }; diff --git a/Subtrees/beast/modules/beast_basics/threads/beast_ParallelFor.h b/Subtrees/beast/modules/beast_basics/threads/beast_ParallelFor.h index 7cf6b45d5c..93e8dbf8d8 100644 --- a/Subtrees/beast/modules/beast_basics/threads/beast_ParallelFor.h +++ b/Subtrees/beast/modules/beast_basics/threads/beast_ParallelFor.h @@ -52,7 +52,7 @@ @ingroup beast_concurrent */ -class ParallelFor : Uncopyable +class BEAST_API ParallelFor : Uncopyable { public: /** Create a parallel for loop. diff --git a/Subtrees/beast/modules/beast_basics/threads/beast_ReadWriteMutex.h b/Subtrees/beast/modules/beast_basics/threads/beast_ReadWriteMutex.h index ff1f987e27..aea144a536 100644 --- a/Subtrees/beast/modules/beast_basics/threads/beast_ReadWriteMutex.h +++ b/Subtrees/beast/modules/beast_basics/threads/beast_ReadWriteMutex.h @@ -47,7 +47,8 @@ @ingroup beast_concurrent */ -/*============================================================================*/ +//------------------------------------------------------------------------------ + /** Scoped read lock for ReadWriteMutex. @@ -72,7 +73,8 @@ private: LockType const& m_lock; }; -/*============================================================================*/ +//------------------------------------------------------------------------------ + /** Scoped write lock for ReadWriteMutex. @@ -97,7 +99,9 @@ private: LockType const& m_lock; }; -class ReadWriteMutex +//------------------------------------------------------------------------------ + +class BEAST_API ReadWriteMutex { public: /** Provides the type of scoped read lock to use with a ReadWriteMutex. */ diff --git a/Subtrees/beast/modules/beast_basics/threads/beast_Semaphore.h b/Subtrees/beast/modules/beast_basics/threads/beast_Semaphore.h index 4d8ec2cebe..de78a0a1e4 100644 --- a/Subtrees/beast/modules/beast_basics/threads/beast_Semaphore.h +++ b/Subtrees/beast/modules/beast_basics/threads/beast_Semaphore.h @@ -31,7 +31,7 @@ @ingroup beast_core */ -class Semaphore +class BEAST_API Semaphore { public: /** Create a semaphore with the specified number of resources. diff --git a/Subtrees/beast/modules/beast_basics/threads/beast_SerialFor.h b/Subtrees/beast/modules/beast_basics/threads/beast_SerialFor.h index 3d736fe26b..5be1429af8 100644 --- a/Subtrees/beast/modules/beast_basics/threads/beast_SerialFor.h +++ b/Subtrees/beast/modules/beast_basics/threads/beast_SerialFor.h @@ -31,7 +31,7 @@ @ingroup beast_core */ -class SerialFor : Uncopyable +class BEAST_API SerialFor : Uncopyable { public: /** Create a serial for loop. diff --git a/Subtrees/beast/modules/beast_basics/threads/beast_SharedObject.h b/Subtrees/beast/modules/beast_basics/threads/beast_SharedObject.h index 7d9e80761b..65e398b1f9 100644 --- a/Subtrees/beast/modules/beast_basics/threads/beast_SharedObject.h +++ b/Subtrees/beast/modules/beast_basics/threads/beast_SharedObject.h @@ -32,7 +32,7 @@ @ingroup beast_concurrent */ -class SharedObject : Uncopyable +class BEAST_API SharedObject : Uncopyable { public: /** Abstract SharedObject scope. diff --git a/Subtrees/beast/modules/beast_basics/threads/beast_ThreadGroup.h b/Subtrees/beast/modules/beast_basics/threads/beast_ThreadGroup.h index b74a9a08a6..50720e2dc5 100644 --- a/Subtrees/beast/modules/beast_basics/threads/beast_ThreadGroup.h +++ b/Subtrees/beast/modules/beast_basics/threads/beast_ThreadGroup.h @@ -28,7 +28,7 @@ @see ParallelFor */ -class ThreadGroup +class BEAST_API ThreadGroup { public: typedef FifoFreeStoreType AllocatorType; diff --git a/Subtrees/beast/modules/beast_basics/threads/beast_ThreadWithCallQueue.h b/Subtrees/beast/modules/beast_basics/threads/beast_ThreadWithCallQueue.h index 8a52263e31..c5fb1f6219 100644 --- a/Subtrees/beast/modules/beast_basics/threads/beast_ThreadWithCallQueue.h +++ b/Subtrees/beast/modules/beast_basics/threads/beast_ThreadWithCallQueue.h @@ -40,7 +40,7 @@ @ingroup beast_concurrent */ -class ThreadWithCallQueue +class BEAST_API ThreadWithCallQueue : public CallQueue , private InterruptibleThread::EntryPoint { diff --git a/Subtrees/beast/modules/beast_core/beast_core.cpp b/Subtrees/beast/modules/beast_core/beast_core.cpp index 4bf563e2a5..f06429c246 100644 --- a/Subtrees/beast/modules/beast_core/beast_core.cpp +++ b/Subtrees/beast/modules/beast_core/beast_core.cpp @@ -112,26 +112,39 @@ namespace beast #include "containers/beast_NamedValueSet.cpp" #include "containers/beast_PropertySet.cpp" #include "containers/beast_Variant.cpp" + +#include "diagnostic/beast_Debug.cpp" +#include "diagnostic/beast_Error.cpp" +#include "diagnostic/beast_FPUFlags.cpp" +#include "diagnostic/beast_LeakChecked.cpp" + #include "files/beast_DirectoryIterator.cpp" #include "files/beast_File.cpp" #include "files/beast_FileInputStream.cpp" #include "files/beast_FileOutputStream.cpp" #include "files/beast_FileSearchPath.cpp" #include "files/beast_TemporaryFile.cpp" + #include "json/beast_JSON.cpp" + #include "logging/beast_FileLogger.cpp" #include "logging/beast_Logger.cpp" + #include "maths/beast_BigInteger.cpp" #include "maths/beast_Expression.cpp" #include "maths/beast_Random.cpp" + #include "memory/beast_MemoryBlock.cpp" + #include "misc/beast_Result.cpp" #include "misc/beast_Uuid.cpp" + #include "network/beast_MACAddress.cpp" #include "network/beast_NamedPipe.cpp" #include "network/beast_Socket.cpp" #include "network/beast_URL.cpp" #include "network/beast_IPAddress.cpp" + #include "streams/beast_BufferedInputStream.cpp" #include "streams/beast_FileInputSource.cpp" #include "streams/beast_InputStream.cpp" @@ -140,7 +153,9 @@ namespace beast #include "streams/beast_OutputStream.cpp" #include "streams/beast_SubregionStream.cpp" #include "system/beast_SystemStats.cpp" + #include "text/beast_CharacterFunctions.cpp" + #include "text/beast_Identifier.cpp" #include "text/beast_LocalisedStrings.cpp" #include "text/beast_String.cpp" @@ -148,17 +163,23 @@ namespace beast #include "text/beast_StringPairArray.cpp" #include "text/beast_StringPool.cpp" #include "text/beast_TextDiff.cpp" + #include "threads/beast_ChildProcess.cpp" #include "threads/beast_ReadWriteLock.cpp" #include "threads/beast_Thread.cpp" #include "threads/beast_ThreadPool.cpp" #include "threads/beast_TimeSliceThread.cpp" + #include "time/beast_PerformanceCounter.cpp" +#include "time/beast_PerformedAtExit.cpp" #include "time/beast_RelativeTime.cpp" #include "time/beast_Time.cpp" + #include "unit_tests/beast_UnitTest.cpp" + #include "xml/beast_XmlDocument.cpp" #include "xml/beast_XmlElement.cpp" + #include "zip/beast_GZIPDecompressorInputStream.cpp" #include "zip/beast_GZIPCompressorOutputStream.cpp" #include "zip/beast_ZipFile.cpp" @@ -221,3 +242,22 @@ namespace beast #include "threads/beast_HighResolutionTimer.cpp" } + +//------------------------------------------------------------------------------ + +#if BEAST_BOOST_IS_AVAILABLE +namespace boost { +namespace placeholders { +boost::arg<1> _1; +boost::arg<2> _2; +boost::arg<3> _3; +boost::arg<4> _4; +boost::arg<5> _5; +boost::arg<6> _6; +boost::arg<7> _7; +boost::arg<8> _8; +boost::arg<9> _9; +} +} +#endif + diff --git a/Subtrees/beast/modules/beast_core/beast_core.h b/Subtrees/beast/modules/beast_core/beast_core.h index a37730cd61..258bc116da 100644 --- a/Subtrees/beast/modules/beast_core/beast_core.h +++ b/Subtrees/beast/modules/beast_core/beast_core.h @@ -21,89 +21,52 @@ */ //============================================================================== -#ifndef BEAST_CORE_BEASTHEADER -#define BEAST_CORE_BEASTHEADER +#ifndef BEAST_CORE_H_INCLUDED +#define BEAST_CORE_H_INCLUDED -#ifndef BEAST_BEASTCONFIG_HEADER - /* If you fail to make sure that all your compile units are building Beast with the same set of - option flags, then there's a risk that different compile units will treat the classes as having - different memory layouts, leading to very nasty memory corruption errors when they all get - linked together. That's why it's best to always include the BeastConfig.h file before any beast headers. - */ - #ifdef _MSC_VER -#pragma message ("Have you included your BeastConfig.h file before including the Beast headers?") - #else - #warning "Have you included your BeastConfig.h file before including the Beast headers?" - #endif +//------------------------------------------------------------------------------ + +/* If you fail to make sure that all your compile units are building Beast with + the same set of option flags, then there's a risk that different compile + units will treat the classes as having different memory layouts, leading to + very nasty memory corruption errors when they all get linked together. + That's why it's best to always include the BeastConfig.h file before any + beast headers. +*/ +#ifndef BEAST_BEASTCONFIG_H_INCLUDED +# ifdef _MSC_VER +# pragma message ("Have you included your BeastConfig.h file before including the Beast headers?") +# else +# warning "Have you included your BeastConfig.h file before including the Beast headers?" +# endif #endif -//============================================================================== +//------------------------------------------------------------------------------ + #include "system/beast_TargetPlatform.h" -//============================================================================= -/** Config: BEAST_FORCE_DEBUG +// +// Apply sensible defaults for the configuration settings +// - Normally, BEAST_DEBUG is set to 1 or 0 based on compiler and project settings, - but if you define this value, you can override this to force it to be true or false. -*/ -#ifndef BEAST_FORCE_DEBUG - //#define BEAST_FORCE_DEBUG 0 -#endif - -//============================================================================= -/** Config: BEAST_LOG_ASSERTIONS - - If this flag is enabled, the the bassert and bassertfalse macros will always use Logger::writeToLog() - to write a message when an assertion happens. - - Enabling it will also leave this turned on in release builds. When it's disabled, - however, the bassert and bassertfalse macros will not be compiled in a - release build. - - @see bassert, bassertfalse, Logger -*/ #ifndef BEAST_LOG_ASSERTIONS - #if BEAST_ANDROID - #define BEAST_LOG_ASSERTIONS 1 - #else - #define BEAST_LOG_ASSERTIONS 0 - #endif +# if BEAST_ANDROID +# define BEAST_LOG_ASSERTIONS 1 +# else +# define BEAST_LOG_ASSERTIONS 0 +# endif #endif -//============================================================================= -/** Config: BEAST_CHECK_MEMORY_LEAKS - - Enables a memory-leak check for certain objects when the app terminates. See the LeakedObjectDetector - class and the BEAST_LEAK_DETECTOR macro for more details about enabling leak checking for specific classes. -*/ #if BEAST_DEBUG && ! defined (BEAST_CHECK_MEMORY_LEAKS) - #define BEAST_CHECK_MEMORY_LEAKS 1 +#define BEAST_CHECK_MEMORY_LEAKS 1 #endif -//============================================================================= -/** Config: BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES - - In a Visual C++ build, this can be used to stop the required system libs being - automatically added to the link stage. -*/ -#ifndef BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES - #define BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES 0 -#endif - -/* Config: BEAST_INCLUDE_ZLIB_CODE - This can be used to disable Beast's embedded 3rd-party zlib code. - You might need to tweak this if you're linking to an external zlib library in your app, - but for normal apps, this option should be left alone. - - If you disable this, you might also want to set a value for BEAST_ZLIB_INCLUDE_PATH, to - specify the path where your zlib headers live. -*/ #ifndef BEAST_INCLUDE_ZLIB_CODE - #define BEAST_INCLUDE_ZLIB_CODE 1 +#define BEAST_INCLUDE_ZLIB_CODE 1 #endif #ifndef BEAST_ZLIB_INCLUDE_PATH - #define BEAST_ZLIB_INCLUDE_PATH +#define BEAST_ZLIB_INCLUDE_PATH #endif /* Config: BEAST_CATCH_UNHANDLED_EXCEPTIONS @@ -111,18 +74,89 @@ to your BEASTApplication::unhandledException() callback. */ #ifndef BEAST_CATCH_UNHANDLED_EXCEPTIONS - //#define BEAST_CATCH_UNHANDLED_EXCEPTIONS 1 +//#define BEAST_CATCH_UNHANDLED_EXCEPTIONS 1 #endif -//============================================================================= -//============================================================================= +#ifndef BEAST_BOOST_IS_AVAILABLE +#define BEAST_BOOST_IS_AVAILABLE 0 +#endif + +#ifndef BEAST_USE_LEAKCHECKED +#define BEAST_USE_LEAKCHECKED BEAST_CHECK_MEMORY_LEAKS +#endif + +//------------------------------------------------------------------------------ +// +// This is a hack to fix boost's goofy placeholders +// + +#if BEAST_BOOST_IS_AVAILABLE +#ifdef BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED +#error must not be included before this file +#endif +// Prevent from being included +#define BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED +#include +#include +// This based on +namespace boost { +namespace placeholders { +extern boost::arg<1> _1; +extern boost::arg<2> _2; +extern boost::arg<3> _3; +extern boost::arg<4> _4; +extern boost::arg<5> _5; +extern boost::arg<6> _6; +extern boost::arg<7> _7; +extern boost::arg<8> _8; +extern boost::arg<9> _9; +} +using namespace placeholders; +} +#endif + +//------------------------------------------------------------------------------ +// +// Choose a source of bind, placeholders, and function +// + +#if !BEAST_BIND_USES_STD && !BEAST_BIND_USES_TR1 && !BEAST_BIND_USES_BOOST +# if BEAST_MSVC +# define BEAST_BIND_USES_STD 1 +# elif BEAST_IOS || BEAST_MAC +# include // detect version of std::lib +# if BEAST_IOS && BEAST_BOOST_IS_AVAILABLE // Work-around for iOS bugs with bind. +# define BEAST_BIND_USES_BOOST 1 +# elif _LIBCPP_VERSION // libc++ +# define BEAST_BIND_USES_STD 1 +# else // libstdc++ (GNU) +# define BEAST_BIND_USES_TR1 1 +# endif +# elif BEAST_LINUX || BEAST_BSD +# define BEAST_BIND_USES_TR1 1 +# else +# define BEAST_BIND_USES_STD 1 +# endif +#endif + +#if BEAST_BIND_USES_STD +# include +#elif BEAST_BIND_USES_TR1 +# include +#elif BEAST_BIND_USES_BOOST +# include +# include +#endif + +//------------------------------------------------------------------------------ + #if BEAST_MSVC - #pragma warning (disable: 4251) // (DLL build warning, must be disabled before pushing the warning state) - #pragma warning (push) - #pragma warning (disable: 4786) // (long class name warning) - #ifdef __INTEL_COMPILER - #pragma warning (disable: 1125) - #endif +# pragma warning (disable: 4251) // (DLL build warning, must be disabled before pushing the warning state) +# pragma warning (push) +# pragma warning (disable: 4786) // (long class name warning) +# ifdef __INTEL_COMPILER +# pragma warning (disable: 1125) +# endif #endif #include "system/beast_StandardHeader.h" @@ -130,311 +164,135 @@ namespace beast { -// START_AUTOINCLUDE containers, files, json, logging, maths, memory, misc, network, -// streams, system, text, threads, time, unit_tests, xml, zip -#ifndef BEAST_ABSTRACTFIFO_BEASTHEADER - #include "containers/beast_AbstractFifo.h" -#endif -#ifndef BEAST_ARRAY_BEASTHEADER - #include "containers/beast_Array.h" -#endif -#ifndef BEAST_ARRAYALLOCATIONBASE_BEASTHEADER - #include "containers/beast_ArrayAllocationBase.h" -#endif -#ifndef BEAST_DYNAMICOBJECT_BEASTHEADER - #include "containers/beast_DynamicObject.h" -#endif -#ifndef BEAST_ELEMENTCOMPARATOR_BEASTHEADER - #include "containers/beast_ElementComparator.h" -#endif -#ifndef BEAST_HASHMAP_BEASTHEADER - #include "containers/beast_HashMap.h" -#endif -#ifndef BEAST_LINKEDLISTPOINTER_BEASTHEADER - #include "containers/beast_LinkedListPointer.h" -#endif -#ifndef BEAST_NAMEDVALUESET_BEASTHEADER - #include "containers/beast_NamedValueSet.h" -#endif -#ifndef BEAST_OWNEDARRAY_BEASTHEADER - #include "containers/beast_OwnedArray.h" -#endif -#ifndef BEAST_PROPERTYSET_BEASTHEADER - #include "containers/beast_PropertySet.h" -#endif -#ifndef BEAST_REFERENCECOUNTEDARRAY_BEASTHEADER - #include "containers/beast_ReferenceCountedArray.h" -#endif -#ifndef BEAST_SCOPEDVALUESETTER_BEASTHEADER - #include "containers/beast_ScopedValueSetter.h" -#endif -#ifndef BEAST_SORTEDSET_BEASTHEADER - #include "containers/beast_SortedSet.h" -#endif -#ifndef BEAST_SPARSESET_BEASTHEADER - #include "containers/beast_SparseSet.h" -#endif -#ifndef BEAST_VARIANT_BEASTHEADER - #include "containers/beast_Variant.h" -#endif -#ifndef BEAST_DIRECTORYITERATOR_BEASTHEADER - #include "files/beast_DirectoryIterator.h" -#endif -#ifndef BEAST_FILE_BEASTHEADER - #include "files/beast_File.h" -#endif -#ifndef BEAST_FILEINPUTSTREAM_BEASTHEADER - #include "files/beast_FileInputStream.h" -#endif -#ifndef BEAST_FILEOUTPUTSTREAM_BEASTHEADER - #include "files/beast_FileOutputStream.h" -#endif -#ifndef BEAST_FILESEARCHPATH_BEASTHEADER - #include "files/beast_FileSearchPath.h" -#endif -#ifndef BEAST_MEMORYMAPPEDFILE_BEASTHEADER - #include "files/beast_MemoryMappedFile.h" -#endif -#ifndef BEAST_TEMPORARYFILE_BEASTHEADER - #include "files/beast_TemporaryFile.h" -#endif -#ifndef BEAST_JSON_BEASTHEADER - #include "json/beast_JSON.h" -#endif -#ifndef BEAST_FILELOGGER_BEASTHEADER - #include "logging/beast_FileLogger.h" -#endif -#ifndef BEAST_LOGGER_BEASTHEADER - #include "logging/beast_Logger.h" -#endif -#ifndef BEAST_BIGINTEGER_BEASTHEADER - #include "maths/beast_BigInteger.h" -#endif -#ifndef BEAST_EXPRESSION_BEASTHEADER - #include "maths/beast_Expression.h" -#endif -#ifndef BEAST_MATHSFUNCTIONS_BEASTHEADER - #include "maths/beast_MathsFunctions.h" -#endif -#ifndef BEAST_RANDOM_BEASTHEADER - #include "maths/beast_Random.h" -#endif -#ifndef BEAST_RANGE_BEASTHEADER - #include "maths/beast_Range.h" -#endif -#ifndef BEAST_ATOMIC_BEASTHEADER - #include "memory/beast_Atomic.h" -#endif -#ifndef BEAST_BYTEORDER_BEASTHEADER - #include "memory/beast_ByteOrder.h" -#endif -#ifndef BEAST_HEAPBLOCK_BEASTHEADER - #include "memory/beast_HeapBlock.h" -#endif -#ifndef BEAST_LEAKEDOBJECTDETECTOR_BEASTHEADER - #include "memory/beast_LeakedObjectDetector.h" -#endif -#ifndef BEAST_MEMORY_BEASTHEADER - #include "memory/beast_Memory.h" -#endif -#ifndef BEAST_MEMORYBLOCK_BEASTHEADER - #include "memory/beast_MemoryBlock.h" -#endif -#ifndef BEAST_OPTIONALSCOPEDPOINTER_BEASTHEADER - #include "memory/beast_OptionalScopedPointer.h" -#endif -#ifndef BEAST_REFERENCECOUNTEDOBJECT_BEASTHEADER - #include "memory/beast_ReferenceCountedObject.h" -#endif -#ifndef BEAST_SCOPEDPOINTER_BEASTHEADER - #include "memory/beast_ScopedPointer.h" -#endif -#ifndef BEAST_SINGLETON_BEASTHEADER - #include "memory/beast_Singleton.h" -#endif -#ifndef BEAST_WEAKREFERENCE_BEASTHEADER - #include "memory/beast_WeakReference.h" -#endif -#ifndef BEAST_RESULT_BEASTHEADER - #include "misc/beast_Result.h" -#endif -#ifndef BEAST_UUID_BEASTHEADER - #include "misc/beast_Uuid.h" -#endif -#ifndef BEAST_WINDOWSREGISTRY_BEASTHEADER - #include "misc/beast_WindowsRegistry.h" -#endif -#ifndef BEAST_IPADDRESS_BEASTHEADER - #include "network/beast_IPAddress.h" -#endif -#ifndef BEAST_MACADDRESS_BEASTHEADER - #include "network/beast_MACAddress.h" -#endif -#ifndef BEAST_NAMEDPIPE_BEASTHEADER - #include "network/beast_NamedPipe.h" -#endif -#ifndef BEAST_SOCKET_BEASTHEADER - #include "network/beast_Socket.h" -#endif -#ifndef BEAST_URL_BEASTHEADER - #include "network/beast_URL.h" -#endif -#ifndef BEAST_BUFFEREDINPUTSTREAM_BEASTHEADER - #include "streams/beast_BufferedInputStream.h" -#endif -#ifndef BEAST_FILEINPUTSOURCE_BEASTHEADER - #include "streams/beast_FileInputSource.h" -#endif -#ifndef BEAST_INPUTSOURCE_BEASTHEADER - #include "streams/beast_InputSource.h" -#endif -#ifndef BEAST_INPUTSTREAM_BEASTHEADER - #include "streams/beast_InputStream.h" -#endif -#ifndef BEAST_MEMORYINPUTSTREAM_BEASTHEADER - #include "streams/beast_MemoryInputStream.h" -#endif -#ifndef BEAST_MEMORYOUTPUTSTREAM_BEASTHEADER - #include "streams/beast_MemoryOutputStream.h" -#endif -#ifndef BEAST_OUTPUTSTREAM_BEASTHEADER - #include "streams/beast_OutputStream.h" -#endif -#ifndef BEAST_SUBREGIONSTREAM_BEASTHEADER - #include "streams/beast_SubregionStream.h" -#endif -#ifndef BEAST_PLATFORMDEFS_BEASTHEADER - #include "system/beast_PlatformDefs.h" -#endif -#ifndef BEAST_STANDARDHEADER_BEASTHEADER - #include "system/beast_StandardHeader.h" -#endif -#ifndef BEAST_SYSTEMSTATS_BEASTHEADER - #include "system/beast_SystemStats.h" -#endif -#ifndef BEAST_TARGETPLATFORM_BEASTHEADER - #include "system/beast_TargetPlatform.h" -#endif -#ifndef BEAST_CHARACTERFUNCTIONS_BEASTHEADER - #include "text/beast_CharacterFunctions.h" -#endif -#ifndef BEAST_CHARPOINTER_ASCII_BEASTHEADER - #include "text/beast_CharPointer_ASCII.h" -#endif -#ifndef BEAST_CHARPOINTER_UTF16_BEASTHEADER - #include "text/beast_CharPointer_UTF16.h" -#endif -#ifndef BEAST_CHARPOINTER_UTF32_BEASTHEADER - #include "text/beast_CharPointer_UTF32.h" -#endif -#ifndef BEAST_CHARPOINTER_UTF8_BEASTHEADER - #include "text/beast_CharPointer_UTF8.h" -#endif -#ifndef BEAST_IDENTIFIER_BEASTHEADER - #include "text/beast_Identifier.h" -#endif -#ifndef BEAST_LOCALISEDSTRINGS_BEASTHEADER - #include "text/beast_LocalisedStrings.h" -#endif -#ifndef BEAST_NEWLINE_BEASTHEADER - #include "text/beast_NewLine.h" -#endif -#ifndef BEAST_STRING_BEASTHEADER - #include "text/beast_String.h" -#endif -#ifndef BEAST_STRINGARRAY_BEASTHEADER - #include "text/beast_StringArray.h" -#endif -#ifndef BEAST_STRINGPAIRARRAY_BEASTHEADER - #include "text/beast_StringPairArray.h" -#endif -#ifndef BEAST_STRINGPOOL_BEASTHEADER - #include "text/beast_StringPool.h" -#endif -#ifndef BEAST_TEXTDIFF_BEASTHEADER - #include "text/beast_TextDiff.h" -#endif -#ifndef BEAST_CHILDPROCESS_BEASTHEADER - #include "threads/beast_ChildProcess.h" -#endif -#ifndef BEAST_CRITICALSECTION_BEASTHEADER - #include "threads/beast_CriticalSection.h" -#endif -#ifndef BEAST_DYNAMICLIBRARY_BEASTHEADER - #include "threads/beast_DynamicLibrary.h" -#endif -#ifndef BEAST_HIGHRESOLUTIONTIMER_BEASTHEADER - #include "threads/beast_HighResolutionTimer.h" -#endif -#ifndef BEAST_INTERPROCESSLOCK_BEASTHEADER - #include "threads/beast_InterProcessLock.h" -#endif -#ifndef BEAST_PROCESS_BEASTHEADER - #include "threads/beast_Process.h" -#endif -#ifndef BEAST_READWRITELOCK_BEASTHEADER - #include "threads/beast_ReadWriteLock.h" -#endif -#ifndef BEAST_SCOPEDLOCK_BEASTHEADER - #include "threads/beast_ScopedLock.h" -#endif -#ifndef BEAST_SCOPEDREADLOCK_BEASTHEADER - #include "threads/beast_ScopedReadLock.h" -#endif -#ifndef BEAST_SCOPEDWRITELOCK_BEASTHEADER - #include "threads/beast_ScopedWriteLock.h" -#endif -#ifndef BEAST_SPINLOCK_BEASTHEADER - #include "threads/beast_SpinLock.h" -#endif -#ifndef BEAST_THREAD_BEASTHEADER - #include "threads/beast_Thread.h" -#endif -#ifndef BEAST_THREADLOCALVALUE_BEASTHEADER - #include "threads/beast_ThreadLocalValue.h" -#endif -#ifndef BEAST_THREADPOOL_BEASTHEADER - #include "threads/beast_ThreadPool.h" -#endif -#ifndef BEAST_TIMESLICETHREAD_BEASTHEADER - #include "threads/beast_TimeSliceThread.h" -#endif -#ifndef BEAST_WAITABLEEVENT_BEASTHEADER - #include "threads/beast_WaitableEvent.h" -#endif -#ifndef BEAST_PERFORMANCECOUNTER_BEASTHEADER - #include "time/beast_PerformanceCounter.h" -#endif -#ifndef BEAST_RELATIVETIME_BEASTHEADER - #include "time/beast_RelativeTime.h" -#endif -#ifndef BEAST_TIME_BEASTHEADER - #include "time/beast_Time.h" -#endif -#ifndef BEAST_UNITTEST_BEASTHEADER - #include "unit_tests/beast_UnitTest.h" -#endif -#ifndef BEAST_XMLDOCUMENT_BEASTHEADER - #include "xml/beast_XmlDocument.h" -#endif -#ifndef BEAST_XMLELEMENT_BEASTHEADER - #include "xml/beast_XmlElement.h" -#endif -#ifndef BEAST_GZIPCOMPRESSOROUTPUTSTREAM_BEASTHEADER - #include "zip/beast_GZIPCompressorOutputStream.h" -#endif -#ifndef BEAST_GZIPDECOMPRESSORINPUTSTREAM_BEASTHEADER - #include "zip/beast_GZIPDecompressorInputStream.h" -#endif -#ifndef BEAST_ZIPFILE_BEASTHEADER - #include "zip/beast_ZipFile.h" -#endif -// END_AUTOINCLUDE +// Order matters, since headers don't have their own #include lines. +// Add new includes to the bottom. + +#include "threads/beast_Thread.h" +#include "threads/beast_SpinDelay.h" +#include "memory/beast_Atomic.h" +#include "memory/beast_AtomicCounter.h" +#include "memory/beast_AtomicFlag.h" +#include "memory/beast_AtomicPointer.h" +#include "memory/beast_AtomicState.h" +#include "containers/beast_LockFreeStack.h" +#include "memory/beast_StaticObject.h" +#include "diagnostic/beast_LeakChecked.h" + +#include "diagnostic/beast_Debug.h" +#include "diagnostic/beast_SafeBool.h" +#include "diagnostic/beast_Error.h" +#include "diagnostic/beast_FPUFlags.h" +#include "diagnostic/beast_Throw.h" +#include "containers/beast_AbstractFifo.h" +#include "containers/beast_Array.h" +#include "containers/beast_ArrayAllocationBase.h" +#include "containers/beast_DynamicObject.h" +#include "containers/beast_ElementComparator.h" +#include "containers/beast_HashMap.h" +#include "containers/beast_List.h" +#include "containers/beast_LinkedListPointer.h" +#include "containers/beast_LockFreeQueue.h" +#include "containers/beast_NamedValueSet.h" +#include "containers/beast_OwnedArray.h" +#include "containers/beast_PropertySet.h" +#include "containers/beast_ReferenceCountedArray.h" +#include "containers/beast_ScopedValueSetter.h" +#include "containers/beast_SharedTable.h" +#include "containers/beast_SortedLookupTable.h" +#include "containers/beast_SortedSet.h" +#include "containers/beast_SparseSet.h" +#include "containers/beast_Variant.h" +#include "files/beast_DirectoryIterator.h" +#include "files/beast_File.h" +#include "files/beast_FileInputStream.h" +#include "files/beast_FileOutputStream.h" +#include "files/beast_FileSearchPath.h" +#include "files/beast_MemoryMappedFile.h" +#include "files/beast_TemporaryFile.h" +#include "functional/beast_Bind.h" +#include "json/beast_JSON.h" +#include "logging/beast_FileLogger.h" +#include "logging/beast_Logger.h" +#include "maths/beast_BigInteger.h" +#include "maths/beast_Expression.h" +#include "maths/beast_MathsFunctions.h" +#include "maths/beast_Random.h" +#include "maths/beast_Range.h" +#include "memory/beast_ByteOrder.h" +#include "memory/beast_HeapBlock.h" +#include "memory/beast_LeakedObjectDetector.h" +#include "memory/beast_Memory.h" +#include "memory/beast_MemoryBlock.h" +#include "memory/beast_OptionalScopedPointer.h" +#include "memory/beast_ReferenceCountedObject.h" +#include "memory/beast_ScopedPointer.h" +#include "memory/beast_Singleton.h" +#include "memory/beast_WeakReference.h" +#include "memory/beast_MemoryAlignment.h" +#include "memory/beast_CacheLine.h" +#include "misc/beast_Result.h" +#include "misc/beast_Uuid.h" +#include "misc/beast_WindowsRegistry.h" +#include "network/beast_IPAddress.h" +#include "network/beast_MACAddress.h" +#include "network/beast_NamedPipe.h" +#include "network/beast_Socket.h" +#include "network/beast_URL.h" +#include "streams/beast_BufferedInputStream.h" +#include "streams/beast_FileInputSource.h" +#include "streams/beast_InputSource.h" +#include "streams/beast_InputStream.h" +#include "streams/beast_MemoryInputStream.h" +#include "streams/beast_MemoryOutputStream.h" +#include "streams/beast_OutputStream.h" +#include "streams/beast_SubregionStream.h" +#include "system/beast_PlatformDefs.h" +#include "system/beast_StandardHeader.h" +#include "system/beast_SystemStats.h" +#include "system/beast_TargetPlatform.h" +#include "text/beast_CharacterFunctions.h" +#include "text/beast_CharPointer_ASCII.h" +#include "text/beast_CharPointer_UTF16.h" +#include "text/beast_CharPointer_UTF32.h" +#include "text/beast_CharPointer_UTF8.h" +#include "text/beast_Identifier.h" +#include "text/beast_LocalisedStrings.h" +#include "text/beast_NewLine.h" +#include "text/beast_String.h" +#include "text/beast_StringArray.h" +#include "text/beast_StringPairArray.h" +#include "text/beast_StringPool.h" +#include "text/beast_TextDiff.h" +#include "threads/beast_ChildProcess.h" +#include "threads/beast_CriticalSection.h" +#include "threads/beast_DynamicLibrary.h" +#include "threads/beast_HighResolutionTimer.h" +#include "threads/beast_InterProcessLock.h" +#include "threads/beast_Process.h" +#include "threads/beast_ReadWriteLock.h" +#include "threads/beast_ScopedLock.h" +#include "threads/beast_ScopedReadLock.h" +#include "threads/beast_ScopedWriteLock.h" +#include "threads/beast_SpinLock.h" +#include "threads/beast_ThreadLocalValue.h" +#include "threads/beast_ThreadPool.h" +#include "threads/beast_TimeSliceThread.h" +#include "threads/beast_WaitableEvent.h" +#include "time/beast_PerformanceCounter.h" +#include "time/beast_PerformedAtExit.h" +#include "time/beast_RelativeTime.h" +#include "time/beast_Time.h" +#include "unit_tests/beast_UnitTest.h" +#include "xml/beast_XmlDocument.h" +#include "xml/beast_XmlElement.h" +#include "zip/beast_GZIPCompressorOutputStream.h" +#include "zip/beast_GZIPDecompressorInputStream.h" +#include "zip/beast_ZipFile.h" } #if BEAST_MSVC - #pragma warning (pop) +# pragma warning (pop) #endif -#endif // BEAST_CORE_BEASTHEADER +#endif diff --git a/Subtrees/beast/modules/beast_core/containers/beast_AbstractFifo.h b/Subtrees/beast/modules/beast_core/containers/beast_AbstractFifo.h index 4c5e6856c8..1a6aaf2009 100644 --- a/Subtrees/beast/modules/beast_core/containers/beast_AbstractFifo.h +++ b/Subtrees/beast/modules/beast_core/containers/beast_AbstractFifo.h @@ -24,21 +24,19 @@ #ifndef BEAST_ABSTRACTFIFO_BEASTHEADER #define BEAST_ABSTRACTFIFO_BEASTHEADER -#include "../memory/beast_Atomic.h" - - //============================================================================== /** Encapsulates the logic required to implement a lock-free FIFO. - This class handles the logic needed when building a single-reader, single-writer FIFO. + This class handles the logic needed when building a single-reader, + single-writer FIFO. - It doesn't actually hold any data itself, but your FIFO class can use one of these to manage - its position and status when reading or writing to it. + It doesn't actually hold any data itself, but your FIFO class can use one of + these to manage its position and status when reading or writing to it. - To use it, you can call prepareToWrite() to determine the position within your own buffer that - an incoming block of data should be stored, and prepareToRead() to find out when the next - outgoing block should be read from. + To use it, you can call prepareToWrite() to determine the position within + your own buffer that an incoming block of data should be stored, and + prepareToRead() to find out when the next outgoing block should be read from. e.g. @code @@ -204,7 +202,6 @@ public: */ void finishedRead (int numRead) noexcept; - private: //============================================================================== int bufferSize; @@ -213,5 +210,5 @@ private: BEAST_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AbstractFifo) }; +#endif -#endif // BEAST_ABSTRACTFIFO_BEASTHEADER diff --git a/Subtrees/beast/modules/beast_basics/containers/beast_List.h b/Subtrees/beast/modules/beast_core/containers/beast_List.h similarity index 100% rename from Subtrees/beast/modules/beast_basics/containers/beast_List.h rename to Subtrees/beast/modules/beast_core/containers/beast_List.h diff --git a/Subtrees/beast/modules/beast_basics/containers/beast_LockFreeQueue.h b/Subtrees/beast/modules/beast_core/containers/beast_LockFreeQueue.h similarity index 83% rename from Subtrees/beast/modules/beast_basics/containers/beast_LockFreeQueue.h rename to Subtrees/beast/modules/beast_core/containers/beast_LockFreeQueue.h index 28d51c6c7d..e64649b1e1 100644 --- a/Subtrees/beast/modules/beast_basics/containers/beast_LockFreeQueue.h +++ b/Subtrees/beast/modules/beast_core/containers/beast_LockFreeQueue.h @@ -20,33 +20,31 @@ #ifndef BEAST_LOCKFREEQUEUE_BEASTHEADER #define BEAST_LOCKFREEQUEUE_BEASTHEADER -#include "../memory/beast_CacheLine.h" -#include "../memory/beast_AtomicPointer.h" -#include "../threads/beast_SpinDelay.h" +/** Default tag for LockFreeQueue -struct LockFreeQueueDefaultTag; + @ingroup beast_core intrusive +*/ +struct LockFreeQueueDefaultTag { }; -/*============================================================================*/ -/** - Multiple Producer, Single Consumer (MPSC) intrusive FIFO. +/** Multiple Producer, Single Consumer (MPSC) intrusive FIFO. - This container uses the same intrusive interface as List. It is wait-free - for producers and lock-free for consumers. The caller is responsible for - preventing the ABA problem (http://en.wikipedia.org/wiki/ABA_problem) + This container uses the same intrusive interface as List. It is wait-free + for producers and lock-free for consumers. The caller is responsible for + preventing the ABA problem (http://en.wikipedia.org/wiki/ABA_problem) - Invariants: + Invariants: - - Any thread may call push_back() at any time (Multiple Producer). + - Any thread may call push_back() at any time (Multiple Producer). - - Only one thread may call try_pop_front() at a time (Single Consumer) + - Only one thread may call try_pop_front() at a time (Single Consumer) - - The queue is signaled if there are one or more elements. + - The queue is signaled if there are one or more elements. - @param Tag A type name used to distinguish lists and nodes, for - putting objects in multiple lists. If this parameter is - omitted, the default tag is used. + @param Tag A type name used to distinguish lists and nodes, for + putting objects in multiple lists. If this parameter is + omitted, the default tag is used. - @ingroup beast_core intrusive + @ingroup beast_core intrusive */ template class LockFreeQueue @@ -216,11 +214,4 @@ private: Node m_null; }; -/*============================================================================*/ -/** Default tag for LockFreeQueue - - @ingroup beast_core intrusive -*/ -struct LockFreeQueueDefaultTag { }; - #endif diff --git a/Subtrees/beast/modules/beast_basics/containers/beast_LockFreeStack.h b/Subtrees/beast/modules/beast_core/containers/beast_LockFreeStack.h similarity index 99% rename from Subtrees/beast/modules/beast_basics/containers/beast_LockFreeStack.h rename to Subtrees/beast/modules/beast_core/containers/beast_LockFreeStack.h index 606163a29e..d32a47e38e 100644 --- a/Subtrees/beast/modules/beast_basics/containers/beast_LockFreeStack.h +++ b/Subtrees/beast/modules/beast_core/containers/beast_LockFreeStack.h @@ -20,8 +20,6 @@ #ifndef BEAST_LOCKFREESTACK_BEASTHEADER #define BEAST_LOCKFREESTACK_BEASTHEADER -#include "../memory/beast_AtomicPointer.h" - struct LockFreeStackDefaultTag; /*============================================================================*/ @@ -58,6 +56,7 @@ public: private: friend class LockFreeStack; + // VFALCO TODO Use regular Atomic<> AtomicPointer m_next; }; diff --git a/Subtrees/beast/modules/beast_basics/containers/beast_SharedTable.h b/Subtrees/beast/modules/beast_core/containers/beast_SharedTable.h similarity index 98% rename from Subtrees/beast/modules/beast_basics/containers/beast_SharedTable.h rename to Subtrees/beast/modules/beast_core/containers/beast_SharedTable.h index 9e76c155fc..931569599a 100644 --- a/Subtrees/beast/modules/beast_basics/containers/beast_SharedTable.h +++ b/Subtrees/beast/modules/beast_core/containers/beast_SharedTable.h @@ -26,7 +26,7 @@ @tparam ElementType The type of element. - @ingroup beast_gui + @ingroup beast_basics */ template class SharedTable @@ -72,8 +72,7 @@ public: #if BEAST_COMPILER_SUPPORTS_MOVE_SEMANTICS SharedTable (SharedTable&& other) noexcept -: - m_data (static_cast < typename Data::Ptr&& > (other.m_data)) + : m_data (static_cast < typename Data::Ptr&& > (other.m_data)) { } diff --git a/Subtrees/beast/modules/beast_basics/containers/beast_SortedLookupTable.h b/Subtrees/beast/modules/beast_core/containers/beast_SortedLookupTable.h similarity index 86% rename from Subtrees/beast/modules/beast_basics/containers/beast_SortedLookupTable.h rename to Subtrees/beast/modules/beast_core/containers/beast_SortedLookupTable.h index cdfd3e4539..af5ce63902 100644 --- a/Subtrees/beast/modules/beast_basics/containers/beast_SortedLookupTable.h +++ b/Subtrees/beast/modules/beast_core/containers/beast_SortedLookupTable.h @@ -20,30 +20,28 @@ #ifndef BEAST_SORTEDLOOKUPTABLE_BEASTHEADER #define BEAST_SORTEDLOOKUPTABLE_BEASTHEADER -//============================================================================== -/** - Sorted map for fast lookups. +/** Sorted map for fast lookups. - This container is optimized for a data set with fixed elements. + This container is optimized for a data set with fixed elements. - SchemaType obeys this concept: + SchemaType obeys this concept: - @code + @code - struct SchemaType - { - typename KeyType; - typename ValueType; + struct SchemaType + { + typename KeyType; + typename ValueType; - // Retrieve the key for a specified value. - KeyType getKey (Value const& value); - }; + // Retrieve the key for a specified value. + KeyType getKey (Value const& value); + }; - @endcode + @endcode - To use the table, reserve space with reserveSpaceForValues() if the number - of elements is known ahead of time. Then, call insert() for all the your - elements. Call prepareForLookups() once then call lookupValueByKey () + To use the table, reserve space with reserveSpaceForValues() if the number + of elements is known ahead of time. Then, call insert() for all the your + elements. Call prepareForLookups() once then call lookupValueByKey () */ template class SortedLookupTable @@ -51,11 +49,8 @@ class SortedLookupTable private: typedef typename SchemaType::KeyType KeyType; typedef typename SchemaType::ValueType ValueType; - typedef std::vector values_t; - values_t m_values; - private: struct SortCompare { @@ -151,6 +146,9 @@ public: return found; } + +private: + values_t m_values; }; #endif diff --git a/Subtrees/beast/modules/beast_basics/diagnostic/beast_Debug.cpp b/Subtrees/beast/modules/beast_core/diagnostic/beast_Debug.cpp similarity index 100% rename from Subtrees/beast/modules/beast_basics/diagnostic/beast_Debug.cpp rename to Subtrees/beast/modules/beast_core/diagnostic/beast_Debug.cpp diff --git a/Subtrees/beast/modules/beast_basics/diagnostic/beast_Debug.h b/Subtrees/beast/modules/beast_core/diagnostic/beast_Debug.h similarity index 97% rename from Subtrees/beast/modules/beast_basics/diagnostic/beast_Debug.h rename to Subtrees/beast/modules/beast_core/diagnostic/beast_Debug.h index 205bcb0bab..5382e37e34 100644 --- a/Subtrees/beast/modules/beast_basics/diagnostic/beast_Debug.h +++ b/Subtrees/beast/modules/beast_core/diagnostic/beast_Debug.h @@ -31,8 +31,8 @@ extern bool isDebuggerAttached (); // Breaks to the debugger if a debugger is attached. extern void breakPoint (); -// VF: IS THIS REALLY THE RIGHT PLACE FOR THESE?? - +// VFALCO NOTE IS THIS REALLY THE RIGHT PLACE FOR THESE?? +// // Return only the filename portion of sourceFileName // This hides the programmer's directory structure from end-users. const String getFileNameFromPath (const char* sourceFileName); diff --git a/Subtrees/beast/modules/beast_basics/diagnostic/beast_Error.cpp b/Subtrees/beast/modules/beast_core/diagnostic/beast_Error.cpp similarity index 92% rename from Subtrees/beast/modules/beast_basics/diagnostic/beast_Error.cpp rename to Subtrees/beast/modules/beast_core/diagnostic/beast_Error.cpp index 1b6952cccc..055d89a09a 100644 --- a/Subtrees/beast/modules/beast_basics/diagnostic/beast_Error.cpp +++ b/Subtrees/beast/modules/beast_core/diagnostic/beast_Error.cpp @@ -25,7 +25,7 @@ Error::Error () { } -Error::Error (const Error& other) +Error::Error (Error const& other) : m_code (other.m_code) , m_reasonText (other.m_reasonText) , m_sourceFileName (other.m_sourceFileName) @@ -42,7 +42,7 @@ Error::~Error () noexcept bassert (!m_needsToBeChecked); } -Error& Error::operator= (const Error& other) +Error& Error::operator= (Error const& other) { m_code = other.m_code; m_reasonText = other.m_reasonText; @@ -73,12 +73,12 @@ bool Error::asBoolean () const return code () != success; } -const String Error::getReasonText () const +String const Error::getReasonText () const { return m_reasonText; } -const String Error::getSourceFilename () const +String const Error::getSourceFilename () const { return m_sourceFileName; } @@ -88,9 +88,9 @@ int Error::getLineNumber () const return m_lineNumber; } -Error& Error::fail (const char* sourceFileName, +Error& Error::fail (char const* sourceFileName, int lineNumber, - const String reasonText, + String const reasonText, Code errorCode) { bassert (m_code == success); @@ -105,7 +105,7 @@ Error& Error::fail (const char* sourceFileName, return *this; } -Error& Error::fail (const char* sourceFileName, +Error& Error::fail (char const* sourceFileName, int lineNumber, Code errorCode) { @@ -131,9 +131,9 @@ void Error::willBeReported () const m_needsToBeChecked = false; } -const char* Error::what () const noexcept +char const* Error::what () const noexcept { - if (!m_szWhat) + if (! m_szWhat) { // The application could not be initialized because sqlite was denied access permission // The application unexpectedly quit because the exception 'sqlite was denied access permission at file ' was thrown @@ -152,7 +152,7 @@ const char* Error::what () const noexcept return m_szWhat; } -const String Error::getReasonTextForCode (Code code) +String const Error::getReasonTextForCode (Code code) { String s; diff --git a/Subtrees/beast/modules/beast_basics/diagnostic/beast_Error.h b/Subtrees/beast/modules/beast_core/diagnostic/beast_Error.h similarity index 76% rename from Subtrees/beast/modules/beast_basics/diagnostic/beast_Error.h rename to Subtrees/beast/modules/beast_core/diagnostic/beast_Error.h index 1d67ffa314..c5528dccbc 100644 --- a/Subtrees/beast/modules/beast_basics/diagnostic/beast_Error.h +++ b/Subtrees/beast/modules/beast_core/diagnostic/beast_Error.h @@ -20,31 +20,28 @@ #ifndef BEAST_ERROR_BEASTHEADER #define BEAST_ERROR_BEASTHEADER -#include "beast_SafeBool.h" +/** A concise error report. -/** - A concise error report. + This lightweight but flexible class records lets you record the file and + line where a recoverable error occurred, along with some optional human + readable text. - This lightweight but flexible class records lets you record the file and - line where a recoverable error occurred, along with some optional human - readable text. + A recoverable error can be passed along and turned into a non recoverable + error by throwing the object: it's derivation from std::exception is + fully compliant with the C++ exception interface. - A recoverable error can be passed along and turned into a non recoverable - error by throwing the object: it's derivation from std::exception is - fully compliant with the C++ exception interface. - - @ingroup beast_core + @ingroup beast_core */ -class Error +class BEAST_API Error : public std::exception , public SafeBool { public: /** Numeric code. - This enumeration is useful when the caller needs to take different - actions depending on the failure. For example, trying again later if - a file is locked. + This enumeration is useful when the caller needs to take different + actions depending on the failure. For example, trying again later if + a file is locked. */ enum Code { @@ -74,8 +71,8 @@ public: }; Error (); - Error (const Error& other); - Error& operator= (const Error& other); + Error (Error const& other); + Error& operator= (Error const& other); virtual ~Error () noexcept; @@ -84,16 +81,16 @@ public: bool asBoolean () const; - const String getReasonText () const; - const String getSourceFilename () const; + String const getReasonText () const; + String const getSourceFilename () const; int getLineNumber () const; - Error& fail (const char* sourceFileName, + Error& fail (char const* sourceFileName, int lineNumber, - const String reasonText, + String const reasonText, Code errorCode = general); - Error& fail (const char* sourceFileName, + Error& fail (char const* sourceFileName, int lineNumber, Code errorCode = general); @@ -108,9 +105,9 @@ public: // for std::exception. This lets you throw an Error that should // terminate the application. The what() message will be less // descriptive so ideally you should catch the Error object instead. - const char* what () const noexcept; + char const* what () const noexcept; - static const String getReasonTextForCode (Code code); + static String const getReasonTextForCode (Code code); private: Code m_code; @@ -118,9 +115,8 @@ private: String m_sourceFileName; int m_lineNumber; mutable bool m_needsToBeChecked; - mutable String m_what; // created on demand - mutable const char* m_szWhat; + mutable char const* m_szWhat; }; #endif diff --git a/Subtrees/beast/modules/beast_basics/diagnostic/beast_FPUFlags.cpp b/Subtrees/beast/modules/beast_core/diagnostic/beast_FPUFlags.cpp similarity index 100% rename from Subtrees/beast/modules/beast_basics/diagnostic/beast_FPUFlags.cpp rename to Subtrees/beast/modules/beast_core/diagnostic/beast_FPUFlags.cpp diff --git a/Subtrees/beast/modules/beast_basics/diagnostic/beast_FPUFlags.h b/Subtrees/beast/modules/beast_core/diagnostic/beast_FPUFlags.h similarity index 99% rename from Subtrees/beast/modules/beast_basics/diagnostic/beast_FPUFlags.h rename to Subtrees/beast/modules/beast_core/diagnostic/beast_FPUFlags.h index 71b9abde8a..b1c8d51d7f 100644 --- a/Subtrees/beast/modules/beast_basics/diagnostic/beast_FPUFlags.h +++ b/Subtrees/beast/modules/beast_core/diagnostic/beast_FPUFlags.h @@ -28,7 +28,7 @@ @ingroup beast_core */ -class FPUFlags +class BEAST_API FPUFlags { public: /** An individual FPU flag */ diff --git a/Subtrees/beast/modules/beast_basics/diagnostic/beast_LeakChecked.cpp b/Subtrees/beast/modules/beast_core/diagnostic/beast_LeakChecked.cpp similarity index 100% rename from Subtrees/beast/modules/beast_basics/diagnostic/beast_LeakChecked.cpp rename to Subtrees/beast/modules/beast_core/diagnostic/beast_LeakChecked.cpp diff --git a/Subtrees/beast/modules/beast_basics/diagnostic/beast_LeakChecked.h b/Subtrees/beast/modules/beast_core/diagnostic/beast_LeakChecked.h similarity index 95% rename from Subtrees/beast/modules/beast_basics/diagnostic/beast_LeakChecked.h rename to Subtrees/beast/modules/beast_core/diagnostic/beast_LeakChecked.h index 256812d9e6..1b25f2a740 100644 --- a/Subtrees/beast/modules/beast_basics/diagnostic/beast_LeakChecked.h +++ b/Subtrees/beast/modules/beast_core/diagnostic/beast_LeakChecked.h @@ -20,18 +20,13 @@ #ifndef BEAST_LEAKCHECKED_BEASTHEADER #define BEAST_LEAKCHECKED_BEASTHEADER -#include "beast_Error.h" -#include "beast_Throw.h" -#include "../memory/beast_StaticObject.h" -#include "../containers/beast_LockFreeStack.h" - // // Derived classes are automatically leak-checked on exit // #if BEAST_USE_LEAKCHECKED -class LeakCheckedBase +class BEAST_API LeakCheckedBase { public: static void detectAllLeaks (); @@ -153,7 +148,7 @@ private: #else -class LeakCheckedBase +class BEAST_API LeakCheckedBase { private: friend class PerformedAtExit; diff --git a/Subtrees/beast/modules/beast_basics/diagnostic/beast_SafeBool.h b/Subtrees/beast/modules/beast_core/diagnostic/beast_SafeBool.h similarity index 98% rename from Subtrees/beast/modules/beast_basics/diagnostic/beast_SafeBool.h rename to Subtrees/beast/modules/beast_core/diagnostic/beast_SafeBool.h index f7fb22b6e7..be592299bb 100644 --- a/Subtrees/beast/modules/beast_basics/diagnostic/beast_SafeBool.h +++ b/Subtrees/beast/modules/beast_core/diagnostic/beast_SafeBool.h @@ -40,7 +40,7 @@ @ingroup beast_core */ -class SafeBoolBase +class BEAST_API SafeBoolBase { private: void disallowed () const { } diff --git a/Subtrees/beast/modules/beast_basics/diagnostic/beast_Throw.h b/Subtrees/beast/modules/beast_core/diagnostic/beast_Throw.h similarity index 86% rename from Subtrees/beast/modules/beast_basics/diagnostic/beast_Throw.h rename to Subtrees/beast/modules/beast_core/diagnostic/beast_Throw.h index d1116df77f..e5b3f94579 100644 --- a/Subtrees/beast/modules/beast_basics/diagnostic/beast_Throw.h +++ b/Subtrees/beast/modules/beast_core/diagnostic/beast_Throw.h @@ -22,14 +22,15 @@ #include "beast_Debug.h" -// -// Throw an exception, with the opportunity to get a -// breakpoint with the call stack before the throw. -// +/** Throw an exception, with a debugger hook. + This provides an opportunity to utilize the debugger before + the stack is unwound. +*/ template inline void Throw (Exception const& e) { + // VFALCO TODO Replace with straight JUCE equivalent Debug::breakPoint (); throw e; diff --git a/Subtrees/beast/modules/beast_basics/functor/beast_Bind.h b/Subtrees/beast/modules/beast_core/functional/beast_Bind.h similarity index 100% rename from Subtrees/beast/modules/beast_basics/functor/beast_Bind.h rename to Subtrees/beast/modules/beast_core/functional/beast_Bind.h diff --git a/Subtrees/beast/modules/beast_basics/memory/beast_AtomicCounter.h b/Subtrees/beast/modules/beast_core/memory/beast_AtomicCounter.h similarity index 98% rename from Subtrees/beast/modules/beast_basics/memory/beast_AtomicCounter.h rename to Subtrees/beast/modules/beast_core/memory/beast_AtomicCounter.h index 5d8a5f7301..978dd5a855 100644 --- a/Subtrees/beast/modules/beast_basics/memory/beast_AtomicCounter.h +++ b/Subtrees/beast/modules/beast_core/memory/beast_AtomicCounter.h @@ -30,7 +30,7 @@ @ingroup beast_core */ -class AtomicCounter +class BEAST_API AtomicCounter { public: /** Create a new counter. diff --git a/Subtrees/beast/modules/beast_basics/memory/beast_AtomicFlag.h b/Subtrees/beast/modules/beast_core/memory/beast_AtomicFlag.h similarity index 99% rename from Subtrees/beast/modules/beast_basics/memory/beast_AtomicFlag.h rename to Subtrees/beast/modules/beast_core/memory/beast_AtomicFlag.h index cb1ba7ea3f..e7d605bf63 100644 --- a/Subtrees/beast/modules/beast_basics/memory/beast_AtomicFlag.h +++ b/Subtrees/beast/modules/beast_core/memory/beast_AtomicFlag.h @@ -30,7 +30,7 @@ @ingroup beast_core */ -class AtomicFlag +class BEAST_API AtomicFlag { public: /** Create an AtomicFlag in the reset state. */ diff --git a/Subtrees/beast/modules/beast_basics/memory/beast_AtomicPointer.h b/Subtrees/beast/modules/beast_core/memory/beast_AtomicPointer.h similarity index 100% rename from Subtrees/beast/modules/beast_basics/memory/beast_AtomicPointer.h rename to Subtrees/beast/modules/beast_core/memory/beast_AtomicPointer.h diff --git a/Subtrees/beast/modules/beast_basics/memory/beast_AtomicState.h b/Subtrees/beast/modules/beast_core/memory/beast_AtomicState.h similarity index 99% rename from Subtrees/beast/modules/beast_basics/memory/beast_AtomicState.h rename to Subtrees/beast/modules/beast_core/memory/beast_AtomicState.h index 7c2cb85bb1..a3224c935f 100644 --- a/Subtrees/beast/modules/beast_basics/memory/beast_AtomicState.h +++ b/Subtrees/beast/modules/beast_core/memory/beast_AtomicState.h @@ -29,7 +29,7 @@ @ingroup beast_core */ -class AtomicState +class BEAST_API AtomicState { public: /** Create a new state with an optional starting value. diff --git a/Subtrees/beast/modules/beast_basics/memory/beast_CacheLine.h b/Subtrees/beast/modules/beast_core/memory/beast_CacheLine.h similarity index 99% rename from Subtrees/beast/modules/beast_basics/memory/beast_CacheLine.h rename to Subtrees/beast/modules/beast_core/memory/beast_CacheLine.h index 3cdd28997a..44d06640bb 100644 --- a/Subtrees/beast/modules/beast_basics/memory/beast_CacheLine.h +++ b/Subtrees/beast/modules/beast_core/memory/beast_CacheLine.h @@ -20,8 +20,6 @@ #ifndef BEAST_CACHELINE_BEASTHEADER #define BEAST_CACHELINE_BEASTHEADER -#include "beast_MemoryAlignment.h" - // Allows turning off of all padding, // e.g. for memory-constrained systems or testing. // diff --git a/Subtrees/beast/modules/beast_basics/memory/beast_MemoryAlignment.h b/Subtrees/beast/modules/beast_core/memory/beast_MemoryAlignment.h similarity index 90% rename from Subtrees/beast/modules/beast_basics/memory/beast_MemoryAlignment.h rename to Subtrees/beast/modules/beast_core/memory/beast_MemoryAlignment.h index f11f57b769..0b2e50a5ba 100644 --- a/Subtrees/beast/modules/beast_basics/memory/beast_MemoryAlignment.h +++ b/Subtrees/beast/modules/beast_core/memory/beast_MemoryAlignment.h @@ -23,7 +23,12 @@ namespace Memory { +//------------------------------------------------------------------------------ + // Constants +// +// These need to be set based on the target CPU +// const int cacheLineAlignBits = 6; // 64 bytes const int cacheLineAlignBytes = 1 << cacheLineAlignBits; @@ -33,6 +38,8 @@ const int allocAlignBits = 3; // 8 bytes const int allocAlignBytes = 1 << allocAlignBits; const int allocAlignMask = allocAlignBytes - 1; +//------------------------------------------------------------------------------ + // Returns the number of bytes needed to advance p to the correct alignment template inline size_t bytesNeededForAlignment (P const* const p) diff --git a/Subtrees/beast/modules/beast_basics/memory/beast_StaticObject.h b/Subtrees/beast/modules/beast_core/memory/beast_StaticObject.h similarity index 99% rename from Subtrees/beast/modules/beast_basics/memory/beast_StaticObject.h rename to Subtrees/beast/modules/beast_core/memory/beast_StaticObject.h index 663e42b650..b38cc852aa 100644 --- a/Subtrees/beast/modules/beast_basics/memory/beast_StaticObject.h +++ b/Subtrees/beast/modules/beast_core/memory/beast_StaticObject.h @@ -20,8 +20,6 @@ #ifndef BEAST_STATICOBJECT_BEASTHEADER #define BEAST_STATICOBJECT_BEASTHEADER -#include "../threads/beast_SpinDelay.h" - // // A full suite of thread-safe objects designed for static storage duration. // diff --git a/Subtrees/beast/modules/beast_basics/memory/beast_Uncopyable.h b/Subtrees/beast/modules/beast_core/memory/beast_Uncopyable.h similarity index 100% rename from Subtrees/beast/modules/beast_basics/memory/beast_Uncopyable.h rename to Subtrees/beast/modules/beast_core/memory/beast_Uncopyable.h diff --git a/Subtrees/beast/modules/beast_core/network/beast_Socket.cpp b/Subtrees/beast/modules/beast_core/network/beast_Socket.cpp index 30013e06a0..60e997d2b7 100644 --- a/Subtrees/beast/modules/beast_core/network/beast_Socket.cpp +++ b/Subtrees/beast/modules/beast_core/network/beast_Socket.cpp @@ -81,7 +81,7 @@ namespace SocketHelpers servTmpAddr.sin_addr.s_addr = htonl (INADDR_ANY); servTmpAddr.sin_port = htons ((uint16) port); - return bind (handle, (struct sockaddr*) &servTmpAddr, sizeof (struct sockaddr_in)) >= 0; + return ::bind (handle, (struct sockaddr*) &servTmpAddr, sizeof (struct sockaddr_in)) >= 0; } static int readSocket (const SocketHandle handle, @@ -415,7 +415,7 @@ bool StreamingSocket::createListener (const int newPortNumber, const String& loc const int reuse = 1; setsockopt (handle, SOL_SOCKET, SO_REUSEADDR, (const char*) &reuse, sizeof (reuse)); - if (bind (handle, (struct sockaddr*) &servTmpAddr, sizeof (struct sockaddr_in)) < 0 + if (::bind (handle, (struct sockaddr*) &servTmpAddr, sizeof (struct sockaddr_in)) < 0 || listen (handle, SOMAXCONN) < 0) { close(); diff --git a/Subtrees/beast/modules/beast_core/system/beast_StandardHeader.h b/Subtrees/beast/modules/beast_core/system/beast_StandardHeader.h index 1c71142752..a3b81c3b15 100644 --- a/Subtrees/beast/modules/beast_core/system/beast_StandardHeader.h +++ b/Subtrees/beast/modules/beast_core/system/beast_StandardHeader.h @@ -24,7 +24,8 @@ #ifndef BEAST_STANDARDHEADER_BEASTHEADER #define BEAST_STANDARDHEADER_BEASTHEADER -//============================================================================== +//------------------------------------------------------------------------------ + /** Current BEAST version number. See also SystemStats::getBeastVersion() for a string version. @@ -43,57 +44,80 @@ */ #define BEAST_VERSION ((BEAST_MAJOR_VERSION << 16) + (BEAST_MINOR_VERSION << 8) + BEAST_BUILDNUMBER) +//------------------------------------------------------------------------------ -//============================================================================== #include "beast_TargetPlatform.h" // (sets up the various BEAST_WINDOWS, BEAST_MAC, etc flags) #include "beast_PlatformDefs.h" -//============================================================================== // Now we'll include some common OS headers.. #if BEAST_MSVC - #pragma warning (push) - #pragma warning (disable: 4514 4245 4100) +#pragma warning (push) +#pragma warning (disable: 4514 4245 4100) #endif -#include -#include +#include +#include #include -#include -#include -#include -#include -#include -#include +#include +#include #include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #if BEAST_USE_INTRINSICS - #include +# include #endif #if BEAST_MAC || BEAST_IOS - #include +# include #endif #if BEAST_LINUX - #include - - #if __INTEL_COMPILER - #if __ia64__ - #include - #else - #include - #endif - #endif +# include +# if __INTEL_COMPILER +# if __ia64__ +# include +# else +# include +# endif +# endif #endif #if BEAST_MSVC && BEAST_DEBUG - #include +# include #endif #if BEAST_MSVC - #pragma warning (pop) +#pragma warning (pop) #endif #if BEAST_ANDROID @@ -107,8 +131,12 @@ #undef max #undef min -//============================================================================== +//------------------------------------------------------------------------------ + // DLL building settings on Windows +// +// VFALCO TODO Deprecate this +// #if BEAST_MSVC #ifdef BEAST_DLL_BUILD #define BEAST_API __declspec (dllexport) @@ -124,43 +152,38 @@ #define BEAST_API __attribute__ ((visibility("default"))) #endif -//============================================================================== +//------------------------------------------------------------------------------ + #ifndef BEAST_API - #define BEAST_API /**< This macro is added to all beast public class declarations. */ +#define BEAST_API /**< This macro is added to all beast public class declarations. */ #endif #if BEAST_MSVC && BEAST_DLL_BUILD - #define BEAST_PUBLIC_IN_DLL_BUILD(declaration) public: declaration; private: +#define BEAST_PUBLIC_IN_DLL_BUILD(decl) public: decl; private: #else - #define BEAST_PUBLIC_IN_DLL_BUILD(declaration) declaration; +#define BEAST_PUBLIC_IN_DLL_BUILD(decl) decl; #endif /** This macro is added to all beast public function declarations. */ #define BEAST_PUBLIC_FUNCTION BEAST_API BEAST_CALLTYPE -#if (! defined (BEAST_CATCH_DEPRECATED_CODE_MISUSE)) && BEAST_DEBUG && ! DOXYGEN - /** This turns on some non-essential bits of code that should prevent old code from compiling - in cases where method signatures have changed, etc. - */ - #define BEAST_CATCH_DEPRECATED_CODE_MISUSE 1 -#endif +//------------------------------------------------------------------------------ -#ifndef DOXYGEN - #define BEAST_NAMESPACE beast // This old macro is deprecated: you should just use the beast namespace directly. -#endif - -//============================================================================== -// Now include some common headers... namespace beast { - extern BEAST_API bool BEAST_CALLTYPE beast_isRunningUnderDebugger(); - extern BEAST_API void BEAST_CALLTYPE logAssertion (const char* file, int line) noexcept; - #include "../memory/beast_Memory.h" - #include "../maths/beast_MathsFunctions.h" - #include "../memory/beast_ByteOrder.h" - #include "../logging/beast_Logger.h" - #include "../memory/beast_LeakedObjectDetector.h" +extern BEAST_API bool BEAST_CALLTYPE beast_isRunningUnderDebugger(); +extern BEAST_API void BEAST_CALLTYPE logAssertion (char const* file, int line) noexcept; + +// These are so common that we include them early + +#include "../memory/beast_Uncopyable.h" +#include "../memory/beast_Memory.h" +#include "../maths/beast_MathsFunctions.h" +#include "../memory/beast_ByteOrder.h" +#include "../logging/beast_Logger.h" +#include "../memory/beast_LeakedObjectDetector.h" + } -#endif // BEAST_STANDARDHEADER_BEASTHEADER +#endif diff --git a/Subtrees/beast/modules/beast_basics/threads/beast_SpinDelay.h b/Subtrees/beast/modules/beast_core/threads/beast_SpinDelay.h similarity index 98% rename from Subtrees/beast/modules/beast_basics/threads/beast_SpinDelay.h rename to Subtrees/beast/modules/beast_core/threads/beast_SpinDelay.h index 03694706a1..97cf720061 100644 --- a/Subtrees/beast/modules/beast_basics/threads/beast_SpinDelay.h +++ b/Subtrees/beast/modules/beast_core/threads/beast_SpinDelay.h @@ -24,7 +24,7 @@ // Synchronization element // -class SpinDelay +class BEAST_API SpinDelay { public: SpinDelay () : m_count (0) diff --git a/Subtrees/beast/modules/beast_basics/events/beast_PerformedAtExit.cpp b/Subtrees/beast/modules/beast_core/time/beast_PerformedAtExit.cpp similarity index 75% rename from Subtrees/beast/modules/beast_basics/events/beast_PerformedAtExit.cpp rename to Subtrees/beast/modules/beast_core/time/beast_PerformedAtExit.cpp index 896dc98c00..4bcf1001be 100644 --- a/Subtrees/beast/modules/beast_basics/events/beast_PerformedAtExit.cpp +++ b/Subtrees/beast/modules/beast_core/time/beast_PerformedAtExit.cpp @@ -17,13 +17,13 @@ */ //============================================================================== -class PerformedAtExit::Performer +class PerformedAtExit::ExitHook { public: typedef Static::Storage , PerformedAtExit> StackType; private: - ~Performer () + ~ExitHook () { PerformedAtExit* object = s_list->pop_front (); @@ -48,19 +48,23 @@ private: static StackType s_list; - static Performer s_performer; + static ExitHook s_performer; }; -PerformedAtExit::Performer PerformedAtExit::Performer::s_performer; -PerformedAtExit::Performer::StackType PerformedAtExit::Performer::s_list; +PerformedAtExit::ExitHook PerformedAtExit::ExitHook::s_performer; +PerformedAtExit::ExitHook::StackType PerformedAtExit::ExitHook::s_list; PerformedAtExit::PerformedAtExit () { #if BEAST_IOS - // TODO: PerformedAtExit::Performer::push_front crashes on iOS if s_storage is not accessed before used - char* hack = PerformedAtExit::Performer::s_list.s_storage; + // Patrick Dehne: + // PerformedAtExit::ExitHook::push_front crashes on iOS + // if s_storage is not accessed before used + // + // VFALCO TODO Figure out why and fix it cleanly if needed. + // + char* hack = PerformedAtExit::ExitHook::s_list.s_storage; #endif - Performer::push_front (this); + ExitHook::push_front (this); } - diff --git a/Subtrees/beast/modules/beast_basics/events/beast_PerformedAtExit.h b/Subtrees/beast/modules/beast_core/time/beast_PerformedAtExit.h similarity index 84% rename from Subtrees/beast/modules/beast_basics/events/beast_PerformedAtExit.h rename to Subtrees/beast/modules/beast_core/time/beast_PerformedAtExit.h index 7bd0abbd41..ce8801ecee 100644 --- a/Subtrees/beast/modules/beast_basics/events/beast_PerformedAtExit.h +++ b/Subtrees/beast/modules/beast_core/time/beast_PerformedAtExit.h @@ -20,8 +20,6 @@ #ifndef BEAST_PERFORMEDATEXIT_BEASTHEADER #define BEAST_PERFORMEDATEXIT_BEASTHEADER -#include "../containers/beast_LockFreeStack.h" - /*============================================================================*/ /** Perform an action at program exit @@ -32,7 +30,11 @@ @ingroup beast_core */ -class PerformedAtExit : public LockFreeStack ::Node +// VFALCO TODO Make the linked list element a private type and use composition +// instead of inheritance, so that PerformedAtExit doesn't expose +// lock free stack node interfaces. +// +class BEAST_API PerformedAtExit : public LockFreeStack ::Node { protected: PerformedAtExit (); @@ -44,7 +46,7 @@ protected: virtual void performAtExit () = 0; private: - class Performer; + class ExitHook; }; #endif diff --git a/TODO.txt b/TODO.txt index a168f5f9af..d458afddb4 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,19 +1,61 @@ -------------------------------------------------------------------------------- -TODO +BEAST TODO -------------------------------------------------------------------------------- +- Decide if headers should just include BeastConfig.h instead of making the + host program do it. + +- Rename malloc/calloc JUCE members that conflict with the debug CRT from MSVC + +- Make beast::HashMap support assignment via operator[] + +- Reformat every Doxygen comment +- Fix Doxygen metatags +- update Beast Doxyfile + +- Rename include guards to boost style, e.g. BEAST_THROW_H_INCLUDED + +- Decide if we should get rid of AtomicCounter, AtomicFlag, AtomicPointer, AtomicState + +- Clean up CacheLine, StaticObject + +- Clean up ConcurrentObject + +- Rename ConcurrentState to SharedState or something? + +- Figure out what to do with ReadWriteLock, and NamedPipe which uses it? + +- Put BEAST_PUBLIC_FUNCTION in front of all loose functions + +- restructure the repo sources to look like this: + /Source/beast/beast_core/beast_core.h + etc... +- Put the BeastConfig.h at the root of the repo. +- Make sure the template BeastConfig.h is included in the Doxyfile + +- Implement robust key/value database with bulk write + +-------------------------------------------------------------------------------- +RIPPLE TODO +-------------------------------------------------------------------------------- + +- Restructure the ripple sources to have this directory structure: + /Source/ripple/ripple_core/ripple_core.h + etc... + +- Turn on MSVC debug CRT heap checking with file and line reporting + - Replace all NULL with nullptr -- Make beast::HashMap support assignment via operator[] - Rewrite TxFormats to use beast containers and RAII, and not leak - Add ICore interface - Make TxFormats a member of ICore instead of a singleton. - Rename LoadMonitor to LoadMeter, change LoadEvent to LoadMeter::ScopedSample -- Rewrite every beast Doxygen comment, update Beast Doxyfile +- Rename include guards to boost style, e.g. RIPPLE_LOG_H_INCLUDED -- Rename ripple/beast include guards to boost style, e.g. RIPPLE_LOG_H_INCLUDED +- Replace C11X with BEAST_COMPILER_SUPPORTS_MOVE_SEMANTICS - Fix all leaks on exit (!)