![]() |
Lumiera 0.pre.04
»edit your freedom«
|
#include "/Werk/devel/lumi/tests/stage/test/mock-elm.hpp"
Mock UI element or controller.
Within Lumiera, all interface components of relevance are based on the [Tangible] interface, which we mock here for unit testing. This special implementation is instrumented to log any invocation and any messages sent or received through the UI Backbone, which is formed by the UI-Bus.
Definition at line 99 of file mock-elm.hpp.
Public Attributes | |
| std::map< string, string > | attrib |
| std::vector< PMockElm > | scope |
Public Member Functions | |
| MockElm (string id) | |
| MockElm (ID identity, ctrl::BusTerm &nexus=Nexus::testUI()) | |
| ~MockElm () | |
| document our death in the diagnostic log. | |
| void | kill () |
| commit suicide. | |
| ID | getID () const |
| bool | isTouched () const |
| bool | isExpanded () const |
| bool | isError () const |
| string | getMessage () const |
| string | getError () const |
| EventMatch | verify (string match) const |
| EventMatch | verifyMatch (string regExp) const |
| EventMatch | verifyEvent (string match) const |
| EventMatch | verifyEvent (string classifier, string match) const |
| EventMatch | verifyCall (string match) const |
| EventMatch | ensureNot (string match) const |
| EventMatch | verifyMark (string id) const |
| special verification match on a "state mark" message to this element | |
| EventMatch | verifyMark (string id, string payloadMatch) const |
| verification match on a specific "state mark" message | |
| template<typename X > | |
| EventMatch | verifyMark (string id, X const &something) const |
| EventLog const & | getLog () const |
| EventLog & | joinLog (MockElm &otherMock) |
| EventLog & | joinLog (EventLog &otherLog) |
Public Member Functions inherited from Tangible | |
| virtual | ~Tangible () |
| this is an interface | |
| operator string () const | |
| diagnostic representation. | |
| operator LuidH () const | |
| ID | getID () const |
| void | reset () |
| invoke the generic reset hook | |
| void | clearMsg () |
| invoke the hook to clear notification messages | |
| void | clearErr () |
| invoke the hook to clear error markers | |
| template<typename... ARGS> | |
| void | invoke (Symbol cmdID, ARGS &&...) |
| void | invoke (Symbol cmdID, Rec &&arguments) |
| Perform a command or action, once the execution context has been established. | |
| void | slotExpand () |
| Expand this element and remember the expanded state. | |
| void | slotCollapse () |
| Collapse or minimise this element and remember the collapsed state. | |
| void | slotReveal () |
| Cause the element to be brought into sight. | |
| void | markFlash () |
| highlight the element visually to catch the user's attention | |
| void | markMsg (string message) |
| push a notification (or warning) message to the element. | |
| void | markErr (string error) |
| push an error state tag to the element | |
| void | mark (GenNode const &) |
| generic handler for all incoming "state mark" messages | |
| void | installExpander (Expander::ProbeFun, Expander::ChangeFun) |
| Configure the (optional) functionality to expand or collapse the UI-Element. | |
| void | installRevealer (Revealer::RevealeItFun) |
| Configure the (optional) functionality to bring the UI-Element into sight. | |
| template<typename... ARGS> | |
| void | invoke (Symbol cmdID, ARGS &&... args) |
| convenience shortcut to issue a command with several arguments | |
Public Member Functions inherited from DiffMutable | |
| virtual | ~DiffMutable () |
| this is an interface | |
Protected Member Functions | |
| string | identify () const |
Protected Member Functions inherited from Tangible | |
| Tangible (ID identity, ctrl::BusTerm &nexus) | |
Private Types | |
| using | _Par = stage::model::Tangible |
Private Member Functions | |
| virtual bool | doReset () override |
| virtual bool | doExpand (bool yes) override |
| generic default implementation of the expand/collapse functionality. | |
| virtual void | doReveal () override |
| generic default implementation of the "reveal" functionality. | |
| virtual bool | doMsg (string text) override |
| virtual bool | doClearMsg () override |
| virtual bool | doErr (string text) override |
| virtual bool | doClearErr () override |
| virtual void | doFlash () override |
| virtual void | doMark (GenNode const &mark) override |
| default implementation and catch-all handler for receiving »state mark« messages. | |
| virtual void | buildMutator (TreeMutator::Handle buffer) override |
| build a custom implementation of the TreeMutator interface, suitably wired to cause appropriate changes to the opaque data structure, in accordance to the semantics of the tree diff language. | |
Private Attributes | |
| EventLog | log_ {this->identify()} |
| bool | virgin_ {true} |
| bool | expanded_ {false} |
| string | message_ |
| string | error_ |
Additional Inherited Members | |
Public Types inherited from Tangible | |
| using | ID = ctrl::BusTerm::ID |
| using | LuidH = lib::hash::LuidH |
Protected Types inherited from Tangible | |
| using | Rec = lib::diff::Rec |
| using | GenNode = lib::diff::GenNode |
Protected Attributes inherited from Tangible | |
| ctrl::BusTerm | uiBus_ |
| Expander | expand_ |
| Revealer | reveal_ |
|
inlineexplicit |
Definition at line 289 of file mock-elm.hpp.
|
inlineexplicit |
Definition at line 294 of file mock-elm.hpp.
References EventLog::call(), EventLog::create(), EventLog::event(), MockElm::expanded_, MockElm::getID(), MockElm::identify(), Tangible::installExpander(), MockElm::log_, and MockElm::virgin_.
Here is the call graph for this function:
|
inline |
document our death in the diagnostic log.
Definition at line 310 of file mock-elm.hpp.
References EventLog::call(), EventLog::destroy(), MockElm::getID(), MockElm::identify(), MockElm::log_, and lumiera_error().
Here is the call graph for this function:
|
private |
Definition at line 102 of file mock-elm.hpp.
|
inlineoverrideprivatevirtual |
Implements Tangible.
Definition at line 117 of file mock-elm.hpp.
References EventLog::call(), EventLog::event(), MockElm::expanded_, MockElm::identify(), MockElm::log_, stage::MARK_reset, MockElm::message_, and MockElm::virgin_.
Here is the call graph for this function:
|
inlineoverrideprivatevirtual |
generic default implementation of the expand/collapse functionality.
Based on the expand_ functor, which needs to be configured explicitly to enable this functionality.
true if the actual expansion state has been changed. Reimplemented from Tangible.
Definition at line 132 of file mock-elm.hpp.
References EventLog::call(), MockElm::identify(), MockElm::log_, and stage::MARK_expand.
Here is the call graph for this function:
|
inlineoverrideprivatevirtual |
generic default implementation of the "reveal" functionality.
Based on the reveal_ functor, which needs to be configured explicitly to enable this functionality.
Reimplemented from Tangible.
Definition at line 139 of file mock-elm.hpp.
References EventLog::call(), MockElm::identify(), MockElm::log_, and stage::MARK_reveal.
Here is the call graph for this function:
|
inlineoverrideprivatevirtual |
Implements Tangible.
Definition at line 146 of file mock-elm.hpp.
References EventLog::call(), MockElm::identify(), MockElm::log_, MockElm::message_, EventLog::note(), and MockElm::virgin_.
Here is the call graph for this function:
|
inlineoverrideprivatevirtual |
Implements Tangible.
Definition at line 158 of file mock-elm.hpp.
References EventLog::call(), MockElm::identify(), MockElm::log_, MockElm::message_, and EventLog::note().
Here is the call graph for this function:
|
inlineoverrideprivatevirtual |
Implements Tangible.
Definition at line 170 of file mock-elm.hpp.
References EventLog::call(), MockElm::error_, MockElm::identify(), MockElm::log_, EventLog::note(), and MockElm::virgin_.
Here is the call graph for this function:
|
inlineoverrideprivatevirtual |
Implements Tangible.
Definition at line 182 of file mock-elm.hpp.
References EventLog::call(), MockElm::error_, MockElm::identify(), MockElm::isError(), MockElm::log_, and EventLog::note().
Here is the call graph for this function:
|
inlineoverrideprivatevirtual |
Implements Tangible.
Definition at line 194 of file mock-elm.hpp.
References EventLog::call(), MockElm::identify(), MockElm::log_, and EventLog::note().
Here is the call graph for this function:
|
inlineoverrideprivatevirtual |
default implementation and catch-all handler for receiving »state mark« messages.
Such messages serve either to cause a presentation state effect specific to this element, or they are used to re-play a former state change to restore some specific UI state captured within a past working session. Events handled here:
bool argument calls the doExpand(bool) virtual function. It is up to the concrete element to give this a tangible meaning, e.g. a track might switch to detail view and a clip might reveal attached effects.doReset()doReveal(myID) on this parent. For instance, a clip might ask the enclosing track, which in turn might call the enclosing timeline display for help, resulting in a scroll action to bring the clip into sight. Implements Tangible.
Definition at line 202 of file mock-elm.hpp.
References EventLog::call(), MockElm::identify(), MockElm::log_, Tangible::mark(), EventLog::note(), and MockElm::virgin_.
Here is the call graph for this function:
|
inlineoverrideprivatevirtual |
build a custom implementation of the TreeMutator interface, suitably wired to cause appropriate changes to the opaque data structure, in accordance to the semantics of the tree diff language.
| buffer | a buffer handle, which can be used to placement-construct |
Implements Tangible.
Definition at line 215 of file mock-elm.hpp.
References MockElm::attrib, TreeMutator::build(), EventLog::call(), GenNode::data, PlantingHandle< BA, DEFAULT >::emplace(), EventLog::event(), MockElm::getID(), BareEntryID::getSym(), MockElm::identify(), GenNode::idi, GenNode::isNamed(), DataCap::isNested(), MockElm::log_, and MockElm::scope.
Here is the call graph for this function:
|
inlineprotected |
Definition at line 281 of file mock-elm.hpp.
References MockElm::getID(), and lib::idi::instanceTypeID().
Referenced by MockElm::MockElm(), MockElm::~MockElm(), MockElm::buildMutator(), MockElm::doClearErr(), MockElm::doClearMsg(), MockElm::doErr(), MockElm::doExpand(), MockElm::doFlash(), MockElm::doMark(), MockElm::doMsg(), MockElm::doReset(), MockElm::doReveal(), and MockElm::kill().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
commit suicide.
Definition at line 340 of file mock-elm.hpp.
References EventLog::call(), EventLog::destroy(), EventLog::event(), MockElm::getID(), MockElm::identify(), MockElm::log_, Tangible::uiBus_, and Nexus::zombificate().
Referenced by BusTerm_test::attachNewBusTerm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 360 of file mock-elm.hpp.
References BusTerm::getID(), and Tangible::uiBus_.
Referenced by MockElm::MockElm(), MockElm::~MockElm(), MockElm::buildMutator(), BusTerm_test::captureStateMark(), BusTerm_test::clearStates(), MockElm::identify(), MockElm::kill(), AbstractTangible_test::markState(), AbstractTangible_test::mutate(), AbstractTangible_test::notify(), BusTerm_test::pushDiff(), BusTerm_test::replayStateMark(), AbstractTangible_test::revealer(), ViewSpecDSL_test::verify_genericInvocation(), and BusTerm_test::verifyNotifications().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 366 of file mock-elm.hpp.
References MockElm::virgin_.
Referenced by BusTerm_test::clearStates(), AbstractTangible_test::markState(), BusTerm_test::replayStateMark(), AbstractTangible_test::revealer(), and BusTerm_test::verifyNotifications().
Here is the caller graph for this function:
|
inline |
Definition at line 372 of file mock-elm.hpp.
References MockElm::expanded_.
Referenced by BusTerm_test::clearStates(), AbstractTangible_test::markState(), BusTerm_test::replayStateMark(), and AbstractTangible_test::revealer().
Here is the caller graph for this function:
|
inline |
Definition at line 378 of file mock-elm.hpp.
References MockElm::error_.
Referenced by BusTerm_test::clearStates(), MockElm::doClearErr(), AbstractTangible_test::notify(), and BusTerm_test::verifyNotifications().
Here is the caller graph for this function:
|
inline |
Definition at line 384 of file mock-elm.hpp.
References MockElm::message_.
Referenced by BusTerm_test::clearStates(), AbstractTangible_test::notify(), and BusTerm_test::verifyNotifications().
Here is the caller graph for this function:
|
inline |
Definition at line 390 of file mock-elm.hpp.
References MockElm::error_.
Referenced by BusTerm_test::clearStates(), AbstractTangible_test::notify(), and BusTerm_test::verifyNotifications().
Here is the caller graph for this function:
|
inline |
Definition at line 398 of file mock-elm.hpp.
References MockElm::getLog(), and EventLog::verify().
Referenced by AbstractTangible_test::notify(), and AbstractTangible_test::verify_mockManipulation().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 404 of file mock-elm.hpp.
References MockElm::getLog(), and EventLog::verifyMatch().
Here is the call graph for this function:
|
inline |
Definition at line 410 of file mock-elm.hpp.
References MockElm::getLog(), and EventLog::verifyEvent().
Referenced by AbstractTangible_test::markState(), AbstractTangible_test::mutate(), and AbstractTangible_test::revealer().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 416 of file mock-elm.hpp.
References MockElm::getLog(), and EventLog::verifyEvent().
Here is the call graph for this function:
|
inline |
Definition at line 422 of file mock-elm.hpp.
References MockElm::getLog(), and EventLog::verifyCall().
Referenced by AbstractTangible_test::markState().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 428 of file mock-elm.hpp.
References EventLog::ensureNot(), and MockElm::getLog().
Referenced by AbstractTangible_test::markState(), AbstractTangible_test::notify(), AbstractTangible_test::revealer(), and AbstractTangible_test::verify_mockManipulation().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
special verification match on a "state mark" message to this element
Definition at line 435 of file mock-elm.hpp.
References MockElm::getLog(), EventMatch::id(), EventMatch::type(), and EventLog::verify().
Referenced by AbstractTangible_test::markState(), AbstractTangible_test::notify(), and AbstractTangible_test::revealer().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
verification match on a specific "state mark" message
| id | the ID-symbol used, identifying the kind of notification message |
| payloadMatch | to be applied to the payload of the message solely |
Definition at line 445 of file mock-elm.hpp.
References MockElm::getLog(), EventMatch::id(), EventMatch::type(), and EventLog::verifyEvent().
Here is the call graph for this function:
|
inline |
Definition at line 452 of file mock-elm.hpp.
References MockElm::getLog(), EventMatch::id(), EventMatch::type(), and EventLog::verifyEvent().
Here is the call graph for this function:
|
inline |
Definition at line 459 of file mock-elm.hpp.
References MockElm::log_.
Referenced by BusTerm_test::attachNewBusTerm(), MockElm::ensureNot(), AbstractTangible_test::markState(), AbstractTangible_test::mutate(), AbstractTangible_test::notify(), BusTerm_test::pushDiff(), AbstractTangible_test::revealer(), MockElm::verify(), MockElm::verifyCall(), MockElm::verifyEvent(), MockElm::verifyEvent(), MockElm::verifyMark(), MockElm::verifyMark(), MockElm::verifyMark(), and MockElm::verifyMatch().
Here is the caller graph for this function:Definition at line 465 of file mock-elm.hpp.
References EventLog::joinInto(), and MockElm::log_.
Referenced by BusTerm_test::clearStates(), AbstractTangible_test::verify_mockManipulation(), and BusTerm_test::verifyNotifications().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 472 of file mock-elm.hpp.
References EventLog::joinInto(), and MockElm::log_.
Here is the call graph for this function:Definition at line 104 of file mock-elm.hpp.
Referenced by MockElm::MockElm(), MockElm::~MockElm(), MockElm::buildMutator(), MockElm::doClearErr(), MockElm::doClearMsg(), MockElm::doErr(), MockElm::doExpand(), MockElm::doFlash(), MockElm::doMark(), MockElm::doMsg(), MockElm::doReset(), MockElm::doReveal(), MockElm::getLog(), MockElm::joinLog(), MockElm::joinLog(), and MockElm::kill().
|
private |
Definition at line 106 of file mock-elm.hpp.
Referenced by MockElm::MockElm(), MockElm::doErr(), MockElm::doMark(), MockElm::doMsg(), MockElm::doReset(), and MockElm::isTouched().
|
private |
Definition at line 107 of file mock-elm.hpp.
Referenced by MockElm::MockElm(), MockElm::doReset(), and MockElm::isExpanded().
|
private |
Definition at line 109 of file mock-elm.hpp.
Referenced by MockElm::doClearMsg(), MockElm::doMsg(), MockElm::doReset(), and MockElm::getMessage().
|
private |
Definition at line 110 of file mock-elm.hpp.
Referenced by MockElm::doClearErr(), MockElm::doErr(), MockElm::getError(), and MockElm::isError().
| std::map<string, string> attrib |
Definition at line 354 of file mock-elm.hpp.
Referenced by MockElm::buildMutator(), AbstractTangible_test::mutate(), and BusTerm_test::pushDiff().
| std::vector<PMockElm> scope |
Definition at line 355 of file mock-elm.hpp.
Referenced by MockElm::buildMutator(), AbstractTangible_test::mutate(), and BusTerm_test::pushDiff().
Inheritance diagram for MockElm:
Collaboration diagram for MockElm: