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
32 //-/////////////////////////////////////////////////////////////////////////////////////////////////
39 struct MultiConnectorMixinAccess
41 # define BOOST_PP_ITERATION_PARAMS_1 (4, ( \
43 SENF_MULTI_CONNECTOR_MAX_ARGS, \
44 SENF_ABSOLUTE_INCLUDE_PATH(PPI/MultiConnectorMixin.mpp), \
46 # include BOOST_PP_ITERATE()
49 template <class KeyType, class ConnectorType>
50 struct MultiConnectorDefaultContainer
52 typedef boost::ptr_map<KeyType, ConnectorType> type;
55 template <class Module, class Connector>
56 class MultiConnectorWrapper
60 virtual void v_disconnected();
65 template <class ConnectorType>
66 struct MultiConnectorDefaultContainer<void,ConnectorType>
68 typedef boost::ptr_vector<ConnectorType> type;
73 template <class ConnectorType>
74 struct MultiConnectorSelectBase
75 : public boost::mpl::if_<
76 boost::is_base_of<connector::InputConnector, ConnectorType>,
77 ppi::detail::DisableStandardInput, ppi::detail::DisableStandardOutput >
80 template <class T> senf::mpl::rv<0> isMulticonnector(...);
81 template <class T> senf::mpl::rv<1> isMulticonnector(
82 typename boost::enable_if<boost::is_base_of<connector::OutputConnector,
83 typename T::ConnectorType>,
85 template <class T> senf::mpl::rv<2> isMulticonnector(
86 typename boost::enable_if<boost::is_base_of<connector::InputConnector,
87 typename T::ConnectorType>,
90 template <class T, unsigned N>
91 struct IsMulticonnectorSource_
92 : public boost::false_type
96 struct IsMulticonnectorSource_<T, 1u>
97 : public boost::true_type
101 struct IsMulticonnectorSource
102 : public IsMulticonnectorSource_<T, SENF_MPL_RV(isMulticonnector<T>(0))>
105 template <class T, unsigned N>
106 struct IsMulticonnectorTarget_
107 : public boost::false_type
111 struct IsMulticonnectorTarget_<T, 2u>
112 : public boost::true_type
116 struct IsMulticonnectorTarget
117 : public IsMulticonnectorTarget_<T, SENF_MPL_RV(isMulticonnector<T>(0))>
124 //-/////////////////////////////////////////////////////////////////////////////////////////////////
131 // comment-column: 40
132 // c-file-style: "senf"
133 // indent-tabs-mode: nil
134 // ispell-local-dictionary: "american"
135 // compile-command: "scons -u test"