00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00026 #ifndef IH_SENF_PPI_MultiConnectorMixin_
00027 #define IH_SENF_PPI_MultiConnectorMixin_ 1
00028
00029
00030 #include "Setup.hh"
00031
00032
00033
00034 namespace senf {
00035 namespace ppi {
00036 namespace module {
00037 namespace detail {
00038
00039 struct MultiConnectorMixinAccess
00040 {
00041 # define BOOST_PP_ITERATION_PARAMS_1 (4, ( \
00042 0, \
00043 SENF_MULTI_CONNECTOR_MAX_ARGS, \
00044 SENF_ABSOLUTE_INCLUDE_PATH(PPI/MultiConnectorMixin.mpp), \
00045 8 ))
00046 # include BOOST_PP_ITERATE()
00047 };
00048
00049 template <class KeyType, class ConnectorType>
00050 struct MultiConnectorDefaultContainer
00051 {
00052 typedef boost::ptr_map<KeyType, ConnectorType> type;
00053 };
00054
00055 template <class Module, class Connector>
00056 class MultiConnectorWrapper
00057 : public Connector
00058 {
00059 private:
00060 virtual void v_disconnected();
00061 };
00062
00063 #ifndef DOXYGEN
00064
00065 template <class ConnectorType>
00066 struct MultiConnectorDefaultContainer<void,ConnectorType>
00067 {
00068 typedef boost::ptr_vector<ConnectorType> type;
00069 };
00070
00071 #endif
00072
00073 template <class ConnectorType>
00074 struct MultiConnectorSelectBase
00075 : public boost::mpl::if_<
00076 boost::is_base_of<connector::InputConnector, ConnectorType>,
00077 ppi::detail::DisableStandardInput, ppi::detail::DisableStandardOutput >
00078 {};
00079
00080 template <class T> senf::mpl::rv<0> isMulticonnector(...);
00081 template <class T> senf::mpl::rv<1> isMulticonnector(
00082 typename boost::enable_if<boost::is_base_of<connector::OutputConnector,
00083 typename T::ConnectorType>,
00084 int>::type);
00085 template <class T> senf::mpl::rv<2> isMulticonnector(
00086 typename boost::enable_if<boost::is_base_of<connector::InputConnector,
00087 typename T::ConnectorType>,
00088 int>::type);
00089
00090 template <class T, unsigned N>
00091 struct IsMulticonnectorSource_
00092 : public boost::false_type
00093 {};
00094
00095 template <class T>
00096 struct IsMulticonnectorSource_<T, 1u>
00097 : public boost::true_type
00098 {};
00099
00100 template <class T>
00101 struct IsMulticonnectorSource
00102 : public IsMulticonnectorSource_<T, SENF_MPL_RV(isMulticonnector<T>(0))>
00103 {};
00104
00105 template <class T, unsigned N>
00106 struct IsMulticonnectorTarget_
00107 : public boost::false_type
00108 {};
00109
00110 template <class T>
00111 struct IsMulticonnectorTarget_<T, 2u>
00112 : public boost::true_type
00113 {};
00114
00115 template <class T>
00116 struct IsMulticonnectorTarget
00117 : public IsMulticonnectorTarget_<T, SENF_MPL_RV(isMulticonnector<T>(0))>
00118 {};
00119
00120
00121
00122 }}}}
00123
00124
00125 #endif
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136