15 if (ret == 0) PFC_ASSERT_NO_EXCEPTION(
delete this );
24 template<
typename t_
object>
32 template<
typename t_
object>
41 rcptr_t(
const t_self & p_source)
throw() {__init(p_source);}
42 t_self
const &
operator=(
const t_self & p_source)
throw() {__copy(p_source);
return *
this;}
44 template<
typename t_source>
46 template<
typename t_source>
49 rcptr_t(t_self && p_source) throw() {_move(p_source);}
50 const t_self &
operator=(t_self && p_source) throw() {
release(); _move(p_source);
return *
this;}
62 template<
typename t_other>
64 return m_container == p_other.__container();
67 template<
typename t_other>
69 return m_container != p_other.__container();
74 if (p_container != NULL) p_container->add_ref();
76 m_container = p_container;
80 bool is_valid()
const throw() {
return m_container != NULL;}
81 bool is_empty()
const throw() {
return m_container == NULL;}
87 t_container * temp = m_container;
90 if (temp != NULL) temp->
release();
94 template<
typename t_
object_cast>
97 if (is_valid()) temp.
__set_from_cast(this->m_container,static_cast<t_object_cast*>(this->m_ptr));
102 on_new(
new t_container_impl());
105 template<
typename t_param1>
106 void new_t(t_param1
const & p_param1) {
107 on_new(
new t_container_impl(p_param1));
110 template<
typename t_param1,
typename t_param2>
111 void new_t(t_param1
const & p_param1, t_param2
const & p_param2) {
112 on_new(
new t_container_impl(p_param1,p_param2));
115 template<
typename t_param1,
typename t_param2,
typename t_param3>
116 void new_t(t_param1
const & p_param1, t_param2
const & p_param2,t_param3
const & p_param3) {
117 on_new(
new t_container_impl(p_param1,p_param2,p_param3));
120 template<
typename t_param1,
typename t_param2,
typename t_param3,
typename t_param4>
121 void new_t(t_param1
const & p_param1, t_param2
const & p_param2,t_param3
const & p_param3,t_param4
const & p_param4) {
122 on_new(
new t_container_impl(p_param1,p_param2,p_param3,p_param4));
125 template<
typename t_param1,
typename t_param2,
typename t_param3,
typename t_param4,
typename t_param5>
126 void new_t(t_param1
const & p_param1, t_param2
const & p_param2,t_param3
const & p_param3,t_param4
const & p_param4,t_param5
const & p_param5) {
127 on_new(
new t_container_impl(p_param1,p_param2,p_param3,p_param4,p_param5));
130 template<
typename t_param1,
typename t_param2,
typename t_param3,
typename t_param4,
typename t_param5,
typename t_param6>
131 void new_t(t_param1
const & p_param1, t_param2
const & p_param2,t_param3
const & p_param3,t_param4
const & p_param4,t_param5
const & p_param5,t_param6
const & p_param6) {
132 on_new(
new t_container_impl(p_param1,p_param2,p_param3,p_param4,p_param5,p_param6));
141 template<
typename t_param1>
142 static t_self
g_new_t(t_param1
const & p_param1) {
144 temp.
new_t(p_param1);
148 template<
typename t_param1,
typename t_param2>
149 static t_self
g_new_t(t_param1
const & p_param1,t_param2
const & p_param2) {
151 temp.
new_t(p_param1,p_param2);
155 template<
typename t_param1,
typename t_param2,
typename t_param3>
156 static t_self
g_new_t(t_param1
const & p_param1,t_param2
const & p_param2,t_param3
const & p_param3) {
158 temp.
new_t(p_param1,p_param2,p_param3);
162 template<
typename t_param1,
typename t_param2,
typename t_param3,
typename t_param4>
163 static t_self
g_new_t(t_param1
const & p_param1,t_param2
const & p_param2,t_param3
const & p_param3,t_param4
const & p_param4) {
165 temp.
new_t(p_param1,p_param2,p_param3,p_param4);
169 template<
typename t_param1,
typename t_param2,
typename t_param3,
typename t_param4,
typename t_param5>
170 static t_self
g_new_t(t_param1
const & p_param1,t_param2
const & p_param2,t_param3
const & p_param3,t_param4
const & p_param4,t_param5
const & p_param5) {
172 temp.
new_t(p_param1,p_param2,p_param3,p_param4,p_param5);
176 t_object &
operator*()
const throw() {
return *this->m_ptr;}
184 void _clear() throw() {m_container = NULL; m_ptr = NULL;}
187 template<
typename t_source>
189 m_container = p_source.__container();
191 if (m_container != NULL) m_container->add_ref();
193 template<
typename t_source>
195 m_container = p_source.__container();
199 template<
typename t_source>
201 __set_from_cast(p_source.__container(),&*p_source);
203 void on_new(t_container_impl * p_container)
throw() {
205 p_container->add_ref();
206 this->m_ptr = &p_container->m_object;
207 this->m_container = p_container;
214 template<
typename t_
object>
221 template<
typename t_
object,
typename t_param1>
224 temp.
new_t(p_param1);
228 template<
typename t_
object,
typename t_param1,
typename t_param2>
231 temp.
new_t(p_param1,p_param2);
235 template<
typename t_
object,
typename t_param1,
typename t_param2,
typename t_param3>
238 temp.
new_t(p_param1,p_param2,p_param3);
242 template<
typename t_
object,
typename t_param1,
typename t_param2,
typename t_param3,
typename t_param4>
243 rcptr_t<t_object> rcnew_t(t_param1
const & p_param1,t_param2
const & p_param2,t_param3
const & p_param3,t_param4
const & p_param4) {
245 temp.
new_t(p_param1,p_param2,p_param3,p_param4);
249 template<
typename t_
object,
typename t_param1,
typename t_param2,
typename t_param3,
typename t_param4,
typename t_param5>
250 rcptr_t<t_object> rcnew_t(t_param1
const & p_param1,t_param2
const & p_param2,t_param3
const & p_param3,t_param4
const & p_param4,t_param5
const & p_param5) {
252 temp.
new_t(p_param1,p_param2,p_param3,p_param4,p_param5);
256 template<
typename t_
object,
typename t_param1,
typename t_param2,
typename t_param3,
typename t_param4,
typename t_param5,
typename t_param6>
257 rcptr_t<t_object> rcnew_t(t_param1
const & p_param1,t_param2
const & p_param2,t_param3
const & p_param3,t_param4
const & p_param4,t_param5
const & p_param5,t_param6
const & p_param6) {
259 temp.
new_t(p_param1,p_param2,p_param3,p_param4,p_param5,p_param6);
265 enum { realloc_safe =
true, constructor_may_fail =
false };
t_self const & operator=(const t_self &p_source)
const t_self & operator=(t_self &&p_source)
const t_self & operator=(const rcptr_t< t_source > &p_source)
rc_container_base t_container
void _move(rcptr_t< t_source > &p_source)
static t_self g_new_t(t_param1 const &p_param1, t_param2 const &p_param2)
t_container * __container() const
bool operator==(const rcptr_t< t_other > &p_other) const
void new_t(t_param1 const &p_param1, t_param2 const &p_param2, t_param3 const &p_param3, t_param4 const &p_param4, t_param5 const &p_param5, t_param6 const &p_param6)
void new_t(t_param1 const &p_param1, t_param2 const &p_param2)
void new_t(t_param1 const &p_param1, t_param2 const &p_param2, t_param3 const &p_param3, t_param4 const &p_param4)
void new_t(t_param1 const &p_param1, t_param2 const &p_param2, t_param3 const &p_param3)
rcptr_t(const t_self &p_source)
rcptr_t< t_object_cast > static_cast_t() const
rc_container_t< t_object > t_container_impl
rcptr_t< t_object > rcnew_t()
rcptr_t< t_object > t_self
static t_self g_new_t(t_param1 const &p_param1, t_param2 const &p_param2, t_param3 const &p_param3, t_param4 const &p_param4, t_param5 const &p_param5)
rcptr_t(const rcptr_t< t_source > &p_source)
void new_t(t_param1 const &p_param1, t_param2 const &p_param2, t_param3 const &p_param3, t_param4 const &p_param4, t_param5 const &p_param5)
void __copy(const rcptr_t< t_source > &p_source)
void on_new(t_container_impl *p_container)
t_object * operator->() const
static t_self g_new_t(t_param1 const &p_param1, t_param2 const &p_param2, t_param3 const &p_param3, t_param4 const &p_param4)
void __init(const rcptr_t< t_source > &p_source)
_rcptr_null * t_rcptr_null
static const t_rcptr_null rcptr_null
const t_self & operator=(t_rcptr_null)
void __set_from_cast(t_container *p_container, t_object *p_ptr)
virtual ~rc_container_base()
bool operator!=(const rcptr_t< t_other > &p_other) const
t_container * m_container
t_object & operator*() const
static t_self g_new_t(t_param1 const &p_param1)
void new_t(t_param1 const &p_param1)
rcptr_t(t_self &&p_source)
static t_self g_new_t(t_param1 const &p_param1, t_param2 const &p_param2, t_param3 const &p_param3)