4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Stefan Bund <g0dil@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief MultiConnectorMixin internal header */
26 #ifndef IH_SENF_PPI_MultiConnectorMixin_
27 #define IH_SENF_PPI_MultiConnectorMixin_ 1
31 ///////////////////////////////ih.p////////////////////////////////////////
38 struct MultiConnectorMixinAccess
40 # define BOOST_PP_ITERATION_PARAMS_1 (4, ( \
42 SENF_MULTI_CONNECTOR_MAX_ARGS, \
43 SENF_ABSOLUTE_INCLUDE_PATH(PPI/MultiConnectorMixin.mpp), \
45 # include BOOST_PP_ITERATE()
47 # define BOOST_PP_ITERATION_PARAMS_1 (4, ( \
49 2*SENF_MULTI_CONNECTOR_MAX_ARGS, \
50 SENF_ABSOLUTE_INCLUDE_PATH(PPI/MultiConnectorMixin.mpp), \
52 # include BOOST_PP_ITERATE()
55 template <class KeyType, class ConnectorType>
56 struct MultiConnectorDefaultContainer
58 typedef boost::ptr_map<KeyType, ConnectorType> type;
63 template <class ConnectorType>
64 struct MultiConnectorDefaultContainer<void,ConnectorType>
66 typedef boost::ptr_vector<ConnectorType> type;
71 template <class ConnectorType>
72 struct MultiConnectorSelectBase
73 : public boost::mpl::if_<
74 boost::is_base_of<connector::InputConnector, ConnectorType>,
75 ppi::detail::DisableStandardInput, ppi::detail::DisableStandardOutput >
78 template <class T> senf::mpl::rv<0> isMulticonnector(...);
79 template <class T> senf::mpl::rv<1> isMulticonnector(
80 typename boost::enable_if<boost::is_base_of<connector::OutputConnector,
81 typename T::ConnectorType>,
83 template <class T> senf::mpl::rv<2> isMulticonnector(
84 typename boost::enable_if<boost::is_base_of<connector::InputConnector,
85 typename T::ConnectorType>,
88 template <class T, unsigned N>
89 struct IsMulticonnectorSource_
90 : public boost::false_type
94 struct IsMulticonnectorSource_<T, 1u>
95 : public boost::true_type
99 struct IsMulticonnectorSource
100 : public IsMulticonnectorSource_<T, SENF_MPL_RV(isMulticonnector<T>(0))>
103 template <class T, unsigned N>
104 struct IsMulticonnectorTarget_
105 : public boost::false_type
109 struct IsMulticonnectorTarget_<T, 2u>
110 : public boost::true_type
114 struct IsMulticonnectorTarget
115 : public IsMulticonnectorTarget_<T, SENF_MPL_RV(isMulticonnector<T>(0))>
122 ///////////////////////////////ih.e////////////////////////////////////////
129 // comment-column: 40
130 // c-file-style: "senf"
131 // indent-tabs-mode: nil
132 // ispell-local-dictionary: "american"
133 // compile-command: "scons -u test"