From f152d0fb8d6177e8792df25eabd1c664e22f174d Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Mon, 6 Jul 2015 14:52:23 +0100 Subject: [PATCH] (AutomatedTests) Synchronise TestSingletonService with Adaptor Change-Id: Ie534cf1d54b58e1aaa62464e18f4a30f40b29313 --- .../toolkit-singleton-service.cpp | 16 ++++++++++++++++ .../dali-toolkit-test-utils/toolkit-singleton-service.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-singleton-service.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-singleton-service.cpp index 73cd4c8..8ac2d0f 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-singleton-service.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-singleton-service.cpp @@ -40,6 +40,7 @@ public: static Dali::SingletonService New(); static Dali::SingletonService Get(); void Register( const std::type_info& info, BaseHandle singleton ); + void UnregisterAll(); BaseHandle GetSingleton( const std::type_info& info ) const; private: @@ -85,6 +86,11 @@ void SingletonService::Register( const std::type_info& info, BaseHandle singleto } } +void SingletonService::UnregisterAll() +{ + mSingletonContainer.clear(); +} + BaseHandle SingletonService::GetSingleton( const std::type_info& info ) const { BaseHandle object; @@ -134,6 +140,11 @@ SingletonService::SingletonService() { } +SingletonService SingletonService::New() +{ + return Internal::Adaptor::SingletonService::New(); +} + SingletonService SingletonService::Get() { return Internal::Adaptor::SingletonService::Get(); @@ -148,6 +159,11 @@ void SingletonService::Register( const std::type_info& info, BaseHandle singleto GetImplementation( *this ).Register( info, singleton ); } +void SingletonService::UnregisterAll() +{ + GetImplementation( *this ).UnregisterAll(); +} + BaseHandle SingletonService::GetSingleton( const std::type_info& info ) const { return GetImplementation( *this ).GetSingleton( info ); diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-singleton-service.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-singleton-service.h index 956925e..68e4ecc 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-singleton-service.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-singleton-service.h @@ -41,9 +41,11 @@ class SingletonService : public BaseHandle { public: SingletonService(); + static Dali::SingletonService New(); static SingletonService Get(); ~SingletonService(); void Register( const std::type_info& info, BaseHandle singleton ); + void UnregisterAll(); BaseHandle GetSingleton( const std::type_info& info ) const; public: // Not intended for application developers -- 2.7.4