Added new LLSINGLETON macro that includes override keyword.

master
Rider Linden 2019-01-04 14:03:02 -08:00
parent 1ee1a086ce
commit e9a2e8f88c
2 changed files with 16 additions and 1 deletions

View File

@ -492,6 +492,17 @@ private: \
friend class LLSingleton<DERIVED_CLASS>; \
DERIVED_CLASS()
/**
* A slight variance from the above, but includes the "override" keyword
*/
#define LLSINGLETON_C11(DERIVED_CLASS) \
private: \
/* implement LLSingleton pure virtual method whose sole purpose */ \
/* is to remind people to use this macro */ \
virtual void you_must_use_LLSINGLETON_macro() override {} \
friend class LLSingleton<DERIVED_CLASS>; \
DERIVED_CLASS()
/**
* Use LLSINGLETON_EMPTY_CTOR(Foo); at the start of an LLSingleton<Foo>
* subclass body when the constructor is trivial:
@ -510,4 +521,8 @@ private: \
/* LLSINGLETON() is carefully implemented to permit exactly this */ \
LLSINGLETON(DERIVED_CLASS) {}
#define LLSINGLETON_EMPTY_CTOR_C11(DERIVED_CLASS) \
/* LLSINGLETON() is carefully implemented to permit exactly this */ \
LLSINGLETON_C11(DERIVED_CLASS) {}
#endif

View File

@ -41,7 +41,7 @@ class LLViewerRegion;
*/
class LLEstateInfoModel : public LLSingleton<LLEstateInfoModel>
{
LLSINGLETON(LLEstateInfoModel);
LLSINGLETON_C11(LLEstateInfoModel);
LOG_CLASS(LLEstateInfoModel);
public: