template<typename T>
class eprosima::fastrtps::RefCountedPointer< T >
Class to manage a local pointer with reference counting.
It is similar to std::shared_ptr, but designed for cases where a shared pointer cannot be used due to API restrictions.
USAGE:
- On T class:
- Add a shared_ptr<RefCountedPointer<T>> local_ptr_ member.
- Call local_ptr_->deactivate() before destroying T.
- On classes that need to use a pointer to T:
- Keep a copy of the shared_ptr<RefCountedPointer<T>>.
- Whenever you need to access T: RefCountedPointer<T>::Instance instance(local_ptr_) if (instance) { ptr->method(); }