PPI: Checkin of first compiling (yet not working) version
[senf.git] / PPI / Route.hh
1 // Copyright (C) 2007 
2 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
3 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
4 //     Stefan Bund <g0dil@berlios.de>
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the
18 // Free Software Foundation, Inc.,
19 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
20
21 /** \file
22     \brief Route public header */
23
24 #ifndef HH_Route_
25 #define HH_Route_ 1
26
27 // Custom includes
28 #include <boost/type_traits.hpp>
29 #include "predecl.hh"
30
31 //#include "Route.mpp"
32 ///////////////////////////////hh.p////////////////////////////////////////
33
34 namespace senf {
35 namespace ppi {
36
37     class RouteBase
38     {
39     public:
40         void autoThrottling(bool state); ///< Change automatic throttle notification forwarding
41                                         /**< By default, throttle notifications are automatically
42                                              forwarded from active to passive connectors. This may
43                                              be disabled by setting the authoThrottling state to \c
44                                              false.
45                                              
46                                              Routing from/to an event to/from a passive connector
47                                              will automatically create throttling notifications on
48                                              the connector whenever the event is disabled. Routing
49                                              form/to an event to/from an active connector will
50                                              disable the event whenever a throttling notification
51                                              comes in. Respective for unthrottle notifications.
52
53                                              \param[in] state New throttle forwarding state 
54
55                                              \implementation This class will be implemented using a
56                                                  baseclass, this template and several
57                                                  specializations. However, this is an implementation
58                                                  detail which does not affect the exposed
59                                                  interface. */
60
61     protected:
62         RouteBase(module::Module & module);
63
64     private:
65         module::Module * module_;
66     };
67
68 }}
69
70 #include "Route.ih"
71
72 namespace senf {
73 namespace ppi {
74
75     /** \brief Route descriptor
76         
77         Route instances are created by Module::route statements. The Route class provides an
78         interface to manipulate the flow processing.
79      */
80     template <class Source, class Target>
81     class Route
82         : public detail::RouteImplementation< boost::is_base_of<EventDescriptor,Source>::value,
83                                               boost::is_base_of<EventDescriptor,Target>::value >
84     {
85     private:
86         typedef detail::RouteImplementation< 
87             boost::is_base_of<EventDescriptor,Source>::value,
88             boost::is_base_of<EventDescriptor,Target>::value > Implementation;
89         
90         Route(module::Module & module, Source & source, Target & target);
91
92         friend class module::Module;
93     };
94
95 }}
96
97 ///////////////////////////////hh.e////////////////////////////////////////
98 #include "Route.cci"
99 //#include "Route.ct"
100 #include "Route.cti"
101 #endif
102
103 \f
104 // Local Variables:
105 // mode: c++
106 // fill-column: 100
107 // c-file-style: "senf"
108 // indent-tabs-mode: nil
109 // ispell-local-dictionary: "american"
110 // compile-command: "scons -u test"
111 // comment-column: 40
112 // End: