diff options
Diffstat (limited to 'ACE/ace/Singleton.cpp')
-rw-r--r-- | ACE/ace/Singleton.cpp | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/ACE/ace/Singleton.cpp b/ACE/ace/Singleton.cpp index 758c647d10b..69d8ec64136 100644 --- a/ACE/ace/Singleton.cpp +++ b/ACE/ace/Singleton.cpp @@ -32,26 +32,16 @@ ACE_Singleton<TYPE, ACE_LOCK>::dump () #if defined (ACE_HAS_DUMP) ACE_TRACE ("ACE_Singleton<TYPE, ACE_LOCK>::dump"); -#if !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("instance_ = %x"), ACE_Singleton<TYPE, ACE_LOCK>::instance_i ())); ACELIB_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */ #endif /* ACE_HAS_DUMP */ } template <class TYPE, class ACE_LOCK> ACE_Singleton<TYPE, ACE_LOCK> *& ACE_Singleton<TYPE, ACE_LOCK>::instance_i () { -#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 ACE_Singleton<TYPE, ACE_LOCK> *singleton_ = 0; - - return singleton_; -#else return ACE_Singleton<TYPE, ACE_LOCK>::singleton_; -#endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */ } template <class TYPE, class ACE_LOCK> TYPE * @@ -145,14 +135,12 @@ ACE_Singleton<TYPE, ACE_LOCK>::close () } } -#if !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) // Pointer to the Singleton instance. template <class TYPE, class ACE_LOCK> ACE_Singleton<TYPE, ACE_LOCK> * ACE_Singleton<TYPE, ACE_LOCK>::singleton_ = 0; template <class TYPE, class ACE_LOCK> ACE_Unmanaged_Singleton<TYPE, ACE_LOCK> * ACE_Unmanaged_Singleton<TYPE, ACE_LOCK>::singleton_ = 0; -#endif /* !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) */ template <class TYPE, class ACE_LOCK> void ACE_Unmanaged_Singleton<TYPE, ACE_LOCK>::dump () @@ -160,11 +148,9 @@ ACE_Unmanaged_Singleton<TYPE, ACE_LOCK>::dump () #if defined (ACE_HAS_DUMP) ACE_TRACE ("ACE_Unmanaged_Singleton<TYPE, ACE_LOCK>::dump"); -#if !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("instance_ = %x"), ACE_Unmanaged_Singleton<TYPE, ACE_LOCK>::instance_i ())); ACELIB_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */ #endif /* ACE_HAS_DUMP */ } @@ -172,15 +158,7 @@ template <class TYPE, class ACE_LOCK> ACE_Unmanaged_Singleton<TYPE, ACE_LOCK> *& ACE_Unmanaged_Singleton<TYPE, ACE_LOCK>::instance_i () { -#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 ACE_Unmanaged_Singleton<TYPE, ACE_LOCK> *singleton_ = 0; - - return singleton_; -#else return ACE_Unmanaged_Singleton<TYPE, ACE_LOCK>::singleton_; -#endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */ } template <class TYPE, class ACE_LOCK> TYPE * @@ -255,26 +233,16 @@ ACE_TSS_Singleton<TYPE, ACE_LOCK>::dump () #if defined (ACE_HAS_DUMP) ACE_TRACE ("ACE_TSS_Singleton<TYPE, ACE_LOCK>::dump"); -#if !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("instance_ = %x"), ACE_TSS_Singleton<TYPE, ACE_LOCK>::instance_i ())); ACELIB_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */ #endif /* ACE_HAS_DUMP */ } template <class TYPE, class ACE_LOCK> ACE_TSS_Singleton<TYPE, ACE_LOCK> *& ACE_TSS_Singleton<TYPE, ACE_LOCK>::instance_i () { -#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 ACE_TSS_Singleton<TYPE, ACE_LOCK> *singleton_ = 0; - - return singleton_; -#else return ACE_TSS_Singleton<TYPE, ACE_LOCK>::singleton_; -#endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */ } template <class TYPE, class ACE_LOCK> TYPE * @@ -348,11 +316,9 @@ ACE_Unmanaged_TSS_Singleton<TYPE, ACE_LOCK>::dump () #if defined (ACE_HAS_DUMP) ACE_TRACE ("ACE_Unmanaged_TSS_Singleton<TYPE, ACE_LOCK>::dump"); -#if !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("instance_ = %x"), ACE_Unmanaged_TSS_Singleton<TYPE, ACE_LOCK>::instance_i ())); ACELIB_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */ #endif /* ACE_HAS_DUMP */ } @@ -360,15 +326,7 @@ template <class TYPE, class ACE_LOCK> ACE_Unmanaged_TSS_Singleton<TYPE, ACE_LOCK> *& ACE_Unmanaged_TSS_Singleton<TYPE, ACE_LOCK>::instance_i () { -#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 ACE_Unmanaged_TSS_Singleton<TYPE, ACE_LOCK> *singleton_ = 0; - - return singleton_; -#else return ACE_Unmanaged_TSS_Singleton<TYPE, ACE_LOCK>::singleton_; -#endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */ } template <class TYPE, class ACE_LOCK> TYPE * @@ -435,7 +393,6 @@ ACE_Unmanaged_TSS_Singleton<TYPE, ACE_LOCK>::close () singleton->cleanup (); } -#if !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) // Pointer to the Singleton instance. template <class TYPE, class ACE_LOCK> ACE_TSS_Singleton <TYPE, ACE_LOCK> * ACE_TSS_Singleton<TYPE, ACE_LOCK>::singleton_ = 0; @@ -443,15 +400,12 @@ ACE_TSS_Singleton<TYPE, ACE_LOCK>::singleton_ = 0; template <class TYPE, class ACE_LOCK> ACE_Unmanaged_TSS_Singleton<TYPE, ACE_LOCK> * ACE_Unmanaged_TSS_Singleton<TYPE, ACE_LOCK>::singleton_ = 0; -#endif /* !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) */ /*************************************************************************/ -#if !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) // Pointer to the Singleton instance. template <class TYPE, class ACE_LOCK> ACE_DLL_Singleton_T<TYPE, ACE_LOCK> * ACE_DLL_Singleton_T<TYPE, ACE_LOCK>::singleton_ = 0; -#endif /* !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) */ template <class TYPE, class ACE_LOCK> void ACE_DLL_Singleton_T<TYPE, ACE_LOCK>::dump () @@ -459,11 +413,9 @@ ACE_DLL_Singleton_T<TYPE, ACE_LOCK>::dump () #if defined (ACE_HAS_DUMP) ACE_TRACE ("ACE_DLL_Singleton_T<TYPE, ACE_LOCK>::dump"); -#if !defined (ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES) ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("instance_ = %x"), ACE_DLL_Singleton_T<TYPE, ACE_LOCK>::instance_i ())); ACELIB_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -#endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */ #endif /* ACE_HAS_DUMP */ } @@ -473,15 +425,7 @@ ACE_DLL_Singleton_T<TYPE, ACE_LOCK>::instance_i () { ACE_TRACE ("ACE_DLL_Singleton_T<TYPE, ACE_LOCK>::instance_i"); -#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 ACE_DLL_Singleton_T<TYPE, ACE_LOCK> *singleton_ = 0; - - return singleton_; -#else return ACE_DLL_Singleton_T<TYPE, ACE_LOCK>::singleton_; -#endif /* ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES */ } template <class TYPE, class ACE_LOCK> TYPE * |