9 #include "plotsconfig.h"
61 inline T *
ptr() {
return _ptr; }
65 inline const T *
ptr()
const {
return _ptr; }
85 inline operator bool()
const {
return _ptr !=
nullptr; }
89 inline bool operator!()
const {
return _ptr ==
nullptr; }
118 void reference(T *ptr);
148 reference(other._ptr);
154 reference(other._ptr);
155 other._ptr =
nullptr;
171 _ptr->decReference();
181 reference(other._ptr);
206 inline void RefCountPtr<T>::reference(T *ptr)
211 _ptr->addReference();
216 #endif // REFCOUNTPTR_H_
const T * ptr() const
Access the internal pointer.
Definition: refcountptr.h:65
A pointer wrapper for a reference counted object such as RefCountObject.
Definition: refcountptr.h:24
bool operator!() const
Negation operator.
Definition: refcountptr.h:89
RefCountPtr()
Default constructor to a null pointer.
Definition: refcountptr.h:124
void release()
Explicitly releases the internal pointer, making this object null.
Definition: refcountptr.h:167
RefCountPtr & operator=(const RefCountPtr &other)
Assignment operator.
Definition: refcountptr.h:178
T * operator->()
Dereference call operator.
Definition: refcountptr.h:77
bool operator!=(const RefCountPtr &other)
Inequality operator.
Definition: refcountptr.h:99
T & operator*()
Dereference operator.
Definition: refcountptr.h:69
T * ptr()
Access the internal pointer.
Definition: refcountptr.h:61
~RefCountPtr()
Destructor: calls release().
Definition: refcountptr.h:160
Utility functions for sampling and filtering plots and expression evaluation.
Definition: plotutil.h:13
bool operator==(const RefCountPtr &other)
Equality operator.
Definition: refcountptr.h:94