2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
15 \brief MultiConnectorMixin internal header */
17 #ifndef IH_SENF_PPI_MultiConnectorMixin_
18 #define IH_SENF_PPI_MultiConnectorMixin_ 1
21 #include <boost/ptr_container/ptr_unordered_map.hpp>
24 //-/////////////////////////////////////////////////////////////////////////////////////////////////
31 struct MultiConnectorMixinAccess
33 # define BOOST_PP_ITERATION_PARAMS_1 (4, ( \
35 SENF_MULTI_CONNECTOR_MAX_ARGS, \
36 SENF_ABSOLUTE_INCLUDE_PATH(PPI/MultiConnectorMixin.mpp), \
38 # include BOOST_PP_ITERATE()
41 template <class KeyType, class ConnectorType>
42 struct MultiConnectorDefaultContainer
44 typedef boost::ptr_unordered_map<KeyType, ConnectorType> type;
47 template <class Module, class Connector>
48 class MultiConnectorWrapper
52 virtual void v_disconnected();
57 template <class ConnectorType>
58 struct MultiConnectorDefaultContainer<void,ConnectorType>
60 typedef boost::ptr_vector<ConnectorType> type;
65 template <class ConnectorType>
66 struct MultiConnectorSelectBase
67 : public boost::mpl::if_<
68 boost::is_base_of<connector::InputConnector, ConnectorType>,
69 ppi::detail::DisableStandardInput, ppi::detail::DisableStandardOutput >
72 template <class T> senf::mpl::rv<0> isMulticonnector(...);
73 template <class T> senf::mpl::rv<1> isMulticonnector(
74 typename boost::enable_if<boost::is_base_of<connector::OutputConnector,
75 typename T::ConnectorType>,
77 template <class T> senf::mpl::rv<2> isMulticonnector(
78 typename boost::enable_if<boost::is_base_of<connector::InputConnector,
79 typename T::ConnectorType>,
82 template <class T, unsigned N>
83 struct IsMulticonnectorSource_
84 : public boost::false_type
88 struct IsMulticonnectorSource_<T, 1u>
89 : public boost::true_type
93 struct IsMulticonnectorSource
94 : public IsMulticonnectorSource_<T, SENF_MPL_RV(isMulticonnector<T>(0))>
97 template <class T, unsigned N>
98 struct IsMulticonnectorTarget_
99 : public boost::false_type
103 struct IsMulticonnectorTarget_<T, 2u>
104 : public boost::true_type
108 struct IsMulticonnectorTarget
109 : public IsMulticonnectorTarget_<T, SENF_MPL_RV(isMulticonnector<T>(0))>
116 //-/////////////////////////////////////////////////////////////////////////////////////////////////
123 // comment-column: 40
124 // c-file-style: "senf"
125 // indent-tabs-mode: nil
126 // ispell-local-dictionary: "american"
127 // compile-command: "scons -u test"