Lines Matching refs:sptr

263     std::atomic<int> atomicStrong_; // = (num of sptr) or Initial-value
264 std::atomic<int> atomicWeak_; // = (num of sptr)+(num of WeakRefCounter)
352 * the corresponding RefBase object (to promote a wptr to a sptr).
529 * @note Use this function in the copy constructor of sptr in scenario of
530 * interaction between sptr and wptr. Avoid using it independently.
617 * @tparam T Specific class type managed by sptr.
621 class sptr {
625 sptr();
627 ~sptr();
630 * @brief Create a new object with class type (T) and provide a new sptr to manage it.
632 * @note We strongly recommend using `sptr::MakeSptr` to create a object and manage it.
635 * @return A sptr which manage a new object with class type (T).
636 * @param args Constructor parameters of the new object to be managed by sptr.
639 static inline sptr<T> MakeSptr(Args&&... args);
643 * And We do not recommend using this interface to create an sptr object.
644 * Using the interface `sptr::MakeSptr` is better
646 * @note A null sptr will be created if `other` is `nullptr`.
647 * @param other Object to be managed by sptr.
649 sptr(T *other);
652 * @brief Copy constructor for sptr with the managed class type (T).
654 * @param other Input sptr object.
656 sptr(const sptr<T> &other);
661 * @note `other` will be set to a null sptr.
662 * @param other Input sptr object.
664 sptr(sptr<T> &&other);
669 * @param other Input sptr object.
670 * @note The original strong reference in target sptr object will
673 sptr<T> &operator=(sptr<T> &&other);
676 * @brief Copy Constructor for sptr with the managed class type (O).
679 * @param other Input sptr object.
682 sptr(const sptr<O> &other);
691 inline sptr(WeakRefCounter *p, bool force);
706 * @param other Another pointer object to be managed by sptr.
713 * @brief Removes the reference to the managed object held by current sptr.
715 * @note This function will make this sptr a "null sptr".
723 * @note The sptr object will not be converted. Only the member raw
744 * This function will return the object managed by this sptr.
746 * @return Reference to the specific object managed by sptr.
757 * managed by this sptr.
766 * And We do not recommend using this interface to create an sptr object.
767 * Using the interface `sptr::MakeSptr` is better.
771 * @param other Another object to be managed by this sptr.
773 sptr<T> &operator=(T *other);
776 * @brief Copy assignment operator for sptr with
780 * with the input sptr object will be managed by this sptr.
781 * @param other Another sptr object with the same managed class type (T).
783 sptr<T> &operator=(const sptr<T> &other);
790 * with the input wptr object will be managed by this sptr.
791 * @note If the operation fails, this sptr will turn to be a "null sptr".
794 sptr<T> &operator=(const wptr<T> &other);
797 * @brief Copy assignment operator for sptr with
801 * with the input sptr object will be managed by this sptr.
802 * @note This sptr will interpret the managed object as the type (T).
803 * @param other Another sptr object with a different managed class type (O).
806 sptr<T> &operator=(const sptr<O> &other);
809 * @brief Equal-to operator between the sptr and raw pointer.
812 * @return `true` if the sptr points to the same object with input
818 * @brief Not-equal-to operator between the sptr and raw pointer.
821 * @return `true` if the sptr does not point to the same object
830 * @brief Equal-to operator between the sptr and wptr.
833 * @return `true` if the same object is managed by the sptr and wptr;
839 * @brief Not-equal-to operator between the sptr and wptr.
842 * @return `true` if different objects are managed by the sptr and wptr;
853 * @param other Input sptr.
857 bool operator==(const sptr<T> &other) const;
862 * @param other Input sptr.
866 inline bool operator!=(const sptr<T> &other) const
877 sptr<T> sptr<T>::MakeSptr(Args&&... args)
880 sptr<T> res;
887 inline void sptr<T>::ForceSetRefPtr(T *other)
893 inline sptr<T>::sptr()
899 inline sptr<T>::sptr(T *other)
908 inline sptr<T>::sptr(const sptr<T> &other)
917 sptr<T>::sptr(sptr<T> &&other)
924 sptr<T> &sptr<T>::operator=(sptr<T> &&other)
936 sptr<T>::sptr(const sptr<O> &other) : refs_(other.GetRefPtr())
944 inline sptr<T> &sptr<T>::operator=(T *other)
959 inline sptr<T> &sptr<T>::operator=(const sptr<T> &other)
975 inline sptr<T> &sptr<T>::operator=(const wptr<T> &other)
991 sptr<T> &sptr<T>::operator=(const sptr<O> &other)
1007 inline bool sptr<T>::operator==(const T *other) const
1013 inline bool sptr<T>::operator==(const wptr<T> &other) const
1019 inline bool sptr<T>::operator==(const sptr<T> &other) const
1025 void sptr<T>::clear()
1034 inline sptr<T>::~sptr()
1042 inline sptr<T>::sptr(WeakRefCounter *p, bool /* force */)
1094 * @brief Copy constructor for sptr with the same managed class type (T).
1099 * @param other Another sptr with the same managed class type (T).
1102 wptr(const sptr<T> &other);
1117 * @brief Copy constructor for sptr with a different managed class type (O).
1119 * This function is the same as wptr<T>::wptr(const sptr<T> &other).
1121 * @param other Another sptr with the same managed class type (O).
1125 wptr(const sptr<O> &other);
1162 * @brief Copy assignment operator for sptr with the same managed class
1168 * @param other A sptr object. Objects managed by it will also be
1171 wptr<T> &operator=(const sptr<T> &other);
1187 * @brief Copy assignment operator for sptr with a different managed class
1191 * wptr<T> &wptr<T>::operator=(const sptr<T> &).
1193 * @param other An sptr object. Objects managed by it will also be
1198 wptr<T> &operator=(const sptr<O> &other);
1262 * @brief Equal-to operator between the wptr and input sptr object.
1264 * @param other Input reference to an sptr object.
1267 bool operator==(const sptr<T> &other) const;
1270 * @brief Not-equal-to operator between the wptr and input sptr object.
1272 * @param other Input reference to an sptr object.
1275 inline bool operator!=(const sptr<T> &other) const
1315 * @brief Promotes a wptr to an sptr.
1317 * This function will create an sptr object based on the object
1321 * If the promotion fails, a "null sptr" will be returned.
1323 const sptr<T> promote() const;
1366 wptr<T>::wptr(const sptr<T> &other)
1388 wptr<T>::wptr(const sptr<O> &other)
1454 inline wptr<T> &wptr<T>::operator=(const sptr<T> &other)
1490 wptr<T> &wptr<T>::operator=(const sptr<O> &other)
1521 inline bool wptr<T>::operator==(const sptr<T> &other) const
1527 inline const sptr<T> wptr<T>::promote() const
1529 return sptr<T>(refs_, true);