Lumiera  0.pre.03
»edit your freedom«
TreeStructureNavigator Class Referenceabstract

#include "stage/interact/ui-coord-resolver.hpp"

Description

Interface to locate and move within a tree shaped structure.

The actual nature of this structure is to be kept abstracted through this interface. The purpose of this construct is to build evaluations and matching operations on top.

Definition at line 149 of file ui-coord-resolver.hpp.

Public Member Functions

virtual ~TreeStructureNavigator ()
 this is an interface
 
virtual TreeStructureNavigatorexpandChildren () const =0
 expand into exploration of child elements at "current position". More...
 
- Public Member Functions inherited from IterSource< Literal >
virtual operator string () const
 is ABC More...
 

Static Public Member Functions

static auto buildIterator (TreeStructureNavigator *source)
 build a Lumiera Forward Iterator as front-end and managing Handle for a TreeStructureNavigator or subclass. More...
 
- Static Public Member Functions inherited from IterSource< Literal >
static iterator build (IterSource &sourceImpl)
 build an iterator frontend for the given source, More...
 
static iterator build (IterSource *sourceImplObject)
 build an iterator frontend, thereby managing the given heap allocated source object instance. More...
 

Additional Inherited Members

- Public Types inherited from IterSource< Literal >
using pointer = Literal *
 
using reference = Literal &
 
using value_type = Literal
 
- Static Public Attributes inherited from IterSource< Literal >
static iterator EMPTY_SOURCE
 storage for the empty data-source constant
 
- Protected Types inherited from IterSource< Literal >
typedef shared_ptr< IterSourceDataHandle
 
typedef LiteralPos
 
- Protected Member Functions inherited from IterSource< Literal >
virtual void disconnect ()
 disconnect the data source / iteration frontend. More...
 
virtual Pos firstResult ()=0
 iteration start: prepare the first element. More...
 
virtual void nextResult (Pos &pos)=0
 iteration step: switch on to the next element. More...
 

Member Function Documentation

◆ expandChildren()

virtual TreeStructureNavigator* expandChildren ( ) const
pure virtual

expand into exploration of child elements at "current position".

At any point, a TreeStructureNavicator instance indicates and represents a position within a tree-like structure. At the same time, it is part of a sequence of siblings, which is accessible through iteration. This operation now allows to extend visitation of siblings by consuming the current element and replacing it with the sequence of its immediate child elements, exposing the first one as the _"current position"_.

Returns
pointer to a new heap allocated TreeStructureNavigator implementation, which represents the sequence of children. The object this will not be affected.
Note
it is the caller's responsibility to own and manage the generated navigator. The typical (and recommended) way to achieve this is to rely on the embedded type #iterator, which exposes an appropriately wired iterator::expandChildren()

Referenced by TreeStructureNavigator::buildIterator().

+ Here is the caller graph for this function:

◆ buildIterator()

static auto buildIterator ( TreeStructureNavigator source)
inlinestatic

build a Lumiera Forward Iterator as front-end and managing Handle for a TreeStructureNavigator or subclass.

The provided pointer is assumed to point to heap allocated storage.

Returns
copyable iterator front-end handle, which allows to retrieve once all values yielded by this IterSource. The front-end takes ownership of the given object.
Note
the generated iterator is preconfigured to allow for _"child expansion"_, thereby calling through the virtual API function expandChildren()

Definition at line 178 of file ui-coord-resolver.hpp.

References TreeStructureNavigator::expandChildren(), and lib::explore().

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

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