Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/flyweight/locking_tag.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* Copyright 2006-2008 Joaquin M Lopez Munoz.
0002  * Distributed under the Boost Software License, Version 1.0.
0003  * (See accompanying file LICENSE_1_0.txt or copy at
0004  * http://www.boost.org/LICENSE_1_0.txt)
0005  *
0006  * See http://www.boost.org/libs/flyweight for library home page.
0007  */
0008 
0009 #ifndef BOOST_FLYWEIGHT_LOCKING_TAG_HPP
0010 #define BOOST_FLYWEIGHT_LOCKING_TAG_HPP
0011 
0012 #if defined(_MSC_VER)
0013 #pragma once
0014 #endif
0015 
0016 #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
0017 #include <boost/parameter/parameters.hpp>
0018 #include <boost/type_traits/is_base_and_derived.hpp>
0019 
0020 namespace boost{
0021 
0022 namespace flyweights{
0023 
0024 /* Three ways to indicate that a given class T is a locking policy:
0025  *   1. Make it derived from locking_marker.
0026  *   2. Specialize is_locking to evaluate to boost::mpl::true_.
0027  *   3. Pass it as locking<T> when defining a flyweight type.
0028  */
0029 
0030 struct locking_marker{};
0031 
0032 template<typename T>
0033 struct is_locking:is_base_and_derived<locking_marker,T>
0034 {};
0035 
0036 template<typename T=parameter::void_>
0037 struct locking:parameter::template_keyword<locking<>,T>
0038 {};
0039 
0040 } /* namespace flyweights */
0041 
0042 } /* namespace boost */
0043 
0044 #endif