로딩중...
검색중...
일치하는것 없음
by::baseObj 클래스 참조

Base class for representing byeol objects 더 자세히 ...

#include <baseObj.hpp>

by::baseObj에 대한 상속 다이어그램 :
by::node by::statable by::frameInteractable by::tbridge< narr > by::baseErr by::genericOrigin by::obj by::scalar by::tbridge< T > by::arr by::err by::nerr by::origin by::pod by::tscalar< nbool > by::tscalar< nuchar > by::tscalar< nflt > by::tscalar< nint > by::tscalar< std::string > by::tscalar< T > by::tscalar< void >

Public 멤버 함수

str eval (const args &a) override
 
scopesubs () override
 
state getState () const override
 
void setState (state new1) override
 
priorType prioritize (const args &a) const override
 
virtual const baseObjgetOrigin () const
 
void inFrame (const bicontainable *args) const override
 
void outFrame () const override
 
const srcgetSrc () const override
 
virtual const nodegetSubPod () const
 Retrieves a sub-pod represented as a node.
 
virtual baseObjmake () const
 
const modifiergetModifier () const override
 
- by::node(으)로부터 상속된 Public 멤버 함수
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
 
- by::frameInteractable(으)로부터 상속된 Public 멤버 함수
void inFrame () const
 

정적 Public 속성

static const std::string COMMON_NAME = "@common"
 
static const std::string EXPAND_NAME = "@expand"
 

Protected 멤버 함수

 baseObj ()=default
 Default constructor for baseObj.
 
 baseObj (const baseObj *org, nbool isScripted)
 Constructs a baseObj from an existing origin object.
 
str _onEvalSub (node &sub, const args &a) override
 Protected virtual method for evaluating a sub-node.
 
void _setSrc (const src &s) override
 
virtual void _inFrame (frame &fr, const bicontainable *args) const
 Enters this object's frame into the current execution stack.
 
virtual void _setType (const mgdType &new1)
 Sets the script type for this base object.
 
virtual void _setModifier (const modifier &mod)
 
virtual str _onBeforeCtor ()
 Hook method called before the object's constructor is fully executed.
 
- by::node(으)로부터 상속된 Protected 멤버 함수
void _setSrc (const src *it) BY_SIDE_FUNC(_setSrc)
 

Protected 속성

tstr< baseObj_org
 

Friends

class coreInternal
 

추가로 상속된 멤버들

- by::node(으)로부터 상속된 Public 속성
T sub name
 
T sub nullptr
 
tpriorities< T > subAll< T > name
 
priorType prioritize it
 
priorType prioritize NO_MATCH
 
str eval name
 

상세한 설명

Base class for representing byeol objects

The base class for representing objects in byeol. The core module uses both objects in the byeol runtime environment written in byeol language (obj) and objects in the native environment written using C++ code (baseObj) without distinction. Both are node and baseObj. To achieve this, obj inherits from baseObj, grouping them into the same class hierarchy. Therefore, baseObj only has functionality common to native and script objects. In other words, managed object obj always has more functionality than baseObj.

Origin Objects

The original type defined by users in the byeol language is called an origin object. Constructor calls like ctor all create by copy-constructing origin objects.

Override getOrigin() for baseObj

To define a new baseObj in C++ code for use in byeol code, create a C++ class inheriting baseObj and override getOrigin() to return the appropriate baseObj origin object. For example:

// There's a C++ class nInt inheriting from baseObj that represents integers.
// This nInt's origin is based on the nInt C++ class itself.
// Being based on a C++ class makes it static and can be expressed as a singleton.
const baseObj& nInt::getOrigin() const {
// Using tbaseObjOrigin easily creates a tbaseObjOrigin object based on nInt class.
const baseObj& supers = super::getOrigin();
return &supers == this ? org : supers;
}
Base class for representing byeol objects
Definition baseObj.hpp:73
C++ to byeol bridge builder
Definition tbridger.hpp:61
Definition tnarr.hpp:9

tbaseObjOrigin is a class template added for convenience. See that class for details. Using tbridger allows exposing native functions as script functions in one simple line without additional code. nStr has a good example.

Unlike obj, baseObj's Origin Object Exists Only Once

obj represents objects written in byeol language. Among these, origin objects written with the def keyword are represented as instances of the origin class. In contrast, baseObj cannot be used by itself; there exist C++ classes that inherit from it. Understand the difference well. From C++ code's perspective, baseObj's origin is static while obj's origin is dynamic. For example:

// Look again at the previously written baseObj origin object example. Note it's a static object.
// Can we do the same for obj?
// Suppose a user wrote the following in byeol code:
// def MyObj
// foo() void
// print("hello")
// The MyObj type is dynamic from C++'s perspective. So we can't create class MyObj at compile time.
// MyObj itself in byeol is called an origin object and is represented as an instance of the `origin` class.
origin org(typeMaker::make<obj>(name)); // name == "MyObj"
// Created at runtime by the parser as above, so it can't be a singleton or static.
User-defined origin type
Definition origin.hpp:99

생성자 & 소멸자 문서화

◆ baseObj() [1/2]

by::baseObj::baseObj ( )
explicitprotecteddefault

Default constructor for baseObj.

If no sub-objects are provided, internal sub-containers will be assigned to a dummy array. This is typically called in the constructor of derived classes.

◆ baseObj() [2/2]

by::baseObj::baseObj ( const baseObj * org,
nbool isScripted )
explicitprotected

Constructs a baseObj from an existing origin object.

매개변수
orgA pointer to the origin baseObj.
isScriptedA boolean indicating whether this baseObj is part of the Byeol runtime environment.

멤버 함수 문서화

◆ _inFrame()

virtual void by::baseObj::_inFrame ( frame & fr,
const bicontainable * args ) const
protectedvirtual

Enters this object's frame into the current execution stack.

This protected virtual method is a key part of the frame interaction mechanism, allowing the object's associated scope and symbols to become active in the current execution context.

매개변수
frThe frame to interact with.
argsOptional arguments to be pushed onto the frame.

◆ _onBeforeCtor()

virtual str by::baseObj::_onBeforeCtor ( )
protectedvirtual

Hook method called before the object's constructor is fully executed.

This protected virtual method provides a mechanism for derived classes or the runtime to inject logic or perform setup just before the main constructor body.

반환값
An str object representing a pre-constructor state or result.

by::obj에서 재구현되었습니다.

◆ _onEvalSub()

str by::baseObj::_onEvalSub ( node & sub,
const args & a )
overrideprotectedvirtual

Protected virtual method for evaluating a sub-node.

This method is a crucial part of the evaluation mechanism, allowing derived classes to define how a specific sub-node is evaluated within the context of the current node.

매개변수
subThe sub-node to be evaluated.
aThe arguments for evaluation.
반환값
The result of the evaluation as a str object.

by::node(으)로부터 재구현되었습니다.

by::genericOrigin에서 재구현되었습니다.

◆ _setSrc()

void by::baseObj::_setSrc ( const src & s)
overrideprotectedvirtual

by::node(으)로부터 재구현되었습니다.

◆ _setType()

virtual void by::baseObj::_setType ( const mgdType & new1)
protectedvirtual

Sets the script type for this base object.

This method is used to associate a specific script type (mgdType) with this base object, allowing for dynamic type resolution in the Byeol language environment.

매개변수
new1The new mgdType to assign.

◆ eval()

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

by::node를 구현.

◆ getModifier()

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

by::node(으)로부터 재구현되었습니다.

◆ getSrc()

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

by::node(으)로부터 재구현되었습니다.

◆ getState()

state by::baseObj::getState ( ) const
overridevirtual

by::statable를 구현.

◆ getSubPod()

virtual const node & by::baseObj::getSubPod ( ) const
virtual

Retrieves a sub-pod represented as a node.

This method is used to access nested pod structures or components within this base object.

반환값
A const reference to the node representing the sub-pod.

by::origin에서 재구현되었습니다.

◆ inFrame()

void by::baseObj::inFrame ( const bicontainable * args) const
overridevirtual

◆ outFrame()

void by::baseObj::outFrame ( ) const
overridevirtual

◆ prioritize()

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

by::node를 구현.

◆ setState()

void by::baseObj::setState ( state new1)
overridevirtual

by::statable를 구현.

◆ subs()

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

by::node를 구현.


이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.:
to Top