Remove get_root_rcp()
This commit is contained in:
parent
b45e664726
commit
71b4bf14a0
@ -100,9 +100,9 @@ class root
|
|||||||
private:
|
private:
|
||||||
mutable std::atomic<int> ref_count{0};
|
mutable std::atomic<int> ref_count{0};
|
||||||
|
|
||||||
|
protected:
|
||||||
mutable rcp<root> root_rcp;
|
mutable rcp<root> root_rcp;
|
||||||
|
|
||||||
protected:
|
|
||||||
root()
|
root()
|
||||||
{
|
{
|
||||||
root_rcp.init_ptr(this);
|
root_rcp.init_ptr(this);
|
||||||
@ -124,18 +124,12 @@ public:
|
|||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rcp<root> & get_root_rcp()
|
|
||||||
{
|
|
||||||
return root_rcp;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define rcp_managed(classname) \
|
#define rcp_managed(classname) \
|
||||||
rcp<classname> get_rcp() \
|
rcp<classname> get_rcp() \
|
||||||
{ \
|
{ \
|
||||||
root * r = (root *)this; \
|
return rcp<classname>(root_rcp); \
|
||||||
return rcp<classname>(r->get_root_rcp()); \
|
|
||||||
} \
|
} \
|
||||||
template <typename... Args> \
|
template <typename... Args> \
|
||||||
static rcp<classname> create(Args&&... args) \
|
static rcp<classname> create(Args&&... args) \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user