Lumiera  0.pre.03
»edit your freedom«
interfaceproxy.hpp
Go to the documentation of this file.
1 /*
2  INTERFACEPROXY - definition of forwarding proxies for the facade interfaces
3 
4  Copyright (C) Lumiera.org
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
123 #ifndef LUMIERA_INTERFACE_PROXY_H
124 #define LUMIERA_INTERFACE_PROXY_H
125 
126 
127 #include "common/instancehandle.hpp"
128 #include "lib/error.hpp"
129 #include "lib/util.hpp"
130 
131 
132 namespace lumiera {
133 namespace facade {
134 
148  template<class IHA>
149  struct Binding;
150 
151  template<class FA, class I>
152  struct Binding<InstanceHandle<I,FA>>
153  : public FA
154  {
156 
157  I& _i_;
158 
159  Binding (IHandle const& iha)
160  : _i_(iha.get())
161  { }
162  };
163 
164 
165 
166  template<class I, class FA>
167  Link<I,FA>::Link (IH const& iha)
168  : ServiceHandle<I,FA>{iha}
169  { }
170 
171  template<class I, class FA>
172  Link<I,FA>::~Link() { }
173 
174 
175  template<class I, class FA>
176  FA*
177  Link<I,FA>::operator->() const
178  {
180  }
181 
182 
183 
184 }} // namespace lumiera::facade
185 
186 #endif
I & get() const
directly access the instance via the CL interface
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Implementation Base for building Facade Proxy implementations.
Lumiera error handling (C++ interface).
Handle tracking the registration of an interface, deregistering it on deletion.
Lumiera public interface.
Definition: advice.cpp:113
A handle template for automatically dealing with interface and plugin registration and deregistration...
typename lib::DependInject< FA >::template ServiceInstance< Proxy< InstanceHandle< I, FA > >> ServiceHandle
The ServiceHandle automatically creates and manages the Proxy instance.