Back to Arangodb

Boost.Flyweight Holders reference

3rdParty/boost/1.78.0/libs/flyweight/doc/reference/holders.html

3.12.9.15.2 KB
Original Source

Boost.Flyweight Holders reference


Factories


Boost.Flyweight reference


Locking policies


Contents

Holders and holder specifiers

Given a type C, a type Holder is said to be a holder of C if the expression Holder::get() returns a reference to a default initialized C object unique to Holder. No invocation of Holder::get(), except possibly the first one in the program, does throw. flyweight privately uses a holder to instantiate a factory and some additional data (like a mutex for internal synchronization) unique to each instantiation type of the class template.

A type S is a holder specifier if:

  1. One of the following conditions is satisfied:

  2. is_holder<S>::type is boost::mpl::true_,

  3. S is of the form holder<S'>.

  4. S, or S' if (b) applies, is an MPL Lambda Expression such that invoking it with type C resolves to a holder of C.

Header "boost/flyweight/holder_tag.hpp" synopsis

namespaceboost{namespaceflyweights{structholder\_marker;template\<typenameT\>structis\_holder;template\<typenameT\>structholder;}// namespace boost::flyweights}// namespace boost

Class template is_holder

Unless specialized by the user, is_holder<T>::type is boost::mpl::true_ if T is derived from holder_marker, and it is boost::mpl::false_ otherwise.

Class template holder

holder<T> is a syntactic construct meant to indicate that T is a holder specifier without resorting to the mechanisms provided by the is_holder class template.

Header "boost/flyweight/static_holder_fwd.hpp" synopsis

namespaceboost{namespaceflyweights{template\<typenameC\>structstatic\_holder\_class;structstatic\_holder;}// namespace boost::flyweights}// namespace boost

static_holder_fwd.hpp forward declares static_holder_class and static_holder.

Header "boost/flyweight/static_holder.hpp" synopsis

Class template static_holder_class

static_holder_class<C> keeps its unique instance of C as a local static object.

Class static_holder

Holder Specifier for static_holder_class.

Header "boost/flyweight/intermodule_holder_fwd.hpp" synopsis

namespaceboost{namespaceflyweights{template\<typenameC\>structintermodule\_holder\_class;structintermodule\_holder;}// namespace boost::flyweights}// namespace boost

intermodule_holder_fwd.hpp forward declares intermodule_holder_class and intermodule_holder.

Header "boost/flyweight/intermodule_holder.hpp" synopsis

Class template intermodule_holder_class

intermodule_holder_class<C> maintains a C instance which is unique even across different dynamically linked modules of the program using this same type. In general, this guarantee is not provided by static_holder_class, as most C++ implementations are not able to merge duplicates of static variables stored in different dynamic modules of a program.

Class intermodule_holder

Holder Specifier for intermodule_holder_class.



Factories


Boost.Flyweight reference


Locking policies

Revised August 11th 2008

© Copyright 2006-2008 Joaquín M López Muñoz. 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)