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

#include "steam/mobject/session/query-focus-stack.hpp"

Description

A custom stack holding ScopePath »frames«.

It is utilised by the ScopeLocator to establish the current query focus location. Client code should access this mechanism through QueryFocus instances used as frontend. These QueryFocus objects incorporate a boost::intrusive_ptr, which stores the ref-count within the mentioned ScopePath frames located in the stack.

automatic cleanup of unused frames
The stack is aware of this ref-counting mechanism and will – on each access – automatically clean up any unused frames starting from stack top, until encountering the first frame still in use. This frame, by definition, is the current focus location. The stack ensures there is always at least one ScopePath frame, default-creating a new one if necessary.
See also
query-focus-stack-test.cpp
ScopeLocator
QueryFocus access point for client code

Definition at line 69 of file query-focus-stack.hpp.

Public Member Functions

void clear ()
 
bool empty () const
 
void pop_unused ()
 investigate the stack top and discard any path frames which aren't referred anymore (as indicated by their ScopePath::use_count(). More...
 
ScopePathpush (Scope const &)
 Open a new path frame, pushing down the current frame. More...
 
size_t size () const
 
ScopePathtop ()
 

Private Member Functions

void openDefaultFrame ()
 
- Private Member Functions inherited from NonCopyable
 NonCopyable (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 

Private Attributes

std::list< ScopePathpaths_
 

Member Function Documentation

◆ push()

ScopePath & push ( Scope const &  newStartPoint)

Open a new path frame, pushing down the current frame.

The new frame tries to locate the given start scope and navigates to this position.

Note
EXCEPTION_STRONG guarantee
Returns
reference to the newly created path on top
Exceptions
error::Invalidif newStartPoint isn't locatable

Definition at line 134 of file query-focus-stack.hpp.

References Scope::isRoot(), and ScopePath::isValid().

+ Here is the call graph for this function:

◆ top()

ScopePath & top ( )
Returns
the topmost path frame actually in use
Note
may invoke pop_unused()
EXCEPTON_FREE ///////TODO prove!

Definition at line 150 of file query-focus-stack.hpp.

References QueryFocusStack::pop_unused().

+ Here is the call graph for this function:

◆ pop_unused()

void pop_unused ( )

investigate the stack top and discard any path frames which aren't referred anymore (as indicated by their ScopePath::use_count().

After executing this function the topmost frame is either in use, or a new default frame has been created at the bottom of an empty stack.

Note
EXCEPTION_FREE ///////TODO prove!

Definition at line 170 of file query-focus-stack.hpp.

References QueryFocusStack::openDefaultFrame().

Referenced by QueryFocusStack::top().

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

◆ openDefaultFrame()

void openDefaultFrame ( )
private

open a default path frame at the bottom of an empty stack, locating to current model root

Note
EXCEPTION_FREE ///////TODO prove!

Definition at line 189 of file query-focus-stack.hpp.

Referenced by QueryFocusStack::pop_unused().

+ Here is the caller graph for this function:
+ Inheritance diagram for QueryFocusStack:
+ Collaboration diagram for QueryFocusStack:

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