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

Byeol runtime environment object 더 자세히 ...

#include <obj.hpp>

by::obj에 대한 상속 다이어그램 :
by::baseObj by::node by::statable by::frameInteractable by::origin by::pod by::autopod

Public 멤버 함수

 obj ()
 Constructs an obj representing an "any" class.
 
 obj (const scope &subs)
 Constructs an obj from a given scope, typically representing its initial set of children.
 
 obj (const me &rhs)
 Copy constructor for obj.
 
me & operator= (const me &rhs)
 
scopesubs () override
 
tstr< nbicontainermySubs () const override
 
state getState () const override
 
void setState (state new1) override
 
scopegetShares ()
 
const scope &getShares() const BY_CONST_FUNC(getShares()) scope const scope::super & getOwns () const BY_CONST_FUNC(getOwns()) const ntype &getType() const override
 
void onCloneDeep (const clonable &from) override
 Performs a deep clone operation, copying the contents from another clonable object.
 
virtual nodegetCallComplete ()
 Returns the node responsible for completing the object's construction or initialization calls.
 
const node *getCallComplete() const BY_CONST_FUNC(getCallComplete()) protected str _onBeforeCtor () override
 Hook method called before the object's constructor is fully executed.
 
- by::baseObj(으)로부터 상속된 Public 멤버 함수
str eval (const args &a) 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
 

Protected 멤버 함수

 obj (const scope &shares, scope &owns)
 Protected constructor for obj, allowing explicit separation of shares and owns.
 
- by::baseObj(으)로부터 상속된 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)
 
- by::node(으)로부터 상속된 Protected 멤버 함수
void _setSrc (const src *it) BY_SIDE_FUNC(_setSrc)
 

추가로 상속된 멤버들

- by::node(으)로부터 상속된 Public 속성
T sub name
 
T sub nullptr
 
tpriorities< T > subAll< T > name
 
priorType prioritize it
 
priorType prioritize NO_MATCH
 
str eval name
 
- by::baseObj(으)로부터 상속된 정적 Public 속성
static const std::string COMMON_NAME = "@common"
 
static const std::string EXPAND_NAME = "@expand"
 
- by::baseObj(으)로부터 상속된 Protected 속성
tstr< baseObj_org
 

상세한 설명

Byeol runtime environment object

The class representing objects in the byeol runtime environment. Extends baseObj's functionality to add scope handling and concepts for shares and owns needed only in the byeol runtime environment.

obj as a Type

In C++, types are represented by classes, but byeol has no class concept. Since there's no distinction between objects and classes, obj itself is the type. For example, look at this C++ code:

class A {}; // In C++, class is the type.
A* a = new A(); // Objects and classes are strictly distinguished.
// byeol code:
// def myObj
// name str
// foo() void: ...
//
// myObj2 myObj
//
// The above code translated to C++:
obj myObj = new obj(....); // When created with `def` in byeol.
obj* myObj2 = myObj.clone(); // When creating object with `myObj2 myObj` in byeol.
Byeol runtime environment object
Definition obj.hpp:62
obj()
Constructs an obj representing an "any" class.
Definition tnarr.hpp:9

As shown, in the byeol runtime environment, objects are just obj created via two paths: obj defined with def and obj cloned from obj. Since both are used as types, distinguishing them is meaningless.

Shares and Owns

For baseObj, since the base is a C++ native class, object creation also occurs through C++'s new and constructors, simultaneously creating member variables defined in that class. But what about writing byeol code? In the byeol runtime environment, obj representing objects can have properties like name in the example above. Since defining objects in byeol runtime environment is cloning objects from origin objects, calling clone() on origin also copies properties and funcs. At this time, funcs only need one in the system and don't need to be copied each time a func object is created. Conversely, properties like name must be copied with different values per instance. To handle this efficiently, parts shared among objs of the same type are separated into shares, and parts that get copied are separated into owns. Therefore, when obj's clone() occurs, shares only gets references to shares from the original origin, and only the owns part performs clone.

Immutable Types

str, int, and other scalar types are all immutable types. This stems from byeol's calling strategy following by object, which operates like C-family languages like Java and C# commonly use: references to objects are shallow copied, raw types are deep copied. node is just node, and obj shouldn't know whether the node it must insert is an immutable type. Breaking this also breaks polymorphism. So whether to copy an incoming object or just point to a reference is determined through immutableTactic.

See immutableTactic or tscalar for details.

생성자 & 소멸자 문서화

◆ obj() [1/3]

by::obj::obj ( const scope & subs)
explicit

Constructs an obj from a given scope, typically representing its initial set of children.

매개변수
subsThe scope containing the initial sub-nodes (children) for this object.

◆ obj() [2/3]

by::obj::obj ( const me & rhs)
explicit

Copy constructor for obj.

매개변수
rhsThe obj to copy from.

◆ obj() [3/3]

by::obj::obj ( const scope & shares,
scope & owns )
explicitprotected

Protected constructor for obj, allowing explicit separation of shares and owns.

This constructor is used internally to initialize an obj with distinct shared and owned scopes, which is fundamental to the object model's efficiency.

매개변수
sharesThe scope containing shared properties and functions.
ownsThe scope containing owned (instance-specific) properties.

멤버 함수 문서화

◆ _onBeforeCtor()

const node *getCallComplete() const BY_CONST_FUNC(getCallComplete()) protected str by::obj::_onBeforeCtor ( )
overridevirtual

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::baseObj(으)로부터 재구현되었습니다.

◆ getCallComplete()

virtual node * by::obj::getCallComplete ( )
virtual

Returns the node responsible for completing the object's construction or initialization calls.

In the Byeol language, object construction might involve specific nodes that handle the final steps or logic after the object is initially created.

반환값
A pointer to the node that manages constructor completion, or nullptr if none.

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

◆ getState()

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

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

◆ onCloneDeep()

void by::obj::onCloneDeep ( const clonable & from)
override

Performs a deep clone operation, copying the contents from another clonable object.

매개변수
fromThe clonable object to copy from.

◆ setState()

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

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

◆ subs()

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

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


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