17 #ifndef AGX_OBSERVER_PTR 18 #define AGX_OBSERVER_PTR 32 virtual ~Observer() {}
33 virtual void objectDeleted(
void*) {}
84 virtual void objectDeleted(
void*);
102 template <
typename U>
106 template <
typename U>
110 template <
typename U>
120 T* operator->()
const;
126 bool operator!()
const;
129 bool isValid()
const;
144 if (m_ptr) m_ptr->addObserver(
this);
150 if (m_ptr) m_ptr->addObserver(
this);
156 if (m_ptr) m_ptr->removeObserver(
this);
164 if (m_ptr == rp.m_ptr)
return *
this;
165 if (m_ptr) m_ptr->removeObserver(
this);
168 if (m_ptr) m_ptr->addObserver(
this);
175 if (m_ptr == ptr)
return *
this;
176 if (m_ptr) m_ptr->removeObserver(
this);
179 if (m_ptr) m_ptr->addObserver(
this);
190 #if 0 // Disable any hashing on observer_pointer, it can only be bad 193 struct HashFn< observer_ptr<T> >
200 typedef const T *PtrT;
216 template <
typename U>
219 return m_ptr == rp.m_ptr;
223 template <
typename U>
226 return m_ptr != rp.m_ptr;
230 template <
typename U>
237 template <
typename U>
244 template <
typename U>
251 template <
typename U>
260 return (m_ptr < rp.m_ptr);
AGXCORE_EXPORT UInt32 hash(const T &key)
Smart pointer for observed objects, that automatically set pointers to them to null when they deleted...
bool operator==(T val, InvalidIndexStruct)
observer_ptr()
Constructor.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
bool operator!=(T val, InvalidIndexStruct)
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
T element_type
The type of the referenced class.
Vec3T< T > operator*(const Vec3T< T > &v, const AffineMatrix4x4T< T > &m)