diff --git a/Builds/VisualStudio2012/beast.vcxproj b/Builds/VisualStudio2012/beast.vcxproj
index 9b1d39a8bf..ecb2bf124b 100644
--- a/Builds/VisualStudio2012/beast.vcxproj
+++ b/Builds/VisualStudio2012/beast.vcxproj
@@ -68,7 +68,6 @@
-
@@ -78,7 +77,6 @@
-
@@ -126,12 +124,12 @@
-
+
@@ -149,6 +147,7 @@
+
@@ -174,6 +173,7 @@
+
@@ -274,18 +274,6 @@
true
true
-
- true
- true
- true
- true
-
-
- true
- true
- true
- true
-
true
true
@@ -569,6 +557,12 @@
true
true
+
+ true
+ true
+ true
+ true
+
true
true
@@ -581,6 +575,12 @@
true
true
+
+ true
+ true
+ true
+ true
+
true
true
@@ -894,6 +894,9 @@
true
+
+
+
{73C5A0F0-7629-4DE7-9194-BE7AC6C19535}
Win32Proj
diff --git a/Builds/VisualStudio2012/beast.vcxproj.filters b/Builds/VisualStudio2012/beast.vcxproj.filters
index d7d86413e1..8fb34fe73e 100644
--- a/Builds/VisualStudio2012/beast.vcxproj.filters
+++ b/Builds/VisualStudio2012/beast.vcxproj.filters
@@ -110,15 +110,9 @@
{9e850052-6ab7-4a65-911d-adfde81ceb5f}
-
- {811c5374-8959-4df9-aba9-a7e27b85046e}
-
{f58dddf7-fe43-49a2-8e57-91feba586119}
-
- {b70d6403-2d7a-4377-81ff-390830ab0276}
-
{69e28551-92ea-420b-a465-75ed248e3b59}
@@ -482,9 +476,6 @@
beast_basics\functor
-
- beast_basics\math
-
beast_basics\math
@@ -512,9 +503,6 @@
beast_basics\memory
-
- beast_basics\memory
-
beast_basics\threads
@@ -557,9 +545,6 @@
beast_core\containers
-
- beast_core\functional
-
beast_core\memory
@@ -617,6 +602,15 @@
beast_core\memory
+
+ beast_core\memory
+
+
+ beast_core\system
+
+
+ beast_core\maths
+
@@ -892,12 +886,6 @@
beast_basics\memory
-
- beast_basics\native
-
-
- beast_basics\native
-
beast_basics\threads
@@ -955,5 +943,14 @@
beast_core\threads
+
+ beast_core\native
+
+
+ beast_core\native
+
+
+
+
\ No newline at end of file
diff --git a/TODO.txt b/TODO.txt
new file mode 100644
index 0000000000..e41f977fd9
--- /dev/null
+++ b/TODO.txt
@@ -0,0 +1,50 @@
+--------------------------------------------------------------------------------
+BEAST TODO
+--------------------------------------------------------------------------------
+
+- Tidy up CacheLine, MemoryAlignment
+
+- Kill off beast_Singleton.h since it uses macros
+
+- Remove anything having to do with DLL builds like
+ BEAST_DLL, BEAST_DLL_BUILD, BEAST_DISABLE_DLL_ALLOCATORS
+
+- Fix FifoFreeStoreWithTLS reference counting bug
+
+- Implement a reasonable substitute for boost's thread_local_storage
+
+- Think about doing away with BEAST_CALLTYPE and BEAST_API
+
+- 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
+
diff --git a/modules/beast_basics/beast_basics.cpp b/modules/beast_basics/beast_basics.cpp
index ef990ae610..ca2b3fca2b 100644
--- a/modules/beast_basics/beast_basics.cpp
+++ b/modules/beast_basics/beast_basics.cpp
@@ -62,13 +62,6 @@ namespace beast
#include "threads/beast_ThreadGroup.cpp"
#include "threads/beast_ThreadWithCallQueue.cpp"
-#if BEAST_WINDOWS
-#include "native/beast_win32_FPUFlags.cpp"
-
-#else
-#include "native/beast_posix_FPUFlags.cpp"
-
-#endif
}
#if BEAST_MSVC
diff --git a/modules/beast_basics/beast_basics.h b/modules/beast_basics/beast_basics.h
index cfbfdfaa28..d323cab858 100644
--- a/modules/beast_basics/beast_basics.h
+++ b/modules/beast_basics/beast_basics.h
@@ -248,11 +248,9 @@ namespace beast
#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_AllocatedBy.h"
-#include "memory/beast_RefCountedSingleton.h"
#include "memory/beast_PagedFreeStore.h"
#include "memory/beast_GlobalPagedFreeStore.h"
#include "memory/beast_FifoFreeStoreWithTLS.h"
diff --git a/modules/beast_basics/events/beast_OncePerSecond.cpp b/modules/beast_basics/events/beast_OncePerSecond.cpp
index 8311b397fb..7f5bbda7e6 100644
--- a/modules/beast_basics/events/beast_OncePerSecond.cpp
+++ b/modules/beast_basics/events/beast_OncePerSecond.cpp
@@ -18,12 +18,12 @@
//==============================================================================
class OncePerSecond::TimerSingleton
- : public RefCountedSingleton
+ : public SharedSingleton
, private InterruptibleThread::EntryPoint
{
private:
TimerSingleton ()
- : RefCountedSingleton (
+ : SharedSingleton (
SingletonLifetime::persistAfterCreation)
, m_thread ("Once Per Second")
{
diff --git a/modules/beast_basics/math/beast_MurmurHash.h b/modules/beast_basics/math/beast_MurmurHash.h
index f412bff897..0f1e8c2385 100644
--- a/modules/beast_basics/math/beast_MurmurHash.h
+++ b/modules/beast_basics/math/beast_MurmurHash.h
@@ -22,7 +22,7 @@
// Original source code links in .cpp file
-// This file depends on some Juce declarations and defines
+// This file depends on some Beast declarations and defines
namespace Murmur
{
diff --git a/modules/beast_basics/memory/beast_GlobalFifoFreeStore.h b/modules/beast_basics/memory/beast_GlobalFifoFreeStore.h
index 6b159d38c6..987a584cde 100644
--- a/modules/beast_basics/memory/beast_GlobalFifoFreeStore.h
+++ b/modules/beast_basics/memory/beast_GlobalFifoFreeStore.h
@@ -27,7 +27,7 @@
@ingroup beast_concurrent
*/
template
-class GlobalFifoFreeStore : public RefCountedSingleton >
+class GlobalFifoFreeStore : public SharedSingleton >
{
public:
inline void* allocate (size_t bytes)
@@ -47,7 +47,7 @@ public:
private:
GlobalFifoFreeStore ()
- : RefCountedSingleton >
+ : SharedSingleton >
(SingletonLifetime::persistAfterCreation)
{
}
diff --git a/modules/beast_basics/memory/beast_GlobalPagedFreeStore.cpp b/modules/beast_basics/memory/beast_GlobalPagedFreeStore.cpp
index 1b3cd6d504..1074728c51 100644
--- a/modules/beast_basics/memory/beast_GlobalPagedFreeStore.cpp
+++ b/modules/beast_basics/memory/beast_GlobalPagedFreeStore.cpp
@@ -27,7 +27,7 @@ static const size_t globalPageBytes = 8 * 1024;
}
GlobalPagedFreeStore::GlobalPagedFreeStore ()
- : RefCountedSingleton (SingletonLifetime::persistAfterCreation)
+ : SharedSingleton (SingletonLifetime::persistAfterCreation)
, m_allocator (globalPageBytes)
{
}
diff --git a/modules/beast_basics/memory/beast_GlobalPagedFreeStore.h b/modules/beast_basics/memory/beast_GlobalPagedFreeStore.h
index 1adc9b595f..17c88af013 100644
--- a/modules/beast_basics/memory/beast_GlobalPagedFreeStore.h
+++ b/modules/beast_basics/memory/beast_GlobalPagedFreeStore.h
@@ -27,7 +27,7 @@
@ingroup beast_concurrent
*/
class BEAST_API GlobalPagedFreeStore
- : public RefCountedSingleton
+ : public SharedSingleton
, LeakChecked
{
private:
diff --git a/modules/beast_basics/threads/beast_GlobalThreadGroup.h b/modules/beast_basics/threads/beast_GlobalThreadGroup.h
index 995bbcce3b..38bf7dd013 100644
--- a/modules/beast_basics/threads/beast_GlobalThreadGroup.h
+++ b/modules/beast_basics/threads/beast_GlobalThreadGroup.h
@@ -29,13 +29,13 @@
@ingroup beast_concurrent
*/
class BEAST_API GlobalThreadGroup : public ThreadGroup,
- public RefCountedSingleton
+ public SharedSingleton
{
private:
- friend class RefCountedSingleton ;
+ friend class SharedSingleton ;
GlobalThreadGroup ()
- : RefCountedSingleton (
+ : SharedSingleton (
SingletonLifetime::persistAfterCreation)
{
}
diff --git a/modules/beast_core/beast_core.cpp b/modules/beast_core/beast_core.cpp
index 55a8ab682c..5a18ba707d 100644
--- a/modules/beast_core/beast_core.cpp
+++ b/modules/beast_core/beast_core.cpp
@@ -221,6 +221,12 @@ namespace beast
#include "native/beast_osx_ObjCHelpers.h"
#endif
+#if BEAST_WINDOWS
+#include "native/beast_win32_FPUFlags.cpp"
+#else
+#include "native/beast_posix_FPUFlags.cpp"
+#endif
+
#if BEAST_ANDROID
#include "native/beast_android_JNIHelpers.h"
#endif
diff --git a/modules/beast_core/beast_core.h b/modules/beast_core/beast_core.h
index 8510f7f64d..908f4f27ff 100644
--- a/modules/beast_core/beast_core.h
+++ b/modules/beast_core/beast_core.h
@@ -209,13 +209,10 @@ namespace beast
#include "threads/beast_SpinDelay.h"
#include "memory/beast_StaticObject.h"
#include "diagnostic/beast_LeakChecked.h"
-
#include "memory/beast_Memory.h"
#include "memory/beast_ByteOrder.h"
#include "logging/beast_Logger.h"
-
#include "threads/beast_Thread.h"
-
#include "diagnostic/beast_Debug.h"
#include "diagnostic/beast_SafeBool.h"
#include "diagnostic/beast_Error.h"
@@ -247,12 +244,12 @@ namespace beast
#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_Interval.h"
#include "maths/beast_MathsFunctions.h"
#include "maths/beast_Random.h"
#include "maths/beast_Range.h"
@@ -263,6 +260,9 @@ namespace beast
#include "memory/beast_OptionalScopedPointer.h"
#include "memory/beast_ReferenceCountedObject.h"
#include "memory/beast_ScopedPointer.h"
+#include "threads/beast_SpinLock.h"
+#include "time/beast_PerformedAtExit.h"
+#include "memory/beast_SharedSingleton.h"
#include "memory/beast_Singleton.h"
#include "memory/beast_WeakReference.h"
#include "memory/beast_MemoryAlignment.h"
@@ -283,6 +283,7 @@ namespace beast
#include "streams/beast_MemoryOutputStream.h"
#include "streams/beast_OutputStream.h"
#include "streams/beast_SubregionStream.h"
+#include "system/beast_Functional.h"
#include "system/beast_PlatformDefs.h"
#include "system/beast_StandardHeader.h"
#include "system/beast_SystemStats.h"
@@ -310,13 +311,11 @@ namespace beast
#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"
diff --git a/modules/beast_core/diagnostic/beast_FPUFlags.cpp b/modules/beast_core/diagnostic/beast_FPUFlags.cpp
index 8e83e14864..39eb589cfc 100644
--- a/modules/beast_core/diagnostic/beast_FPUFlags.cpp
+++ b/modules/beast_core/diagnostic/beast_FPUFlags.cpp
@@ -17,7 +17,7 @@
*/
//==============================================================================
-void FPUFlags::clearUnsetFlagsFrom (const FPUFlags& flags)
+void FPUFlags::clearUnsetFlagsFrom (FPUFlags const& flags)
{
if (!flags.getMaskNaNs ().is_set ()) m_maskNaNs.clear ();
diff --git a/modules/beast_basics/math/beast_Interval.h b/modules/beast_core/maths/beast_Interval.h
similarity index 100%
rename from modules/beast_basics/math/beast_Interval.h
rename to modules/beast_core/maths/beast_Interval.h
diff --git a/modules/beast_basics/memory/beast_RefCountedSingleton.h b/modules/beast_core/memory/beast_SharedSingleton.h
similarity index 88%
rename from modules/beast_basics/memory/beast_RefCountedSingleton.h
rename to modules/beast_core/memory/beast_SharedSingleton.h
index cb8e3d2a69..ac96ae3bf0 100644
--- a/modules/beast_basics/memory/beast_RefCountedSingleton.h
+++ b/modules/beast_core/memory/beast_SharedSingleton.h
@@ -28,7 +28,7 @@
class Object must provide the function `Object* Object::createInstance()`
- @class RefCountedSingleton
+ @class SharedSingleton
@ingroup beast_core
*/
/** @{ */
@@ -42,7 +42,7 @@ public:
// - ville
//
- /** Construction options for RefCountedSingleton
+ /** Construction options for SharedSingleton
@ingroup beast_core
*/
@@ -66,7 +66,7 @@ public:
//------------------------------------------------------------------------------
template
-class RefCountedSingleton
+class SharedSingleton
: public SingletonLifetime
, private PerformedAtExit
{
@@ -77,7 +77,7 @@ protected:
@param lifetime The lifetime management option.
*/
- explicit RefCountedSingleton (Lifetime const lifetime)
+ explicit SharedSingleton (Lifetime const lifetime)
: m_lifetime (lifetime)
{
bassert (s_instance == nullptr);
@@ -94,7 +94,7 @@ protected:
*s_created = true;
}
- virtual ~RefCountedSingleton ()
+ virtual ~SharedSingleton ()
{
bassert (s_instance == nullptr);
}
@@ -181,20 +181,20 @@ private:
private:
static Object* s_instance;
- static Static::Storage > s_mutex;
- static Static::Storage > s_created;
+ static Static::Storage > s_mutex;
+ static Static::Storage > s_created;
};
/** @{ */
template
-Object* RefCountedSingleton