X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FSocketPolicy.ih;h=b3352803e34788b596f86ff284e94a198c986e8f;hb=81f84badf27b66dbadec9890646ca1193e998505;hp=6d41c691993c3aa5b9b8c1c38dab2b56a9a34f84;hpb=3d5b1045dc2531f239a3af4a8f3b17b1fe31549c;p=senf.git diff --git a/Socket/SocketPolicy.ih b/Socket/SocketPolicy.ih index 6d41c69..b335280 100644 --- a/Socket/SocketPolicy.ih +++ b/Socket/SocketPolicy.ih @@ -1,9 +1,9 @@ // $Id$ // // Copyright (C) 2006 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Stefan Bund +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -24,8 +24,8 @@ \brief Policy Framework internal header */ -#ifndef IH_SocketPolicy_ -#define IH_SocketPolicy_ 1 +#ifndef IH_SENF_Socket_SocketPolicy_ +#define IH_SENF_Socket_SocketPolicy_ 1 // Custom includes #include @@ -50,7 +50,8 @@ #include #include // for enable_if -#include "Utils/pool_alloc_mixin.hh" +#include "../Utils/mpl.hh" +#include "../Utils/pool_alloc_mixin.hh" ///////////////////////////////ih.p//////////////////////////////////////// @@ -70,7 +71,7 @@ namespace senf { struct SocketPolicyBase { - virtual ~SocketPolicyBase() {} + virtual ~SocketPolicyBase(); # define SP_Declare(x1,x2,SomePolicy) \ virtual BOOST_PP_CAT(SomePolicy,Base) const & BOOST_PP_CAT(the,SomePolicy) () \ @@ -110,13 +111,7 @@ namespace senf { namespace impl { - struct nil {}; - - template - struct SocketPolicy_rv - { int v[N+1]; }; - - template + template struct MakeSocketPolicy_merge {}; @@ -126,11 +121,11 @@ namespace impl { # define BOOST_PP_LOCAL_LIMITS (0, BOOST_PP_DEC( SENF_SOCKET_POLICIES_N ) ) # define BOOST_PP_LOCAL_MACRO(n) \ - SocketPolicy_rv MakeSocketPolicy_merge_( \ + senf::mpl::rv MakeSocketPolicy_merge_( \ BOOST_PP_CAT( BOOST_PP_SEQ_ELEM( n, SENF_SOCKET_POLICIES ),Base)*); \ \ template \ - struct MakeSocketPolicy_merge)> \ + struct MakeSocketPolicy_merge \ { \ typedef SocketPolicy< \ BOOST_PP_SEQ_FOR_EACH_I( SP_DeclareMakeSocketPolicy_merge_member, \ @@ -149,11 +144,11 @@ namespace impl { struct apply : MakeSocketPolicy_merge(0)))> + SENF_MPL_RV(MakeSocketPolicy_merge_(static_cast(0)))> {}; template - struct apply + struct apply { typedef Base type; }; @@ -170,13 +165,13 @@ namespace impl { typename Base::SomePolicy * template - SocketPolicy_rv<1> SocketPolicy_checkcompat_( + senf::mpl::rv<1> SocketPolicy_checkcompat_( BOOST_PP_SEQ_FOR_EACH_I( SP_DeclareArguments, , SENF_SOCKET_POLICIES ) ); # undef SP_DeclareArguments template - SocketPolicy_rv<2> SocketPolicy_checkcompat_( ... ); + senf::mpl::rv<2> SocketPolicy_checkcompat_( ... ); template struct SocketPolicy_checkcompat @@ -184,7 +179,7 @@ namespace impl { {}; template<> - struct SocketPolicy_checkcompat)> + struct SocketPolicy_checkcompat<1> : public boost::true_type {}; @@ -195,7 +190,7 @@ namespace impl { template struct SocketPolicy_compatibility - : public SocketPolicy_checkcompat< sizeof( + : public SocketPolicy_checkcompat< SENF_MPL_RV( SocketPolicy_checkcompat_( BOOST_PP_SEQ_FOR_EACH_I( SP_DeclareArguments, , SENF_SOCKET_POLICIES ) )) > {}; @@ -204,7 +199,7 @@ namespace impl { template < BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( SENF_SOCKET_POLICIES_N, class T, - senf::impl::nil ) > + mpl::nil ) > class MakeSocketPolicy : public boost::mpl::if_< boost::is_convertible< T0*, SocketPolicyBase* >, impl::MakeSocketPolicy_impl<