mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-09 23:34:20 +00:00
Singleton: Add new macros to simplify singleton creation
The INLINE macros allow singletons to be declared and defined in one line, without requiring a separate JUCE_IMPLEMENT_SINGLETON statement.
This commit is contained in:
parent
5179f4e720
commit
80ac9a78a0
44 changed files with 69 additions and 138 deletions
|
|
@ -45,7 +45,7 @@ public:
|
|||
AllComponentRepainter() {}
|
||||
~AllComponentRepainter() override { clearSingletonInstance(); }
|
||||
|
||||
JUCE_DECLARE_SINGLETON (AllComponentRepainter, false)
|
||||
JUCE_DECLARE_SINGLETON_INLINE (AllComponentRepainter, false)
|
||||
|
||||
void trigger()
|
||||
{
|
||||
|
|
@ -94,9 +94,6 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
JUCE_IMPLEMENT_SINGLETON (AllComponentRepainter)
|
||||
JUCE_IMPLEMENT_SINGLETON (ValueList)
|
||||
|
||||
//==============================================================================
|
||||
int64 parseInt (String s)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ namespace juce::LiveConstantEditor
|
|||
ValueList();
|
||||
~ValueList() override;
|
||||
|
||||
JUCE_DECLARE_SINGLETON (ValueList, false)
|
||||
JUCE_DECLARE_SINGLETON_INLINE (ValueList, false)
|
||||
|
||||
template <typename Type>
|
||||
LiveValue<Type>& getValue (const char* file, int line, const Type& initialValue)
|
||||
|
|
|
|||
|
|
@ -81,8 +81,6 @@ PushNotifications::Notification::Notification (const Notification& other)
|
|||
}
|
||||
|
||||
//==============================================================================
|
||||
JUCE_IMPLEMENT_SINGLETON (PushNotifications)
|
||||
|
||||
PushNotifications::PushNotifications()
|
||||
#if JUCE_PUSH_NOTIFICATIONS
|
||||
: pimpl (new Pimpl (*this))
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class JUCE_API PushNotifications : private DeletedAtShutdown
|
|||
{
|
||||
public:
|
||||
#ifndef DOXYGEN
|
||||
JUCE_DECLARE_SINGLETON (PushNotifications, false)
|
||||
JUCE_DECLARE_SINGLETON_INLINE (PushNotifications, false)
|
||||
#endif
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ public:
|
|||
(gpointer), void)
|
||||
|
||||
//==============================================================================
|
||||
JUCE_DECLARE_SINGLETON_SINGLETHREADED_MINIMAL (WebKitSymbols)
|
||||
JUCE_DECLARE_SINGLETON_SINGLETHREADED_MINIMAL_INLINE (WebKitSymbols)
|
||||
|
||||
private:
|
||||
WebKitSymbols() = default;
|
||||
|
|
@ -417,8 +417,6 @@ private:
|
|||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WebKitSymbols)
|
||||
};
|
||||
|
||||
JUCE_IMPLEMENT_SINGLETON (WebKitSymbols)
|
||||
|
||||
//==============================================================================
|
||||
extern "C" int juce_gtkWebkitMain (int argc, const char* const* argv);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue