로딩중...
검색중...
일치하는것 없음
life.hpp
이 파일의 문서화 페이지로 가기
1
2#pragma once
3
6
7namespace by {
8
9 class chunk;
10
21 class _nout life: public typeProvidable, public tbindable<instance> {
22 BY(ADT(life))
23
24 public:
25 // life:
26 life();
27 explicit life(id newId);
28 ~life();
29
30 public:
31 instance* operator->();
32 instance& operator*();
33 const instance* operator->() const BY_CONST_FUNC(operator->())
34 const instance& operator*() const BY_CONST_FUNC(operator*())
35
36 public:
41 const chunk* getChunk() const;
42
48
49 // tbindable:
55 void rel() override;
56 nbool isBind() const override;
57 const type& getBindable() const;
58
59 instance* get();
60 const instance* get() const BY_CONST_FUNC(get())
61
62 template <typename E> E* get() { return get() TO(template cast<E>()); }
63 template <typename E> const E* get() const BY_CONST_FUNC(get<E>())
64
65 using tbindable<instance>::canBind;
66 nbool canBind(const type& cls) const override;
67
69
76
77 // Instance:
78 id getId() const;
79
85 static const life* getBindTag(id newId);
86
93 nbool onStrong(ncnt vote);
94
95 private:
96 // life:
97
103 nbool _completeId(instance& it);
104
110 nbool _sync(id new1);
111
112 private:
113 instance* _pt;
114 ncnt _strong;
115 id _id;
116 };
117} // namespace by
Memory chunk for block-based allocation
Definition chunk.hpp:57
Base class for all managed instances in memlite system
Definition instance.hpp:41
Binding tag for instance reference tracking and lifecycle management
Definition life.hpp:21
void rel() override
Releases the binding for this life object, decrementing the strong reference count.
ncnt getStrongCnt() const
Returns current strong reference count
Template interface for bindable objects
Definition tbindable.hpp:13
Weak reference smart pointer with type-safe access
Definition tweak.hpp:16
Core class for runtime type information in byeol language
Definition type.hpp:100
Interface for objects that can provide their type information
Definition typeProvidable.hpp:13
#define TO(fn)
Definition to.hpp:175
to Top