Lumiera  0.pre.03
»edit your freedom«
core-service.hpp
Go to the documentation of this file.
1 /*
2  CORE-SERVICE.hpp - service to address the application core from the UI
3 
4  Copyright (C) Lumiera.org
5  2015, 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 
23 
84 #ifndef STAGE_CTRL_CORE_SERVICE_H
85 #define STAGE_CTRL_CORE_SERVICE_H
86 
87 
88 #include "lib/error.hpp"
89 #include "lib/nocopy.hpp"
90 #include "lib/idi/entry-id.hpp"
91 #include "lib/diff/gen-node.hpp"
94 #include "stage/ctrl/bus-term.hpp"
95 #include "stage/ctrl/nexus.hpp"
96 
97 
98 namespace stage {
99 namespace ctrl{
100 
102  using lib::diff::Rec;
103 
104 
115  : public BusTerm
117  {
118 
119  Nexus uiBusBackbone_;
120  StateRecorder stateRecorder_;
121 
122 
123  virtual void
124  act (GenNode const& command) override
125  {
126  SessionCommand::facade().trigger (command.idi.getSym(), command.data.get<Rec>());
127  }
128 
129 
130  virtual void
131  note (ID subject, GenNode const& stateMark) override
132  {
133  stateRecorder_.recordState (subject, stateMark);
134  }
135 
136 
137  public:
138  explicit
140  : BusTerm(identity, uiBusBackbone_)
141  , uiBusBackbone_{*this}
142  , stateRecorder_{*this}
143  {
144  INFO (stage, "UI-Backbone operative.");
145  }
146 
147  ~CoreService();
148 
149 
150  StateManager&
151  getStateManager()
152  {
153  return stateRecorder_;
154  }
155  };
156 
157 
158 
159 }} // namespace stage::ctrl
160 #endif /*STAGE_CTRL_CORE_SERVICE_H*/
Simple map based implementation of the PresentationStateManager interface.
Global access point to invoke commands and cause edit operations within the Session.
connection point at the UI-Bus.
Definition: bus-term.hpp:105
Any copy and copy construction prohibited.
Definition: nocopy.hpp:46
virtual void act(GenNode const &command) override
prepare or trigger invocation of a command.
typed symbolic and hash ID for asset-like position accounting.
Definition: entry-id.hpp:135
static lib::Depend< SessionCommand > facade
static storage for the facade access front-end
Attachment point to the UI-Bus.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:46
virtual void note(ID subject, GenNode const &stateMark) override
capture and record a "state mark" for later replay for restoring UI state.
Implementation of the PresentationStateManager interface through associative (key-value) store...
Generic building block for tree shaped (meta)data structures.
Interface: handling of persistent interface state.
Central hub of the UI-Bus.
Definition: nexus.hpp:76
BusTerm(BusTerm &&)=default
may be moved, but not copied, due to the embedded identity
Lumiera error handling (C++ interface).
void recordState(ID uiElm, StateMark stateMark)
Interface for the operating facility (CoreService) to feed state mark messages to be remembered...
Bare symbolic and hash ID used for accounting of asset like entries.
Attachment point to »central services« within the UI-Bus.
object-like record of data.
Definition: record.hpp:150
Core hub and routing table of the UI-Bus.
Major public Interface to the Session subsystem of Lumiera GUI.
generic data element node within a tree
Definition: gen-node.hpp:231