| 1234567891011121314151617181920 |
- $#include "RenderPath.h"
- $#include "Ptr.h"
- /// Shared pointer template class with intrusive reference counting.
- class SharedPtr
- {
- TOLUA_TEMPLATE_BIND(T, RenderPath)
- public:
- /// Point to the object.
- bool operator < (const SharedPtr<T>& rhs) const { return ptr_ < rhs.ptr_; }
- /// Test for equality with another shared pointer.
- bool operator == (const SharedPtr<T>& rhs) const { return ptr_ == rhs.ptr_; }
-
- /// Check if the pointer is null.
- bool Null() const { return ptr_ == 0; }
- /// Check if the pointer is not null.
- bool NotNull() const { return ptr_ != 0; }
- /// Return the raw pointer.
- T* Get() const { return ptr_; }
- };
|