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

Immutable type binding strategy 더 자세히 ...

#include <immutableTactic.hpp>

by::immutableTactic에 대한 상속 다이어그램 :

Public 멤버 함수

nbool bind (binder &me, const instance &it) override
 

정적 Public 속성

static me singleton
 

상세한 설명

Immutable type binding strategy

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.

However, the part responsible for this shouldn't be objects owning containers like node or obj, but the container classes themselves like tnmap.

From obj's perspective, node is just node, and it shouldn't need to know whether the new node to insert into its owned container 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.

Algorithm

The determination is simply made using the isImmutable() function defined in ntype. Scalar type implementations like nInt and nStr export their types with isImmutable() returning true. This is implemented through the meta module's type extension feature. See type for detailed type extension functionality.

If determined to be an immutable type, clone() is called instead of directly inserting the argument.


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