00001 /* 00002 SINGLETONPRECONFIGURE - declare the configuration of some Singleton types in advance 00003 00004 Copyright (C) Lumiera.org 00005 2008, Hermann Vosseler <Ichthyostega@web.de> 00006 00007 This program is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU General Public License as 00009 published by the Free Software Foundation; either version 2 of the 00010 License, or (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software 00019 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00020 00021 */ 00022 00044 #ifndef LUMIERA_SINGLETONPRECONFIGURE_H 00045 #define LUMIERA_SINGLETONPRECONFIGURE_H 00046 00047 #include "common/test/mockinjector.hpp" 00048 00049 00050 namespace lumiera 00051 { 00056 template <class SI> 00057 class Singleton 00058 : public SingletonFactory<SI> 00059 { } 00060 ; 00061 00062 00063 /* ********************************************************************** */ 00064 /* Forward declarations of all Classes we want to specialize the template */ 00065 /* ********************************************************************** */ 00066 00067 namespace test 00068 { 00069 class TestSingletonO; 00070 using lumiera::Singleton; 00071 00072 } // namespace test 00073 } // namespace lumiera 00074 00075 namespace backend_interface 00076 { 00077 class MediaAccessFacade; 00078 using lumiera::Singleton; 00079 00080 } // namespace backend_interface 00081 00082 00083 00084 00085 00086 /* ************************** */ 00087 /* Specialisation Definitions */ 00088 /* ************************** */ 00089 00090 namespace lumiera 00091 { 00092 00093 using test::MockInjector; 00094 00095 00096 template<> 00097 class Singleton<test::TestSingletonO> 00098 : public MockInjector<test::TestSingletonO> 00099 { }; 00100 00101 00102 template<> 00103 class Singleton<backend_interface::MediaAccessFacade> 00104 : public MockInjector<backend_interface::MediaAccessFacade> 00105 { }; 00106 00107 } // namespace lumiera 00108 00109 00110 00111 00112 #endif
1.5.6