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 non-inline template implementation */
17 #include "MultiConnectorMixin.ih"
21 #include <boost/lambda/lambda.hpp>
24 //-/////////////////////////////////////////////////////////////////////////////////////////////////
26 //-/////////////////////////////////////////////////////////////////////////////////////////////////
27 // senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,KeyType_,ContainerType_>
29 template <class Self_, class ConnectorType_, class KeyType_, class ContainerType_>
31 senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,KeyType_,ContainerType_>::
32 disconnected(ConnectorType_ const & c)
34 typename ContainerType::iterator i (
35 find_if(connectors_.begin(), connectors_.end(),
36 boost::bind(&ContainerType_::value_type::second,_1) == &c));
37 if (i != connectors_.end()) {
38 static_cast<Self_*>(this)->connectorDestroy(c);
43 //-/////////////////////////////////////////////////////////////////////////////////////////////////
44 // senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,void,ContainerType_>
46 template <class Self_, class ConnectorType_, class ContainerType_>
48 senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,void,ContainerType_>::
49 disconnected(ConnectorType_ const & c)
51 using boost::lambda::_1;
53 typename ContainerType::iterator i (
54 find_if(connectors_.begin(), connectors_.end(), &_1 == &c));
55 if (i != connectors_.end()) {
56 static_cast<Self_*>(this)->connectorDestroy(c);
61 //-/////////////////////////////////////////////////////////////////////////////////////////////////
69 // c-file-style: "senf"
70 // indent-tabs-mode: nil
71 // ispell-local-dictionary: "american"
72 // compile-command: "scons -u test"