switch to new MPL based Fraunhofer FOKUS Public License
[senf.git] / senf / PPI / MultiConnectorMixin.cti
1 // $Id$
2 //
3 // Copyright (C) 2009
4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 //
6 // The contents of this file are subject to the Fraunhofer FOKUS Public License
7 // Version 1.0 (the "License"); you may not use this file except in compliance
8 // with the License. You may obtain a copy of the License at 
9 // http://senf.berlios.de/license.html
10 //
11 // The Fraunhofer FOKUS Public License Version 1.0 is based on, 
12 // but modifies the Mozilla Public License Version 1.1.
13 // See the full license text for the amendments.
14 //
15 // Software distributed under the License is distributed on an "AS IS" basis, 
16 // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
17 // for the specific language governing rights and limitations under the License.
18 //
19 // The Original Code is Fraunhofer FOKUS code.
20 //
21 // The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V. 
22 // (registered association), Hansastraße 27 c, 80686 Munich, Germany.
23 // All Rights Reserved.
24 //
25 // Contributor(s):
26 //   Stefan Bund <g0dil@berlios.de>
27
28 /** \file
29     \brief MultiConnectorMixin inline template implementation */
30
31 #include "MultiConnectorMixin.ih"
32
33 // Custom includes
34
35 #define prefix_ inline
36 //-/////////////////////////////////////////////////////////////////////////////////////////////////
37
38 //-/////////////////////////////////////////////////////////////////////////////////////////////////
39 // senf::ppi::module::detail::MultiConnectorWrapper<Module,Connector>
40
41 template <class Module, class Connector>
42 prefix_ void senf::ppi::module::detail::MultiConnectorWrapper<Module, Connector>::v_disconnected()
43 {
44     Connector::v_disconnected();
45     static_cast<Module&>(this->module()).disconnected(*this);
46 }
47
48 //-/////////////////////////////////////////////////////////////////////////////////////////////////
49 // senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,KeyType_,ContainerType_>
50
51 template <class Self_, class ConnectorType_, class KeyType_, class ContainerType_>
52 prefix_ ContainerType_ &
53 senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,KeyType_,ContainerType_>::connectors()
54 {
55     return connectors_;
56 }
57
58 template <class Self_, class ConnectorType_, class KeyType_, class ContainerType_>
59 prefix_ ContainerType_ const &
60 senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,KeyType_,ContainerType_>::
61 connectors()
62     const
63 {
64     return connectors_;
65 }
66
67 template <class Self_, class ConnectorType_, class KeyType_, class ContainerType_>
68 prefix_ void
69 senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,KeyType_,ContainerType_>::
70 connectorDestroy(ConnectorType const &)
71 {}
72
73 //-/////////////////////////////////////////////////////////////////////////////////////////////////
74 // senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,void,ContainerType_>
75
76 template <class Self_, class ConnectorType_, class ContainerType_>
77 prefix_ ContainerType_ &
78 senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,void,ContainerType_>::connectors()
79 {
80     return connectors_;
81 }
82
83 template <class Self_, class ConnectorType_, class ContainerType_>
84 prefix_ ContainerType_ const &
85 senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,void,ContainerType_>::connectors()
86     const
87 {
88     return connectors_;
89 }
90
91 template <class Self_, class ConnectorType_, class ContainerType_>
92 prefix_ void
93 senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,void,ContainerType_>::
94 connectorDestroy(ConnectorType const &)
95 {}
96
97 //-/////////////////////////////////////////////////////////////////////////////////////////////////
98 // senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,void,void>
99
100 template <class Self_, class ConnectorType_>
101 prefix_ void
102 senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,void,void>::
103 disconnected(ConnectorType_ const & c)
104 {
105     static_cast<Self_*>(this)->connectorDestroy(&c);
106 }
107
108 //-/////////////////////////////////////////////////////////////////////////////////////////////////
109
110 #ifndef DOXYGEN
111
112 // Include 'Implementation' from MultiConnectorMixin.mpp
113 #define BOOST_PP_ITERATION_PARAMS_1 (4, ( \
114             0, \
115             SENF_MULTI_CONNECTOR_MAX_ARGS, \
116             SENF_ABSOLUTE_INCLUDE_PATH(PPI/MultiConnectorMixin.mpp), \
117             3 ))
118 #include BOOST_PP_ITERATE()
119
120 #endif
121
122 //-/////////////////////////////////////////////////////////////////////////////////////////////////
123 #undef prefix_
124
125 \f
126 // Local Variables:
127 // mode: c++
128 // fill-column: 100
129 // comment-column: 40
130 // c-file-style: "senf"
131 // indent-tabs-mode: nil
132 // ispell-local-dictionary: "american"
133 // compile-command: "scons -u test"
134 // End: