Lumiera
0.pre.03
»edit your freedom«
|
#include "stage/ctrl/nexus.hpp"
Central hub of the UI-Bus.
This special implementation of the [BusTerm] interface maintains a routing table and manages the connections to individual UI-Elements. The nexus relies on a dedicated (up)link to the [CoreService] to handle command invocation and presentation state. This is implemented by wiring the aforementioned CoreService terminal as "up-link", while actually defining special handling overrides for all other kinds of messages. The purpose of the Nexus is to route all these other kinds of messages.
Thus, the "uplink", which is in fact the CoreService, is left to handle
act
* messages (command invocation)note
* messages (upstream state change notification)Public Member Functions | |
Nexus (BusTerm &uplink_to_CoreService, ID identity=lib::idi::EntryID< Nexus >()) | |
size_t | size () const |
Public Member Functions inherited from BusTerm | |
BusTerm (BusTerm &&)=default | |
may be moved, but not copied, due to the embedded identity | |
virtual | ~BusTerm () |
this is an interface More... | |
virtual void | act (GenNode const &command) |
prepare or trigger invocation of a command. More... | |
BusTerm | attach (ID, Tangible &newNode) |
Builder function: establish and wire a new BusTerm. More... | |
ID | getID () const |
virtual void | note (ID subject, GenNode const &mark) |
capture and record a "state mark" for later replay for restoring UI state. More... | |
void | note (GenNode const &mark) |
record state mark from this subject | |
Protected Member Functions | |
virtual bool | change (ID subject, MutationMessage &&diff) override |
direct a mutation message towards the indicated Tangible. More... | |
virtual bool | mark (ID subject, GenNode const &mark) override |
route mark messages down to the individual Tangible. More... | |
virtual size_t | markAll (GenNode const &mark) override |
broadcast a notification to all connected terminal nodes. More... | |
virtual | operator string () const |
virtual BusTerm & | routeAdd (ID identity, Tangible &newNode) override |
add a new down-link connection to the routing table More... | |
virtual void | routeDetach (ID node) noexcept override |
deactivate and remove a down-link route. More... | |
Protected Member Functions inherited from BusTerm | |
BusTerm (ID identity, BusTerm &attached_to) | |
bool | isShortCircuit (ID) const noexcept |
Private Types | |
typedef std::unordered_map< EntryID, Tangible *, EntryID::UseEmbeddedHash > | RoutingTable |
Private Attributes | |
RoutingTable | routingTable_ |
Additional Inherited Members | |
Public Types inherited from BusTerm | |
using | ID = EntryID const & |
Protected Types inherited from BusTerm | |
using | EntryID = lib::idi::BareEntryID |
using | Tangible = stage::model::Tangible |
Protected Attributes inherited from BusTerm | |
EntryID | endpointID_ |
BusTerm & | theBus_ |
Private Member Functions inherited from NonCopyable | |
NonCopyable (NonCopyable const &)=delete | |
NonCopyable & | operator= (NonCopyable const &)=delete |
|
inlineoverrideprotectedvirtual |
route mark messages down to the individual Tangible.
Reimplemented from BusTerm.
Reimplemented in TestNexus.
Definition at line 83 of file nexus.hpp.
References steam::mobject::session::query::anonymous_namespace{fake-configrules.cpp}::entry().
Referenced by Nexus::markAll().
|
inlineoverrideprotectedvirtual |
broadcast a notification to all connected terminal nodes.
Reimplemented from BusTerm.
Reimplemented in TestNexus.
Definition at line 99 of file nexus.hpp.
References steam::mobject::session::query::anonymous_namespace{fake-configrules.cpp}::entry(), and Nexus::mark().
|
inlineoverrideprotectedvirtual |
direct a mutation message towards the indicated Tangible.
Reimplemented from BusTerm.
Reimplemented in TestNexus.
Definition at line 116 of file nexus.hpp.
References steam::mobject::session::query::anonymous_namespace{fake-configrules.cpp}::entry().
|
inlineoverrideprotectedvirtual |
add a new down-link connection to the routing table
identity | the endpoint-ID used to address the new element to be connected to the bus. |
newNode | to add the address (!) into the routing table |
Reimplemented from BusTerm.
Reimplemented in TestNexus.
|
inlineoverrideprotectedvirtualnoexcept |