Sha256: e87ae5a4646ea291e62915eb01f1786558e44386de513574fc42cd801e07a88d

Contents?: true

Size: 1.16 KB

Versions: 170

Compression:

Stored size: 1.16 KB

Contents

// Copyright (C) 2001-2003
// Mac Murrett
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org for most recent version including documentation.

#ifndef BOOST_SINGLETON_MJM012402_HPP
#define BOOST_SINGLETON_MJM012402_HPP

#include <boost/thread/detail/config.hpp>

namespace boost {
namespace detail {
namespace thread {

// class singleton has the same goal as all singletons: create one instance of
// a class on demand, then dish it out as requested.

template <class T>
class singleton : private T
{
private:
    singleton();
    ~singleton();

public:
    static T &instance();
};


template <class T>
inline singleton<T>::singleton()
{
    /* no-op */
}

template <class T>
inline singleton<T>::~singleton()
{
    /* no-op */
}

template <class T>
/*static*/ T &singleton<T>::instance()
{
    // function-local static to force this to work correctly at static
    // initialization time.
    static singleton<T> s_oT;
    return(s_oT);
}

} // namespace thread
} // namespace detail
} // namespace boost

#endif // BOOST_SINGLETON_MJM012402_HPP

Version data entries

170 entries across 170 versions & 6 rubygems

Version Path
passenger-6.0.26 src/cxx_supportlib/vendor-modified/boost/thread/detail/singleton.hpp
passenger-6.0.25 src/cxx_supportlib/vendor-modified/boost/thread/detail/singleton.hpp
passenger-6.0.24 src/cxx_supportlib/vendor-modified/boost/thread/detail/singleton.hpp
passenger-6.0.23 src/cxx_supportlib/vendor-modified/boost/thread/detail/singleton.hpp
passenger-6.0.20 src/cxx_supportlib/vendor-modified/boost/thread/detail/singleton.hpp
passenger-6.0.19 src/cxx_supportlib/vendor-modified/boost/thread/detail/singleton.hpp
passenger-6.0.18 src/cxx_supportlib/vendor-modified/boost/thread/detail/singleton.hpp
passenger-6.0.17 src/cxx_supportlib/vendor-modified/boost/thread/detail/singleton.hpp
passenger-6.0.16 src/cxx_supportlib/vendor-modified/boost/thread/detail/singleton.hpp
passenger-6.0.15 src/cxx_supportlib/vendor-modified/boost/thread/detail/singleton.hpp
passenger-6.0.14 src/cxx_supportlib/vendor-modified/boost/thread/detail/singleton.hpp
passenger-6.0.13 src/cxx_supportlib/vendor-modified/boost/thread/detail/singleton.hpp
passenger-6.0.12 src/cxx_supportlib/vendor-modified/boost/thread/detail/singleton.hpp
passenger-6.0.11 src/cxx_supportlib/vendor-modified/boost/thread/detail/singleton.hpp
passenger-6.0.10 src/cxx_supportlib/vendor-modified/boost/thread/detail/singleton.hpp
passenger-6.0.9 src/cxx_supportlib/vendor-modified/boost/thread/detail/singleton.hpp
passenger-6.0.8 src/cxx_supportlib/vendor-modified/boost/thread/detail/singleton.hpp
passenger-6.0.7 src/cxx_supportlib/vendor-modified/boost/thread/detail/singleton.hpp
passenger-6.0.6 src/cxx_supportlib/vendor-modified/boost/thread/detail/singleton.hpp
passenger-6.0.5 src/cxx_supportlib/vendor-modified/boost/thread/detail/singleton.hpp