33#if !(defined(AGXJAVA) || defined(AGXPYTHON))
119 template <
typename T,
typename U>
125 template <
typename T,
typename U>
131 template <
typename T,
typename U>
137 template <
typename T,
typename U>
144 template <
typename T>
147 template <
typename T>
150 if (m_ptr) m_ptr->reference(
this);
153 template <
typename T>
156 if (m_ptr) m_ptr->reference(
this);
159 template <
typename T>
162 if (m_ptr) m_ptr->unreference(
this);
166 template <
typename T>
169 if (m_ptr == rp.m_ptr)
return *
this;
172 if (m_ptr) m_ptr->reference(
this);
176 if (tmp_ptr) tmp_ptr->unreference(
this);
180 template <
typename T>
183 if (m_ptr == ptr)
return *
this;
186 if (m_ptr) m_ptr->reference(
this);
190 if (tmp_ptr) tmp_ptr->unreference(
this);
195 template <
typename T>
201 template <
typename T>
template <
typename U>
204 return m_ptr == rp.
get();
207 template <
typename T>
template <
typename U>
210 return m_ptr != rp.
get();
213 template <
typename T>
template <
typename U>
219 template <
typename T>
template <
typename U>
225 template <
typename T>
template <
typename U>
231 template <
typename T>
template <
typename U>
237 template <
typename T>
240 return (m_ptr < rp.m_ptr);
243 template <
typename T>
249 template <
typename T>
255 template <
typename T>
261 template <
typename T>
267 template <
typename T>
273 template <
typename T>
277 if (m_ptr) m_ptr->unreference_nodelete();
282 template <
typename T>
288 template <
typename T>
330 return static_cast<T*
>(rp.
get());
336 return dynamic_cast<T*
>(rp.
get());
342 return const_cast<T*
>(rp.
get());
Smart pointer for handling referenced counted objects.
~ref_ptr()
Destructor, will decrement reference count with one.
ref_ptr(const ref_ptr &rp)
Copy constructor. Will increment reference count with one.
bool operator!=(ref_ptr< U > const &rp) const
T element_type
The type of the referenced class.
ref_ptr & operator=(const ref_ptr &rp)
Assignment operator, will increment reference count.
T * release()
Release the reference (without decrementing) to the referenced object and return a native pointer.
bool operator==(ref_ptr< U > const &rp) const
bool operator<(const ref_ptr &rp) const
void forceClear()
Force the pointer to the referenced object to be null. Without deleting or decrement counters....
void swap(ref_ptr &rp)
Swap rb with this reference without changing reference count.
ref_ptr(T *ptr)
Will take ownership and reference ptr.
T * operator->() const
automatic cast to native pointer and use the dereferencing operator
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
UInt32 hash(const T &key)
ref_ptr< T > dynamic_pointer_cast(const ref_ptr< Y > &rp)
bool operator!=(T val, InvalidIndexStruct)
T * get_pointer(const ref_ptr< T > &rp)
bool operator==(T val, InvalidIndexStruct)
ref_ptr< T > const_pointer_cast(const ref_ptr< Y > &rp)
ref_ptr< T > static_pointer_cast(const ref_ptr< Y > &rp)
void swap(agx::Name &lhs, agx::Name &rhs)
UInt32 operator()(const PtrT key) const
UInt32 operator()(const ref_ptr< T > &key) const
const Type * operator()(agx::ref_ptr< Type > a) const