97 void operator delete(
void*) =
delete;
101 friend class Ptr<const T>;
114 template <
typename U>
127 template <
typename U>
168 template <
typename U>
216 operator Tester*() const;
263 explicit operator
bool() const;
282 template <typename T, typename... Ts>
295 template <typename T>
296 std::ostream& operator<<(std::ostream& os, const
Ptr<T>& p);
319 template <typename T1, typename T2>
320 bool operator==(const
Ptr<T1>& lhs, T2 const* rhs);
322 template <typename T1, typename T2>
323 bool operator==(T1 const* lhs,
Ptr<T2>& rhs);
325 template <typename T1, typename T2>
326 bool operator==(const
Ptr<T1>& lhs, const
Ptr<T2>& rhs);
334 template <typename T1, typename T2>
335 typename std::enable_if<std::is_same<T2, std::nullptr_t>::
value,
bool>::
type operator==(
360 template <typename T1, typename T2>
361 bool operator!=(const
Ptr<T1>& lhs, T2 const* rhs);
363 template <typename T1, typename T2>
364 bool operator!=(T1 const* lhs,
Ptr<T2>& rhs);
366 template <typename T1, typename T2>
367 bool operator!=(const
Ptr<T1>& lhs, const
Ptr<T2>& rhs);
375 template <typename T1, typename T2>
376 typename std::enable_if<std::is_same<T2, std::nullptr_t>::
value,
bool>::
type operator!=(
390 template <typename T>
391 bool operator<(const
Ptr<T>& lhs, const
Ptr<T>& rhs);
392 template <typename T>
393 bool operator<(const
Ptr<T>& lhs, const
Ptr<const T>& rhs);
394 template <typename T>
395 bool operator<(const
Ptr<const T>& lhs, const
Ptr<T>& rhs);
396 template <typename T>
397 bool operator<=(const
Ptr<T>& lhs, const
Ptr<T>& rhs);
398 template <typename T>
399 bool operator>(const
Ptr<T>& lhs, const
Ptr<T>& rhs);
400 template <typename T>
401 bool operator>=(const
Ptr<T>& lhs, const
Ptr<T>& rhs);
413 template <typename T1, typename T2>
417 template <typename T>
430 template <typename T>
446 template <
typename T>
447 struct EventMemberImplObjTraits;
457 template <
typename T>
479 template <
typename T,
typename... Ts>
483 return Ptr<T>(
new T(std::forward<Ts>(
args)...),
false);
486 template <
typename U>
493 template <
typename U>
501 template <
typename T>
509 template <
typename T1,
typename T2>
516 template <
typename T1,
typename T2>
523 template <
typename T1,
typename T2>
530 template <
typename T1,
typename T2>
537 template <
typename T1,
typename T2>
544 template <
typename T1,
typename T2>
551 template <
typename T1,
typename T2>
558 template <
typename T1,
typename T2>
565 template <
typename T>
569 return PeekPointer<T>(lhs) < PeekPointer<T>(rhs);
572 template <
typename T>
576 return PeekPointer<T>(lhs) < PeekPointer<const T>(rhs);
579 template <
typename T>
583 return PeekPointer<const T>(lhs) < PeekPointer<T>(rhs);
586 template <
typename T>
590 return PeekPointer<T>(lhs) <= PeekPointer<T>(rhs);
593 template <
typename T>
597 return PeekPointer<T>(lhs) > PeekPointer<T>(rhs);
600 template <
typename T>
604 return PeekPointer<T>(lhs) >= PeekPointer<T>(rhs);
616 template <
typename T1,
typename T2>
623 template <
typename T1,
typename T2>
630 template <
typename T1,
typename T2>
647 template <
typename T>
655 template <
typename T>
657 Copy(Ptr<const T>
object)
659 Ptr<T> p = Ptr<T>(
new T(*
PeekPointer(
object)),
false);
669 template <
typename T>
673 if (m_ptr !=
nullptr)
679 template <
typename T>
685 template <
typename T>
692 template <
typename T>
702 template <
typename T>
714 template <
typename T>
715 template <
typename U>
722 template <
typename T>
725 if (m_ptr !=
nullptr)
731 template <
typename T>
739 if (m_ptr !=
nullptr)
748 template <
typename T>
752 NS_ASSERT_MSG(m_ptr,
"Attempted to dereference zero pointer");
756 template <
typename T>
760 NS_ASSERT_MSG(m_ptr,
"Attempted to dereference zero pointer");
764 template <
typename T>
768 NS_ASSERT_MSG(m_ptr,
"Attempted to dereference zero pointer");
772 template <
typename T>
776 NS_ASSERT_MSG(m_ptr,
"Attempted to dereference zero pointer");
780 template <
typename T>
791 template <
typename T>
794 return m_ptr !=
nullptr;
817 struct std::hash<
ns3::Ptr<T>>
NS_ASSERT() and NS_ASSERT_MSG() macro definitions.
Helper to test for null pointer.
Smart pointer class similar to boost::intrusive_ptr.
Ptr(T *ptr)
Create a smart pointer which points to the object pointed to by the input raw pointer ptr.
friend U * GetPointer(const Ptr< U > &p)
Get a permanent pointer to the underlying object.
Ptr(const Ptr &o)
Copy by referencing the same underlying object.
T & operator*()
A dereference.
Ptr()
Create an empty smart pointer.
void Acquire() const
Mark this as a a reference by incrementing the reference count.
Ptr(const Ptr< U > &o)
Copy, removing const qualifier.
T * operator->()
An lvalue member access.
friend U * PeekPointer(const Ptr< U > &p)
Get a temporary pointer to the underlying object.
T & operator*() const
A const dereference.
Ptr< T > & operator=(const Ptr &o)
Assignment operator by referencing the same underlying object.
Ptr(T *ptr, bool ref)
Create a smart pointer which points to the object pointed to by the input raw pointer ptr.
T * operator->() const
An rvalue member access.
NS_DEPRECATED macro definition.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_DEPRECATED_3_37(msg)
Tag for things deprecated in version ns-3.37.
bool operator>=(const int64x64_t &lhs, const int64x64_t &rhs)
Greater or equal operator.
bool operator<=(const int64x64_t &lhs, const int64x64_t &rhs)
Less or equal operator.
bool operator>(const Length &left, const Length &right)
Check if left has a value greater than right.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool operator!=(Callback< R, Args... > a, Callback< R, Args... > b)
Inequality test.
bool operator==(const EventId &a, const EventId &b)
Ptr< T1 > StaticCast(const Ptr< T2 > &p)
Cast a Ptr.
bool operator<(const EventId &a, const EventId &b)
Ptr< T1 > const_pointer_cast(const Ptr< T2 > &p)
Return a copy of p with its stored pointer const casted from T2 to T1.
Ptr< T1 > ConstCast(const Ptr< T2 > &p)
Cast a Ptr.
U * GetPointer(const Ptr< U > &p)
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
std::ostream & operator<<(std::ostream &os, const Angles &a)
U * PeekPointer(const Ptr< U > &p)
Ptr< T > Copy(Ptr< T > object)
Return a deep copy of a Ptr.
static T & GetReference(const Ptr< T > p)
static T & GetReference(Ptr< T > p)
Helper for the MakeEvent functions which take a class method.
std::size_t operator()(ns3::Ptr< T > p) const
The functor.