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)
5  2015, 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 
75 #ifndef STAGE_CTRL_CORE_SERVICE_H
76 #define STAGE_CTRL_CORE_SERVICE_H
77 
78 
79 #include "lib/error.hpp"
80 #include "lib/nocopy.hpp"
81 #include "lib/idi/entry-id.hpp"
82 #include "lib/diff/gen-node.hpp"
85 #include "stage/ctrl/bus-term.hpp"
86 #include "stage/ctrl/nexus.hpp"
87 
88 
89 namespace stage {
90 namespace ctrl{
91 
93  using lib::diff::Rec;
94 
95 
106  : public BusTerm
108  {
109 
110  Nexus uiBusBackbone_;
111  StateRecorder stateRecorder_;
112 
113 
114  virtual void
115  act (GenNode const& command) override
116  {
117  SessionCommand::facade().trigger (command.idi.getSym(), command.data.get<Rec>());
118  }
119 
120 
121  virtual void
122  note (ID subject, GenNode const& stateMark) override
123  {
124  stateRecorder_.recordState (subject, stateMark);
125  }
126 
127 
128  public:
129  explicit
131  : BusTerm(identity, uiBusBackbone_)
132  , uiBusBackbone_{*this}
133  , stateRecorder_{*this}
134  {
135  INFO (stage, "UI-Backbone operative.");
136  }
137 
138  ~CoreService();
139 
140 
141  StateManager&
142  getStateManager()
143  {
144  return stateRecorder_;
145  }
146  };
147 
148 
149 
150 }} // namespace stage::ctrl
151 #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:96
Any copy and copy construction prohibited.
Definition: nocopy.hpp:37
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:126
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:37
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:67
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:141
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:222