TagSet.h
Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 
00040 
00041 #ifndef _Tag_Set_
00042 #define _Tag_Set_
00043 
00044 #include "boost/mpl/aux_/na.hpp"
00045 #include "boost/type_traits/is_same.hpp"
00046 #include "boost/mpl/if.hpp"
00047 #include "boost/mpl/contains.hpp"
00048 
00049 #include "boost/mpl/vector.hpp"
00050 
00051 #include "assert/staticerror.h"
00052 #include "mw/attributes/detail/tags/Tag.h"
00053 
00054 namespace famouso {
00055     namespace mw {
00056         namespace attributes {
00057             namespace detail {
00058 
00059                 
00060                 
00061                 
00062 
00063                 template <typename T>
00064                 struct assert_is_tag_or_na {
00065                         static const bool cond = (is_tag<T>::value) ||
00066                                 (boost::is_same<T, boost::mpl::na>::value);
00067 
00068                         FAMOUSO_STATIC_ASSERT_ERROR(cond,
00069                                                     only_tags_or_na_allowed,
00070                                                     (T));
00071 
00072                         typedef assert_is_tag_or_na type;
00073                 };
00074 
00075                 template <typename T1 = boost::mpl::na, typename T2 = boost::mpl::na,
00076                           typename T3 = boost::mpl::na, typename T4 = boost::mpl::na,
00077                           typename T5 = boost::mpl::na, typename T6 = boost::mpl::na,
00078                           typename T7 = boost::mpl::na, typename T8 = boost::mpl::na,
00079                           typename T9 = boost::mpl::na, typename T10 = boost::mpl::na>
00080                 struct TagSet {
00081 
00082                     private:
00083                         typedef typename assert_is_tag_or_na<T1>::type  assert1;
00084                         typedef typename assert_is_tag_or_na<T2>::type  assert2;
00085                         typedef typename assert_is_tag_or_na<T3>::type  assert3;
00086                         typedef typename assert_is_tag_or_na<T4>::type  assert4;
00087                         typedef typename assert_is_tag_or_na<T5>::type  assert5;
00088                         typedef typename assert_is_tag_or_na<T6>::type  assert6;
00089                         typedef typename assert_is_tag_or_na<T7>::type  assert7;
00090                         typedef typename assert_is_tag_or_na<T8>::type  assert8;
00091                         typedef typename assert_is_tag_or_na<T9>::type  assert9;
00092                         typedef typename assert_is_tag_or_na<T10>::type assert10;
00093 
00094                         
00095                         
00096                         typedef typename boost::mpl::vector<
00097                                           T1, T2, T3, T4, T5, T6, T7, T8, T9, T10
00098                                          >::type tag_vector;
00099 
00100                     public:
00101                         typedef TagSet type;
00102 
00103                         template <typename T>
00104                         struct contains_tag : boost::mpl::contains<tag_vector, T> { };
00105                 };
00106 
00107             } 
00108         } 
00109     } 
00110 } 
00111 
00112 #endif // _Tag_Set_