![]() |
Lumiera 0.pre.04~rc.1
»edit your freedom«
|
#include "lib/wrapper-function-result.hpp"
Extension of ItemWrapper: a function remembering the result of the last invocation.
Initially, the "value" is bottom (undefined, NIL), until the function is invoked for the first time. After that, the result of the last invocation can be accessed by operator* ()
this in order to write to the embedded ItemWrapper. (to alleviate, we'd have to re-link after copying/moving) Definition at line 52 of file wrapper-function-result.hpp.
Public Types | |
| using | Res = _Fun< SIG >::Ret |
| using | ResWrapper = ItemWrapper< Res > |
Public Attributes | |
| ResWrapper | lastResult_ |
Public Member Functions | |
| FunctionResult ()=default | |
| by default locked to invalid state | |
| template<typename FUN > | |
| FunctionResult (FUN &&targetFunction) | |
| Create result-remembering functor by outfitting a copy of the given function with an adaptor to capture each produced result. | |
| Res & | operator* () const |
| retrieve the last function result observed | |
| bool | isValid () const |
| operator bool () const | |
Additional Inherited Members | |
Protected Member Functions inherited from NonCopyable | |
| ~NonCopyable ()=default | |
| NonCopyable ()=default | |
| NonCopyable (NonCopyable const &)=delete | |
| NonCopyable & | operator= (NonCopyable const &)=delete |
|
default |
by default locked to invalid state
Create result-remembering functor by outfitting a copy of the given function with an adaptor to capture each produced result.
Definition at line 72 of file wrapper-function-result.hpp.
References lib::meta::func::chained(), and FunctionResult< SIG >::lastResult_.
Here is the call graph for this function:Definition at line 56 of file wrapper-function-result.hpp.
| using ResWrapper = ItemWrapper<Res> |
Definition at line 57 of file wrapper-function-result.hpp.
|
inline |
retrieve the last function result observed
Definition at line 83 of file wrapper-function-result.hpp.
References FunctionResult< SIG >::lastResult_.
|
inline |
Definition at line 84 of file wrapper-function-result.hpp.
References ItemWrapper< TY >::isValid(), and FunctionResult< SIG >::lastResult_.
Referenced by FunctionResult< SIG >::operator bool().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineexplicit |
Definition at line 87 of file wrapper-function-result.hpp.
References FunctionResult< SIG >::isValid().
Here is the call graph for this function:| ResWrapper lastResult_ |
Definition at line 59 of file wrapper-function-result.hpp.
Referenced by FunctionResult< SIG >::FunctionResult(), FunctionResult< SIG >::isValid(), and FunctionResult< SIG >::operator*().
Inheritance diagram for FunctionResult< SIG >:
Collaboration diagram for FunctionResult< SIG >: