Singleton Pool ImplementationDependenciesIncludes 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). Synopsistemplate <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; }; Extensions to Public InterfaceAdditional template parametersMutexThis 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. NextSizeThe 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. Additional membersThe typedef mutex and the static const value next_size publish the values of the template parameters Mutex and NextSize, respectively. Future DirectionsWhen 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. Interface DescriptionRevised 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) |