...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Includes the Boost headers "pool.hpp" (see pool.html), "detail/singleton.hpp" (see singleton.html), "detail/mutex.hpp" (see mutex.html), and "detail/guard.hpp" (see guard.html).
template <typename Tag, unsigned RequestedSize, typename UserAllocator = default_user_allocator_new_delete, typename Mutex = details::pool::default_mutex, unsigned NextSize = 32> class singleton_pool { ... // public interface public: // extensions to public interface typedef Mutex mutex; static const unsigned next_size = NextSize; };
This class is the type of mutex to use to protect simultaneous access to the underlying Pool. It is exposed so that users may declare some singleton pools normally (i.e., with synchronization), but some singleton pools without synchronization (by specifying details::pool::null_mutex) for efficiency reasons.
The value of this parameter is passed to the underlying Pool when it is created. See the extensions to the public interface of pool for more information.
The typedef mutex and the static const value next_size publish the values of the template parameters Mutex and NextSize, respectively.
When the Boost multithreading library is completed, the Mutex parameter will be replaced by something from that library providing the same flexibility and will move from an implementation detail into the interface specification.
Revised 05 December, 2006
Copyright © 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT com)
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)