Lumiera  0.pre.03
»edit your freedom«
NotificationService Class Reference

#include "stage/notification-service.hpp"

Description

Actual implementation of the GuiNotification service within the Lumiera GTK GUI.

Creating an instance of this class automatically registers the interface with the Lumiera Interface/Plugin system and creates a forwarding proxy within the application core to route calls through this interface.

Note
the ctor of this class establishes an "up-link" connection to the UI-Bus, which enables the service implementation to talk to other facilities within the UI.

Definition at line 76 of file notification-service.hpp.

Public Member Functions

 NotificationService (ctrl::BusTerm &upLink, ctrl::UiManager &uiManager)
 When started, NotificationService connects to the UI-Bus via the provided connection. More...
 
void displayInfo (NotifyLevel, string const &text) override
 push a user visible notification text
 
void mark (ID uiElement, GenNode &&) override
 
void markError (ID uiElement, string const &text) override
 
void markNote (ID uiElement, string const &text) override
 
void mutate (ID uiElement, MutationMessage &&) override
 
void triggerGuiShutdown (string const &cause) override
 causes the GUI to shut down unconditionally More...
 
- Public Member Functions inherited from GuiNotification
virtual void mark (ID uiElement, GenNode &&stateMark)=0
 send a generic state mark message to some element
 
virtual void markError (ID uiElement, string const &text)=0
 highlight an element in the UI as problem location
 
virtual void markNote (ID uiElement, string const &text)=0
 attach an warning or state information element
 
virtual void mutate (ID uiElement, MutationMessage &&)=0
 push a diff message up into the user interface. More...
 
- 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...
 
virtual bool change (ID subject, MutationMessage &&diff)
 alter and reshape the designated subject by applying the given diff message. More...
 
ID getID () const
 
virtual bool mark (ID subject, GenNode const &mark)
 route a state update or notification to the given subject. More...
 
virtual size_t markAll (GenNode const &mark)
 broadcast a notification message to all currently connected bus terminals. More...
 
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
 
virtual operator string () const
 

Private Types

using ServiceInstanceHandle = lumiera::InstanceHandle< LUMIERA_INTERFACE_INAME(lumieraorg_GuiNotification, 0), GuiNotification >
 

Private Member Functions

void dispatchMsg (ID, lib::diff::GenNode &&)
 

Private Attributes

std::unique_ptr< ctrl::UiDispatcherdispatch_
 
ServiceInstanceHandle serviceInstance_
 
ctrl::UiManageruiManager_
 

Additional Inherited Members

- Public Types inherited from BusTerm
using ID = EntryID const &
 
- Static Public Attributes inherited from GuiNotification
static lib::Depend< GuiNotificationfacade
 static storage for the facade access front-end
 
- Protected Types inherited from BusTerm
using EntryID = lib::idi::BareEntryID
 
using Tangible = stage::model::Tangible
 
- Protected Member Functions inherited from GuiNotification
virtual ~GuiNotification ()
 this is an interface
 
- Protected Member Functions inherited from BusTerm
 BusTerm (ID identity, BusTerm &attached_to)
 
bool isShortCircuit (ID) const noexcept
 
virtual BusTermrouteAdd (ID, Tangible &)
 
virtual void routeDetach (ID) noexcept
 
- Protected Attributes inherited from BusTerm
EntryID endpointID_
 
BusTermtheBus_
 

Constructor & Destructor Documentation

◆ NotificationService()

NotificationService ( ctrl::BusTerm upLink,
ctrl::UiManager uiManager 
)

When started, NotificationService connects to the UI-Bus via the provided connection.

This is a simple, unidirectional up-link connection, without actively adding NotificationService into the routing tables in [Nexus]. Yet this simple connection is sufficient to implement this service by talking to other facilities within the UI layer.

Remarks
internally this service relies on a UiDispatcher queue to hand over any invocations into the GTK event loop thread.

Definition at line 317 of file notification-service.cpp.

References NotificationService::displayInfo(), LUMIERA_INTERFACE_REF, and stage::NOTE_ERROR.

+ Here is the call graph for this function:

Member Function Documentation

◆ dispatchMsg()

void dispatchMsg ( ID  uiElement,
lib::diff::GenNode &&  uiMessage 
)
private

helper to move a given UI-Bus message (GenNode) into the closure of an event-lambda, which then is handed over to the UI event thread through the dispatcher queue.

Definition at line 95 of file notification-service.cpp.

References BusTerm::mark().

+ Here is the call graph for this function:

◆ triggerGuiShutdown()

void triggerGuiShutdown ( string const &  cause)
overridevirtual

causes the GUI to shut down unconditionally

Parameters
causeuser visible explanation of the reason causing this shutdown
Warning
since the UI is a subsystem, this call eventually terminates the whole application.

Implements GuiNotification.

Definition at line 156 of file notification-service.cpp.

References cStr(), NotificationService::displayInfo(), stage::NOTE_ERROR, and UiManager::terminateUI().

+ Here is the call graph for this function:
+ Inheritance diagram for NotificationService:
+ Collaboration diagram for NotificationService:

The documentation for this class was generated from the following files: