diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2021-04-30 13:09:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-30 13:09:45 +0200 |
commit | f66b7cbbe653e05ae48f21d6829e72d1a30c20ff (patch) | |
tree | 985b3f144ca030a426f1a744d5ad75ad0d25272f /TAO/tao | |
parent | 305e47ef87aafb89752819e579df479ab82ce56e (diff) | |
parent | f250f6afd0be9024db716148084569b6fd6201df (diff) | |
download | ATCD-f66b7cbbe653e05ae48f21d6829e72d1a30c20ff.tar.gz |
Merge pull request #1491 from jwillemsen/jwi-ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES2
Removed support for ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES, only set …
Diffstat (limited to 'TAO/tao')
-rw-r--r-- | TAO/tao/TAO_Singleton.cpp | 23 | ||||
-rw-r--r-- | TAO/tao/TAO_Singleton.h | 21 |
2 files changed, 8 insertions, 36 deletions
diff --git a/TAO/tao/TAO_Singleton.cpp b/TAO/tao/TAO_Singleton.cpp index 3ca35d08ca4..58d96602e2e 100644 --- a/TAO/tao/TAO_Singleton.cpp +++ b/TAO/tao/TAO_Singleton.cpp @@ -27,26 +27,16 @@ TAO_Singleton<TYPE, ACE_LOCK>::dump (void) #if defined (ACE_HAS_DUMP) ACE_TRACE ("TAO_Singleton<TYPE, ACE_LOCK>::dump"); -#if !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) TAOLIB_DEBUG ((LM_DEBUG, ACE_TEXT ("instance_ = %@"), TAO_Singleton<TYPE, ACE_LOCK>::instance_i ())); TAOLIB_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */ #endif /* ACE_HAS_DUMP */ } template <class TYPE, class ACE_LOCK> TAO_Singleton<TYPE, ACE_LOCK> *& TAO_Singleton<TYPE, ACE_LOCK>::instance_i (void) { -#if defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) - // Pointer to the Singleton instance. This works around a bug with - // G++ and it's (mis-)handling of templates and statics... - static TAO_Singleton<TYPE, ACE_LOCK> *singleton_ = 0; - - return singleton_; -#else return TAO_Singleton<TYPE, ACE_LOCK>::singleton_; -#endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */ } template <class TYPE, class ACE_LOCK> TYPE * @@ -120,15 +110,12 @@ TAO_Singleton<TYPE, ACE_LOCK>::cleanup (void *param) #endif } -#if !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) // Pointer to the Singleton instance. template <class TYPE, class ACE_LOCK> TAO_Singleton<TYPE, ACE_LOCK> * TAO_Singleton<TYPE, ACE_LOCK>::singleton_ = 0; template <class TYPE, class ACE_LOCK> TAO_TSS_Singleton<TYPE, ACE_LOCK> * TAO_TSS_Singleton<TYPE, ACE_LOCK>::singleton_ = 0; -#endif /* !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) */ - template <class TYPE, class ACE_LOCK> void TAO_TSS_Singleton<TYPE, ACE_LOCK>::dump (void) @@ -136,26 +123,16 @@ TAO_TSS_Singleton<TYPE, ACE_LOCK>::dump (void) #if defined (ACE_HAS_DUMP) ACE_TRACE ("TAO_TSS_Singleton<TYPE, ACE_LOCK>::dump"); -#if !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) TAOLIB_DEBUG ((LM_DEBUG, ACE_TEXT ("instance_ = %@"), TAO_TSS_Singleton<TYPE, ACE_LOCK>::instance_i ())); TAOLIB_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */ #endif /* ACE_HAS_DUMP */ } template <class TYPE, class ACE_LOCK> TAO_TSS_Singleton<TYPE, ACE_LOCK> *& TAO_TSS_Singleton<TYPE, ACE_LOCK>::instance_i (void) { -#if defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) - // Pointer to the Singleton instance. This works around a bug with - // G++ and it's (mis-)handling of templates and statics... - static TAO_TSS_Singleton<TYPE, ACE_LOCK> *singleton_ = 0; - - return singleton_; -#else return TAO_TSS_Singleton<TYPE, ACE_LOCK>::singleton_; -#endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */ } template <class TYPE, class ACE_LOCK> TYPE * diff --git a/TAO/tao/TAO_Singleton.h b/TAO/tao/TAO_Singleton.h index 1da38566c7e..a4563cb3c81 100644 --- a/TAO/tao/TAO_Singleton.h +++ b/TAO/tao/TAO_Singleton.h @@ -47,29 +47,27 @@ class TAO_Singleton : public ACE_Cleanup public: /// Global access point to the Singleton. - static TYPE *instance (void); + static TYPE *instance (); /// Cleanup method, used by @c ace_cleanup_destroyer to destroy the /// singleton. virtual void cleanup (void *param = 0); /// Dump the state of the object. - static void dump (void); + static void dump (); protected: /// Default constructor. - TAO_Singleton (void); + TAO_Singleton (); /// Contained instance. TYPE instance_; -#if !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) /// Pointer to the Singleton (ACE_Cleanup) instance. static TAO_Singleton<TYPE, ACE_LOCK> *singleton_; -#endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */ /// Get pointer to the TAO Singleton instance. - static TAO_Singleton<TYPE, ACE_LOCK> *&instance_i (void); + static TAO_Singleton<TYPE, ACE_LOCK> *&instance_i (); }; /** @@ -87,32 +85,29 @@ template <class TYPE, class ACE_LOCK> class TAO_TSS_Singleton : public ACE_Cleanup, private ACE_Copy_Disabled { - public: /// Global access point to the Singleton. - static TYPE *instance (void); + static TYPE *instance (); /// Cleanup method, used by @c ace_cleanup_destroyer to destroy the /// singleton. virtual void cleanup (void *param = 0); /// Dump the state of the object. - static void dump (void); + static void dump (); protected: /// Default constructor. - TAO_TSS_Singleton (void); + TAO_TSS_Singleton (); /// Contained instance. ACE_TSS_TYPE (TYPE) instance_; -#if !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) /// Pointer to the Singleton (ACE_Cleanup) instance. static TAO_TSS_Singleton<TYPE, ACE_LOCK> *singleton_; -#endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */ /// Get pointer to the TAO TSS Singleton instance. - static TAO_TSS_Singleton<TYPE, ACE_LOCK> *&instance_i (void); + static TAO_TSS_Singleton<TYPE, ACE_LOCK> *&instance_i (); }; TAO_END_VERSIONED_NAMESPACE_DECL |