Lumiera  0.pre.03
»edityourfreedom«
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GenNodeLocationQuery Class Reference

#include "gui/interact/gen-node-location-query.hpp"

Description

Test/Diagnostics: implementation of the LocationQuery-API based on a abstract topological structure given as Record<GenNode> ("GenNode tree").

Remarks
intended for verifying path resolution and navigation through unit tests

Definition at line 99 of file gen-node-location-query.hpp.

Public Member Functions

template<class REC >
 GenNodeLocationQuery (REC &&backingStructure)
 
virtual Literal determineAnchor (UICoord const &path) override
 resolve Anchor against GenNode tree More...
 
virtual size_t determineCoverage (UICoord const &path) override
 evaluate to what extent a UIcoord spec matches the structure given as GenNode tree More...
 
virtual ChildIter getChildren (UICoord const &path, size_t pos) override
 get the sequence of child IDs at a designated position in the backing GenNode tree More...
 
- Public Member Functions inherited from LocationQuery
virtual ~LocationQuery ()
 this is an interface More...
 

Classes

class  GenNodeNavigator
 Helper to navigate a tree topology represented as GenNode tree. More...
 

Private Member Functions

Rec const & drillDown (Rec const &tree, UICoord const &path, size_t maxDepth, size_t &depth)
 
Literal getCurrentWindow ()
 
Literal getFirstWindow ()
 
Literal resolveElm (UICoord const &path, size_t depth)
 

Static Private Member Functions

template<class IT >
static TreeStructureNavigatorbuildNavigator (Rec const &node, size_t depth, IT &&rawIterator)
 type rebinding helper to pick up the concrete child iterator type IT More...
 
static TreeStructureNavigatorchildNavigator (Rec const &node, size_t depth)
 
static Rec const & descendInto (Rec const &tree, size_t depth, const char *pathElm)
 within tree at level depth descend into the child element designated by pathElm More...
 
static bool hasNode (Rec const &tree, const char *pathElm, size_t depth)
 does the guiding tree contain the element as requested by the UICoord path? More...
 

Private Attributes

Rec tree_
 

Additional Inherited Members

- Public Types inherited from LocationQuery
using ChildIter = decltype(TreeStructureNavigator::buildIterator(0))
 

Constructor & Destructor Documentation

GenNodeLocationQuery ( REC &&  backingStructure)
inline

Definition at line 106 of file gen-node-location-query.hpp.

Member Function Documentation

virtual Literal determineAnchor ( UICoord const &  path)
inlineoverridevirtual

resolve Anchor against GenNode tree

Implements LocationQuery.

Definition at line 115 of file gen-node-location-query.hpp.

References Symbol::BOTTOM, GenNodeLocationQuery::getCurrentWindow(), GenNodeLocationQuery::getFirstWindow(), UICoord::getWindow(), util::isnil(), UICoord::isPresent(), gui::interact::UIC_CURRENT_WINDOW, gui::interact::UIC_FIRST_WINDOW, and gui::interact::UIC_WINDOW.

Referenced by GenNodeLocationQuery::resolveElm().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual size_t determineCoverage ( UICoord const &  path)
inlineoverridevirtual

evaluate to what extent a UIcoord spec matches the structure given as GenNode tree

Implements LocationQuery.

Definition at line 131 of file gen-node-location-query.hpp.

References GenNodeLocationQuery::drillDown().

+ Here is the call graph for this function:

virtual ChildIter getChildren ( UICoord const &  path,
size_t  pos 
)
inlineoverridevirtual

get the sequence of child IDs at a designated position in the backing GenNode tree

Implements LocationQuery.

Definition at line 140 of file gen-node-location-query.hpp.

References Symbol::BOTTOM, TreeStructureNavigator::buildIterator(), GenNodeLocationQuery::childNavigator(), and GenNodeLocationQuery::drillDown().

+ Here is the call graph for this function:

Literal getFirstWindow ( )
inlineprivate

Definition at line 159 of file gen-node-location-query.hpp.

Referenced by GenNodeLocationQuery::determineAnchor().

+ Here is the caller graph for this function:

Literal getCurrentWindow ( )
inlineprivate

Definition at line 164 of file gen-node-location-query.hpp.

References lib::pull_last().

Referenced by GenNodeLocationQuery::determineAnchor().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Literal resolveElm ( UICoord const &  path,
size_t  depth 
)
inlineprivate

Definition at line 170 of file gen-node-location-query.hpp.

References GenNodeLocationQuery::determineAnchor(), UICoord::isPresent(), and gui::interact::UIC_WINDOW.

Referenced by GenNodeLocationQuery::drillDown().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Rec const& drillDown ( Rec const &  tree,
UICoord const &  path,
size_t  maxDepth,
size_t &  depth 
)
inlineprivate

Definition at line 179 of file gen-node-location-query.hpp.

References GenNodeLocationQuery::descendInto(), GenNodeLocationQuery::hasNode(), UICoord::isPresent(), and GenNodeLocationQuery::resolveElm().

Referenced by GenNodeLocationQuery::determineCoverage(), and GenNodeLocationQuery::getChildren().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool hasNode ( Rec const &  tree,
const char *  pathElm,
size_t  depth 
)
inlinestaticprivate

does the guiding tree contain the element as requested by the UICoord path?

Remarks
this function abstracts a special asymmetry of the tree representation: at level==UIC_PERSP (the second level), the perspective info is packed into the type meta attribute. This was done on purpose, to verify our design is able to handle such implementation intricacies, which we expect to encounter when navigating the widgets of a real-world UI toolkit set

Definition at line 201 of file gen-node-location-query.hpp.

References gui::interact::UIC_PERSP.

Referenced by GenNodeLocationQuery::drillDown().

+ Here is the caller graph for this function:

static Rec const& descendInto ( Rec const &  tree,
size_t  depth,
const char *  pathElm 
)
inlinestaticprivate

within tree at level depth descend into the child element designated by pathElm

Definition at line 209 of file gen-node-location-query.hpp.

References gui::interact::UIC_PERSP.

Referenced by GenNodeLocationQuery::drillDown(), and GenNodeLocationQuery::GenNodeNavigator< PAR >::expandChildren().

+ Here is the caller graph for this function:

static TreeStructureNavigator* childNavigator ( Rec const &  node,
size_t  depth 
)
inlinestaticprivate
Returns
a heap allocated object attached at "current tree position" while exposing the names of all child nodes through iteration

Definition at line 224 of file gen-node-location-query.hpp.

References GenNodeLocationQuery::buildNavigator(), lib::singleValIterator(), lib::transformIterator(), and gui::interact::UIC_PERSP.

Referenced by GenNodeLocationQuery::GenNodeNavigator< PAR >::expandChildren(), and GenNodeLocationQuery::getChildren().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static TreeStructureNavigator* buildNavigator ( Rec const &  node,
size_t  depth,
IT &&  rawIterator 
)
inlinestaticprivate

type rebinding helper to pick up the concrete child iterator type IT

Definition at line 296 of file gen-node-location-query.hpp.

Referenced by GenNodeLocationQuery::childNavigator().

+ Here is the caller graph for this function:

Member Data Documentation

Rec tree_
private

Definition at line 102 of file gen-node-location-query.hpp.

+ Inheritance diagram for GenNodeLocationQuery:
+ Collaboration diagram for GenNodeLocationQuery:

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