Loading...
Searching...
No Matches
by::closure Class Reference

func closure with captured object scope More...

#include <closure.hpp>

Inheritance diagram for by::closure:
by::baseFunc by::node by::frameInteractable

Public Member Functions

const ntypegetType () const override
 
scopesubs () override
 
priorType prioritize (const args &a) const override
 
const modifiergetModifier () const override
 
str eval (const args &a) override
 
const baseObjgetOrigin () const override
 
const baseFuncgetFunc () const
 
paramsgetParams () override
 
const nodegetRet () const override
 
const srcgetSrc () const override
 
- Public Member Functions inherited from by::baseFunc
const paramsgetParams () const BY_CONST_FUNC(getParams())
 
- Public Member Functions inherited from by::node
me & operator[] (const std::string &name)
 
const me & operator[] (const std::string &name) const BY_CONST_FUNC(operator[](name))
 
me & operator[] (const std::string *it)
 
const me & operator[] (const std::string *it) const BY_CONST_FUNC(operator[](it))
 
me & operator[] (const nchar *name)
 
const me & operator[] (const nchar *name) const BY_CONST_FUNC(operator[](name))
 
nbool in (const node &elem) const
 
nbool in (const node *elem) const
 
const scopesubs () const BY_CONST_FUNC(subs()) virtual tstr< nbicontainer > mySubs() const
 Returns a tstr to a container of immediate sub-nodes (excluding inherited or chained ones).
 
const nodepromote (const node &it) const
 
const nodepromote (const node *it) const BY_SIDE_FUNC(promote)
 
template<typename T >
T * sub (std::function< nbool(const std::string &, const T &)> l)
 
template<typename T >
const T * sub (std::function< nbool(const std::string &, const T &)> l) const BY_CONST_FUNC(sub< T >(l)) template< typename T
 
template<typename T = me>
const T * sub () const BY_CONST_FUNC(sub< T >()) template< typename T
 
template<typename T = me>
T * sub (const std::string *it) BY_SIDE_FUNC(sub)
 
template<typename T = me>
const T * sub (const std::string &name) const BY_CONST_FUNC(sub< T >(name)) template< typename T
 
template<typename T = me>
T * sub (const std::string *name, const args &a) BY_SIDE_FUNC(name
 
template<typename T = me>
const T * sub (const std::string &name, const args &a) const BY_CONST_FUNC(sub< T >(name
 
template<typename T = me>
const T a const T * sub (const std::string *name, const args &a) const BY_CONST_FUNC(sub< T >(name
 
template<typename T >
const T a const T a tnarr< T, strTactic > subAll (std::function< nbool(const std::string &, const T &)> l) const
 
template<typename T = me>
tnarr< T, strTactic > subAll () const
 
template<typename T = me>
tpriorities< T > subAll (const std::string &name) const
 
template<typename T = me>
tpriorities< T > subAll (const std::string *it) const BY_SIDE_FUNC(subAll< T >) template< typename T
 
template<typename T = me>
tpriorities< T > subAll (const std::string &name, const args &a) const
 
template<typename T = me>
tpriorities< T > subAll (const std::string *name, const args *a) const BY_SIDE_FUNC(name
 
tpriorities< T > subAll< T > tpriorities ())
 
template<typename T = me>
tpriorities< T > subAll (const std::string *name, const args &a) const BY_SIDE_FUNC(name
 
tpriorities< T > subAll< T > tpriorities ())
 
bool canEval (const args &a) const
 
priorType prioritize (const args *it) const BY_SIDE_FUNC(it
 
str eval (const args *it) BY_SIDE_FUNC(eval)
 
str eval (const std::string &name, const args &a)
 
str eval (const std::string &name, const args *a) BY_SIDE_FUNC(a
 
str eval (name, a)
 
str str ())
 
str eval (const std::string *name, const args &a) BY_SIDE_FUNC(name
 
str eval str ())
 
str eval (const std::string *name, const args *a) BY_SIDE_FUNC(name &&a
 
str eval str ())
 
str eval (const std::string &name)
 
str eval (const std::string *it) BY_SIDE_FUNC(eval)
 
str eval ()
 
virtual void rel ()
 
template<typename T >
nbool is () const
 
nbool is (const typeProvidable &to) const
 
nbool is (const typeProvidable *it) const BY_SIDE_FUNC(is)
 
nbool is (const type &to) const
 
nbool is (const type *it) const BY_SIDE_FUNC(is)
 
template<typename T >
tstr< T > as () const
 
str as (const typeProvidable &to) const
 
str as (const typeProvidable *it) const BY_SIDE_FUNC(as)
 
str as (const type &to) const
 
str as (const type *it) const BY_SIDE_FUNC(as)
 
template<typename T >
nbool isImpli () const
 
virtual nbool isImpli (const type &to) const
 
nbool isImpli (const typeProvidable &to) const
 
nbool isImpli (const typeProvidable *it) const BY_SIDE_FUNC(isImpli)
 
template<typename T >
tstr< T > asImpli () const
 
virtual str asImpli (const type &to) const
 
str asImpli (const typeProvidable &to) const
 
str asImpli (const typeProvidable *it) const BY_SIDE_FUNC(asImpli)
 
virtual nbool isComplete () const
 
virtual str infer () const
 
virtual void accept (const visitInfo &i, visitor &v)
 
void inFrame (const bicontainable *args) const override
 
void outFrame () const override
 
virtual void inFrame (const bicontainable *args) const=0
 
void inFrame () const
 
virtual void outFrame () const=0
 
- Public Member Functions inherited from by::frameInteractable
void inFrame () const
 

Static Public Member Functions

static me * make (const node &e)
 
static me * make (const node *it) BY_SIDE_FUNC(make)
 
- Static Public Member Functions inherited from by::baseFunc
static nbool isFuncButNotClosure (const node &n)
 Checks if the given node represents a function that is not a closure.
 
static nbool isFuncButNotClosure (const node *it) BY_SIDE_FUNC(isFuncButNotClosure)
 

Additional Inherited Members

- Public Attributes inherited from by::node
T sub name
 
T sub nullptr
 
tpriorities< T > subAll< T > name
 
priorType prioritize it
 
priorType prioritize NO_MATCH
 
str eval name
 
- Static Public Attributes inherited from by::baseFunc
static const std::string ME = "me"
 
- Protected Member Functions inherited from by::baseFunc
void _setSrc (const src &newSrc) override
 
- Protected Member Functions inherited from by::node
virtual str _onEvalSub (node &sub, const args &a)
 Protected virtual method for evaluating a sub-node.
 
void _setSrc (const src *it) BY_SIDE_FUNC(_setSrc)
 

Detailed Description

func closure with captured object scope

Proxy for @func with captured object scope for closures. When arguments are provided, object scope is replaced with captured scope.

Note
Allows carrying functions without needing to reference any object.

Member Function Documentation

◆ eval()

str by::closure::eval ( const args & a)
overridevirtual

Implements by::node.

◆ getModifier()

const modifier & by::closure::getModifier ( ) const
overridevirtual

Reimplemented from by::baseFunc.

◆ getOrigin()

const baseObj & by::closure::getOrigin ( ) const
overridevirtual

Implements by::baseFunc.

◆ getParams()

params & by::closure::getParams ( )
overridevirtual
Returns
parameters of eval() func. parameter is just a type. and I don't care about the value of each parameters. that is the reason why I uses a ref to represents parameter.

I need the name and which types should be casted and binded from given arguments are matters.

Reimplemented from by::baseFunc.

◆ getRet()

const node * by::closure::getRet ( ) const
overridevirtual
Returns
node which has same type of the func. in byeol lang, even type is an object. that's why I return this as a node.
Remarks
please don't confuse this to node::infer(). evaluate means program just read the code and expand or calculate then replace it to the accurate another identifier or variable. so evalType of the func is just the func itself because there is nothing to calculate or eval. that's completely different to Return type of the function. if there is a evalExpr instance, and it takes the func and proper argument, then it can be evaluated and its evalType is the return type of the func.

Reimplemented from by::baseFunc.

◆ getSrc()

const src & by::closure::getSrc ( ) const
overridevirtual

Reimplemented from by::baseFunc.

◆ prioritize()

priorType by::closure::prioritize ( const args & a) const
overridevirtual

Reimplemented from by::baseFunc.

◆ subs()

scope & by::closure::subs ( )
overridevirtual

Reimplemented from by::baseFunc.


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