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

Automatic pack loading slot 더 자세히 ...

#include <autoslot.hpp>

by::autoslot에 대한 상속 다이어그램 :
by::slot by::packMakable by::statable by::node by::instance by::frameInteractable by::typeProvidable by::clonable

Public 멤버 함수

state getState () const override
 
void setState (state new1) override
 
objgetPack () override
 Retrieves the top-level object (obj) of this pack.
 
void rel () override
 
- by::slot(으)로부터 상속된 Public 멤버 함수
manifestgetManifest ()
 
const manifestgetManifest () const
 
nbool isValid () const
 
const objgetPack () const BY_CONST_FUNC(getPack()) void rel() override
 
void addDependent (me &dependent)
 Adds a dependent slot to this slot.
 
void addDependent (me *it) BY_SIDE_FUNC(addDependent) const tnarr< me > &getDependents() const
 
scopesubs () override
 
priorType prioritize (const args &a) const override
 
str eval (const args &a) override
 
str infer () 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, strTacticsubAll (std::function< nbool(const std::string &, const T &)> l) const
 
template<typename T = me>
tnarr< T, strTacticsubAll () 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 ()
 
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 const srcgetSrc () const
 
virtual nbool isComplete () const
 
virtual void accept (const visitInfo &i, visitor &v)
 
void inFrame (const bicontainable *args) const override
 
void outFrame () const override
 
virtual const modifiergetModifier () const
 
virtual void inFrame (const bicontainable *args) const=0
 
void inFrame () const
 
virtual void outFrame () const=0
 
- by::instance(으)로부터 상속된 Public 멤버 함수
 instance (id newId)
 
 instance (const me &rhs)
 
me & operator= (const me &rhs)=default
 
void * operator new (size_t sz) noexcept
 
void operator delete (void *pt, size_t sz) noexcept
 
virtual id getId () const
 
virtual nbool isHeap () const
 Checks if this instance is allocated on the heap.
 
const lifegetBindTag () const
 Returns a pointer to the associated life object for reference counting.
 
- by::typeProvidable(으)로부터 상속된 Public 멤버 함수
nbool operator== (const me &rhs) const
 
nbool operator!= (const me &rhs) const
 
virtual const typegetType () const =0
 
nbool isSub (const type &it) const
 
nbool isSub (const type *it) const BY_SIDE_FUNC(isSub)
 
nbool isSub (const me &it) const
 
nbool isSub (const me *it) const BY_SIDE_FUNC(isSub)
 
nbool isSuper (const type &it) const
 
nbool isSuper (const type *it) const BY_SIDE_FUNC(isSuper)
 
nbool isSuper (const me &it) const
 
nbool isSuper (const me *it) const BY_SIDE_FUNC(isSuper)
 
template<typename T >
nint isSub () const
 
template<typename T >
nint isSuper () const
 
template<typename T >
T * cast ()
 
template<typename T >
const T * cast () const BY_CONST_FUNC(cast< T >()) virtual void *cast(const type &to)
 Safe cast to target type using type hierarchy information
 
const void * cast (const type &to) const BY_CONST_FUNC(cast(to)) void *cast(const type *it) BY_SIDE_FUNC(cast)
 
- by::clonable(으)로부터 상속된 Public 멤버 함수
virtual me * clone () const =0
 
virtual me * cloneDeep () const
 
virtual void onCloneDeep (const me &from)
 
- by::frameInteractable(으)로부터 상속된 Public 멤버 함수
void inFrame () const
 

Protected 멤버 함수

nbool _invalidate () override
 Protected virtual method to invalidate the slot.
 
- by::slot(으)로부터 상속된 Protected 멤버 함수
void _setValid (nbool valid)
 
str _onEvalSub (node &sub, const args &a) override
 Protected virtual method for evaluating a sub-node.
 
- by::node(으)로부터 상속된 Protected 멤버 함수
virtual void _setSrc (const src &s)
 
void _setSrc (const src *it) BY_SIDE_FUNC(_setSrc)
 
- by::instance(으)로부터 상속된 Protected 멤버 함수
nbool _setId (id new1)
 

추가로 상속된 멤버들

- by::instance(으)로부터 상속된 정적 Public 멤버 함수
static vaultgetVault ()
 
- 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::instance(으)로부터 상속된 정적 Protected 멤버 함수
static instancer_getMgr ()
 
- by::slot(으)로부터 상속된 Protected 속성
tstr< obj_pak
 

상세한 설명

Automatic pack loading slot

Inherits from slot, so see the slot class first if unfamiliar with it.

The byeol language lazily and dynamically loads packs. autoslot implements this feature. When slotLoader finds a pack file, it creates appropriate packLoading objects and places them in autoslot. Later, when accessing autoslot to retrieve contained symbols, packLoading operates lazily to load symbols from the file.

See slotLoader and packLoading for details.

Multiple packLoadings

packLoading can be retrieved from the native environment (dll or so files) or from the byeol runtime environment (.byeol files). Or both may exist in a single pack. Therefore, autoslot doesn't hold just one packLoading but handles them as an array.

Dynamic Verification and Dependency Issues

We cannot simply assume all packs are verified and flawless and just load them. Sometimes packs need to be verified again to ensure correctness, so some autoslots must parse or verify before loading symbols. The problem is that packs very frequently depend on other packs. If a dependent pack fails verification, that fact must propagate so all dependent packs also become unusable. This is solved by an algorithm controlling the four states described below.

autoslot State

Has four states total with the following loading pipeline flow:

  • slot creation: slotLoader creates slot objects and adds them to the system. At this time, dependencies between slots are also recorded.
  • RELEASED: Initial state, occupies no memory. Most unused slots belong here.
  • PARSED: When autoslot is accessed, code is parsed for actual use. If parsing is unnecessary (optimized pack distribution or native pack), skips directly to LINKED state.
  • VERIFIED: After parsing, code integrity is verified. If verification fails, isValid is set to false.
  • LINKED: If verification failed, propagates that failure to all dependents referencing it.

Recursive Loading

Packs depending on other packs is very common. Because autoslot operates lazily, loading one slot may access another autoslot, causing that autoslot to also recursively enter the loading sequence. This checks for duplicate initialization or incomplete pipeline traversal.

RAII

autoslot points to the _pack object defined in slot. This object contains symbols loaded from the external pack file. Since autoslot is responsible for pack loading through packLoading, it's also responsible for symbol and pack destruction. Using RAII, when the autoslot object is destroyed, all symbols are removed first, then the packLoading object is also removed to perform operations like closing so files. See packLoading for details.

is required to run an autoslot

when you try to load pack by accessing subs() of autoslot instance, it processes loading and access to errReport when exception occurs during that procedure. basically, accessing to subs() of autoslot happen when you eval your AST. which means, you're required to prepare a thread. so autoslot will use the errReport instance in current thread::getEx().

Remarks
this doesn't mean that a thread is needed when running a slotLoader that creates autoslots.

멤버 함수 문서화

◆ _invalidate()

nbool by::autoslot::_invalidate ( )
overrideprotectedvirtual

Protected virtual method to invalidate the slot.

This method is typically called internally to mark the slot as invalid, making it unusable for further operations.

반환값
true if the slot was successfully invalidated, false otherwise.

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

◆ getPack()

obj & by::autoslot::getPack ( )
overridevirtual

Retrieves the top-level object (obj) of this pack.

반환값
A reference to the pack's obj.

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

◆ getState()

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

by::statable를 구현.

◆ rel()

void by::autoslot::rel ( )
overridevirtual

Release all held resources and prepare for termination.

Remarks
Some classes won't be able to reinitialize after rel() is called.

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

◆ setState()

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

by::statable를 구현.


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