2006-02-28 10:29:06 +00:00
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
// The Loki Library
|
|
|
|
|
// Copyright (c) 2006 Peter K<>mmel
|
|
|
|
|
// Permission to use, copy, modify, distribute and sell this software for any
|
|
|
|
|
// purpose is hereby granted without fee, provided that the above copyright
|
|
|
|
|
// notice appear in all copies and that both that copyright notice and this
|
|
|
|
|
// permission notice appear in supporting documentation.
|
|
|
|
|
// The author makes no representations about the
|
|
|
|
|
// suitability of this software for any purpose. It is provided "as is"
|
|
|
|
|
// without express or implied warranty.
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
// $Header:
|
|
|
|
|
|
2006-03-03 11:58:24 +00:00
|
|
|
|
#include "singletondll.h"
|
2006-02-28 10:29:06 +00:00
|
|
|
|
|
|
|
|
|
#include "foo.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef Loki::SingletonHolder<Foo> FooSingleton;
|
|
|
|
|
|
2006-02-28 10:48:16 +00:00
|
|
|
|
LOKI_SINGLETON_INSTANCE_DEFINITION(FooSingleton)
|
|
|
|
|
/*
|
2006-03-15 08:47:19 +00:00
|
|
|
|
namespace Loki
|
|
|
|
|
{
|
|
|
|
|
template<>
|
|
|
|
|
FooSingleton::ObjectType& Singleton<FooSingleton::ObjectType>::Instance()
|
|
|
|
|
{
|
|
|
|
|
return FooSingleton::Instance();
|
|
|
|
|
}
|
|
|
|
|
}
|
2006-02-28 10:48:16 +00:00
|
|
|
|
*/
|
2006-02-28 10:29:06 +00:00
|
|
|
|
|
2006-03-15 08:47:19 +00:00
|
|
|
|
|
2006-03-03 11:58:24 +00:00
|
|
|
|
template<>
|
2006-02-28 10:48:16 +00:00
|
|
|
|
Foo& Singleton<Foo>::Instance()
|
2006-02-28 10:29:06 +00:00
|
|
|
|
{
|
|
|
|
|
return FooSingleton::Instance();
|
2006-03-03 11:58:24 +00:00
|
|
|
|
}
|
2006-02-28 10:48:16 +00:00
|
|
|
|
|
|
|
|
|
|
2006-02-28 10:29:06 +00:00
|
|
|
|
|