7be0689537996b0055ff0f707a8290872dfe1290
[senf.git] / senf / PPI / MultiConnectorMixin.cti
1 // $Id$
2 //
3 // Copyright (C) 2009
4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 //     Stefan Bund <g0dil@berlios.de>
7 //
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.
12 //
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.
17 //
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.
22
23 /** \file
24     \brief MultiConnectorMixin inline template implementation */
25
26 #include "MultiConnectorMixin.ih"
27
28 // Custom includes
29
30 #define prefix_ inline
31 //-/////////////////////////////////////////////////////////////////////////////////////////////////
32
33 //-/////////////////////////////////////////////////////////////////////////////////////////////////
34 // senf::ppi::module::detail::MultiConnectorWrapper<Module,Connector>
35
36 template <class Module, class Connector>
37 prefix_ void senf::ppi::module::detail::MultiConnectorWrapper<Module, Connector>::v_disconnected()
38 {
39     Connector::v_disconnected();
40     static_cast<Module&>(this->module()).disconnected(*this);
41 }
42
43 //-/////////////////////////////////////////////////////////////////////////////////////////////////
44 // senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,KeyType_,ContainerType_>
45
46 template <class Self_, class ConnectorType_, class KeyType_, class ContainerType_>
47 prefix_ ContainerType_ &
48 senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,KeyType_,ContainerType_>::connectors()
49 {
50     return connectors_;
51 }
52
53 template <class Self_, class ConnectorType_, class KeyType_, class ContainerType_>
54 prefix_ ContainerType_ const &
55 senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,KeyType_,ContainerType_>::
56 connectors()
57     const
58 {
59     return connectors_;
60 }
61
62 template <class Self_, class ConnectorType_, class KeyType_, class ContainerType_>
63 prefix_ void
64 senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,KeyType_,ContainerType_>::
65 connectorDestroy(ConnectorType const &)
66 {}
67
68 //-/////////////////////////////////////////////////////////////////////////////////////////////////
69 // senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,void,ContainerType_>
70
71 template <class Self_, class ConnectorType_, class ContainerType_>
72 prefix_ ContainerType_ &
73 senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,void,ContainerType_>::connectors()
74 {
75     return connectors_;
76 }
77
78 template <class Self_, class ConnectorType_, class ContainerType_>
79 prefix_ ContainerType_ const &
80 senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,void,ContainerType_>::connectors()
81     const
82 {
83     return connectors_;
84 }
85
86 template <class Self_, class ConnectorType_, class ContainerType_>
87 prefix_ void
88 senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,void,ContainerType_>::
89 connectorDestroy(ConnectorType const &)
90 {}
91
92 //-/////////////////////////////////////////////////////////////////////////////////////////////////
93 // senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,void,void>
94
95 template <class Self_, class ConnectorType_>
96 prefix_ void
97 senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,void,void>::
98 disconnected(ConnectorType_ const & c)
99 {
100     static_cast<Self_*>(this)->connectorDestroy(&c);
101 }
102
103 //-/////////////////////////////////////////////////////////////////////////////////////////////////
104
105 #ifndef DOXYGEN
106
107 // Include 'Implementation' from MultiConnectorMixin.mpp
108 #define BOOST_PP_ITERATION_PARAMS_1 (4, ( \
109             0, \
110             SENF_MULTI_CONNECTOR_MAX_ARGS, \
111             SENF_ABSOLUTE_INCLUDE_PATH(PPI/MultiConnectorMixin.mpp), \
112             3 ))
113 #include BOOST_PP_ITERATE()
114
115 #endif
116
117 //-/////////////////////////////////////////////////////////////////////////////////////////////////
118 #undef prefix_
119
120 \f
121 // Local Variables:
122 // mode: c++
123 // fill-column: 100
124 // comment-column: 40
125 // c-file-style: "senf"
126 // indent-tabs-mode: nil
127 // ispell-local-dictionary: "american"
128 // compile-command: "scons -u test"
129 // End: