Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
GenNodeLocationQuery Class Reference

#include "/Werk/devel/lumi/tests/stage/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 90 of file gen-node-location-query.hpp.

Classes

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

Public Member Functions

template<class REC >
 GenNodeLocationQuery (REC &&backingStructure)
 
virtual Literal determineAnchor (UICoord const &path) override
 resolve Anchor against GenNode tree
 
virtual size_t determineCoverage (UICoord const &path) override
 evaluate to what extent a UIcoord spec matches the structure given as GenNode tree
 
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
 
- Public Member Functions inherited from LocationQuery
virtual ~LocationQuery ()
 this is an interface
 

Private Member Functions

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

Static Private Member Functions

static bool hasNode (Rec const &tree, CStr pathElm, size_t depth)
 does the guiding tree contain the element as requested by the UICoord path?
 
static Rec const & descendInto (Rec const &tree, size_t depth, CStr pathElm)
 within tree at level depth descend into the child element designated by pathElm
 
static TreeStructureNavigatorchildNavigator (Rec const &node, size_t depth)
 
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
 

Private Attributes

Rec tree_
 

Additional Inherited Members

- Public Types inherited from LocationQuery
using ChildIter = decltype(TreeStructureNavigator::buildIterator(0))
 
- Static Public Attributes inherited from LocationQuery
static lib::Depend< LocationQueryservice
 access point to global LocationQuery service implementation
 

Constructor & Destructor Documentation

◆ GenNodeLocationQuery()

template<class REC >
GenNodeLocationQuery ( REC &&  backingStructure)
inline

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

Member Function Documentation

◆ determineAnchor()

virtual Literal determineAnchor ( UICoord const &  path)
inlineoverridevirtual

resolve Anchor against GenNode tree

Implements LocationQuery.

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

References Symbol::BOTTOM, GenNodeLocationQuery::getCurrentWindow(), GenNodeLocationQuery::getFirstWindow(), UICoord::getWindow(), UICoord::isPresent(), GenNodeLocationQuery::tree_, stage::interact::UIC_CURRENT_WINDOW, stage::interact::UIC_FIRST_WINDOW, and stage::interact::UIC_WINDOW.

Referenced by GenNodeLocationQuery::resolveElm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ determineCoverage()

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 122 of file gen-node-location-query.hpp.

References GenNodeLocationQuery::drillDown(), PathArray< chunk_size >::size(), and GenNodeLocationQuery::tree_.

+ Here is the call graph for this function:

◆ getChildren()

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 131 of file gen-node-location-query.hpp.

References Symbol::BOTTOM, TreeStructureNavigator::buildIterator(), GenNodeLocationQuery::childNavigator(), GenNodeLocationQuery::drillDown(), PathArray< chunk_size >::size(), and GenNodeLocationQuery::tree_.

+ Here is the call graph for this function:

◆ getFirstWindow()

Literal getFirstWindow ( )
inlineprivate

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

References GenNodeLocationQuery::tree_.

Referenced by GenNodeLocationQuery::determineAnchor().

+ Here is the caller graph for this function:

◆ getCurrentWindow()

Literal getCurrentWindow ( )
inlineprivate

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

References lib::pull_last(), and GenNodeLocationQuery::tree_.

Referenced by GenNodeLocationQuery::determineAnchor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resolveElm()

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

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

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

Referenced by GenNodeLocationQuery::drillDown().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ drillDown()

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

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

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasNode()

static bool hasNode ( Rec const &  tree,
CStr  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 192 of file gen-node-location-query.hpp.

References stage::interact::UIC_PERSP.

Referenced by GenNodeLocationQuery::drillDown().

+ Here is the caller graph for this function:

◆ descendInto()

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

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

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

References stage::interact::UIC_PERSP.

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

+ Here is the caller graph for this function:

◆ childNavigator()

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 215 of file gen-node-location-query.hpp.

References GenNodeLocationQuery::buildNavigator(), and stage::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:

◆ buildNavigator()

template<class IT >
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 287 of file gen-node-location-query.hpp.

Referenced by GenNodeLocationQuery::childNavigator().

+ Here is the caller graph for this function:

Member Data Documentation

◆ tree_

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

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