Lumiera  0.pre.03
»edit your freedom«
display-interface-proxy.cpp
Go to the documentation of this file.
1 /*
2  Display(Proxy) - service providing access to a display for outputting frames
3 
4  Copyright (C)
5  2009, Hermann Vosseler <Ichthyostega@web.de>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 * *****************************************************************/
13 
14 
15 
28 #include "include/display-facade.h"
30 
31 namespace lumiera {
32 
35 
38 
39 } // namespace lumiera
40 
41 
42 
43 namespace lumiera {
44 namespace facade {
45 
46 
47 
48  /* ==================== stage::Display ====================================== */
49 
50  using Interface = LUMIERA_INTERFACE_INAME(lumieraorg_Display, 0);
51  using Facade = lumiera::Display;
52 
53  using IHandle = InstanceHandle<Interface, Facade>;
54 
55 
56  template<>
57  class Proxy<IHandle>
58  : public Binding<IHandle>
59  {
60  //----Proxy-Implementation-of-lumiera::Display--------
61 
63  getHandle (LumieraDisplaySlot display) override
64  {
65  _i_.allocate (display);
66  Sink sinkHandle;
67  sinkHandle.activate (display, _i_.release);
68  if (lumiera_error_peek() || !sinkHandle)
69  throw lumiera::error::State("failed to allocate output DisplayerSlot",
70  lumiera_error());
71  return sinkHandle;
72  }
73 
74 
75  public:
77  };
78 
79 
81  template
83 
84 }} //namespace facade::lumiera
Interface for outputting frames to an (already allocated) viewer or display.
lumiera_err lumiera_error_peek(void)
Check current error state without clearing it Please avoid this function and use lumiera_error() if p...
Definition: error-state.c:133
static lib::Depend< Display > facade
get an implementation instance of this service
virtual ~Display()
this is an interface
Access point to singletons and other kinds of dependencies designated by type.
Definition: depend.hpp:280
Experimental Interface, allowing the Dummy-Player to access the video display widget in the GUI...
Derived specific exceptions within Lumiera&#39;s exception hierarchy.
Definition: error.hpp:190
to be specialised and implemented for each individual interface and facade interface.
Implementation Base for building Facade Proxy implementations.
lumiera_err lumiera_error(void)
Get and clear current error state.
Definition: error-state.c:115
virtual Sink getHandle(LumieraDisplaySlot)=0
allocate an already existing display/viewer for output
Implementation of C++ binding proxies on top of the (plain-C based) interface system.
Handle tracking the registration of an interface, deregistering it on deletion.
#define LUMIERA_INTERFACE_INAME(name, version)
Construct a type identifier for an interface.
Definition: interface.h:93
Handle & activate(IMP *impl, DEL whenDead)
Activation of the handle by the managing service.
Definition: handle.hpp:112
Lumiera public interface.
Definition: advice.cpp:104
Functor for pushing frames to the display.