83 friend class Ptr<const T>;
109 template <
typename U>
150 template <
typename U>
228 explicit operator bool()
const;
247 template <
typename T,
typename... Ts>
260 template <
typename T>
284 template <
typename T1,
typename T2>
287 template <
typename T1,
typename T2>
290 template <
typename T1,
typename T2>
299 template <
typename T1,
typename T2>
300 std::enable_if_t<std::is_same_v<T2, std::nullptr_t>,
bool>
operator==(
const Ptr<T1>& lhs, T2 rhs);
323 template <
typename T1,
typename T2>
326 template <
typename T1,
typename T2>
329 template <
typename T1,
typename T2>
338 template <
typename T1,
typename T2>
339 std::enable_if_t<std::is_same_v<T2, std::nullptr_t>,
bool>
operator!=(
const Ptr<T1>& lhs, T2 rhs);
351 template <
typename T>
353 template <
typename T>
355 template <
typename T>
357 template <
typename T>
359 template <
typename T>
361 template <
typename T>
374 template <
typename T1,
typename T2>
378 template <
typename T>
391 template <
typename T>
407 template <
typename T>
408 struct EventMemberImplObjTraits;
418 template <
typename T>
440 template <
typename T,
typename... Ts>
444 return Ptr<T>(
new T(std::forward<Ts>(
args)...),
false);
447 template <
typename U>
454 template <
typename U>
462 template <
typename T>
470 template <
typename T1,
typename T2>
477 template <
typename T1,
typename T2>
484 template <
typename T1,
typename T2>
491 template <
typename T1,
typename T2>
498 template <
typename T1,
typename T2>
505 template <
typename T1,
typename T2>
512 template <
typename T1,
typename T2>
513 std::enable_if_t<std::is_same_v<T2, std::nullptr_t>,
bool>
519 template <
typename T1,
typename T2>
520 std::enable_if_t<std::is_same_v<T2, std::nullptr_t>,
bool>
526 template <
typename T>
530 return PeekPointer<T>(lhs) < PeekPointer<T>(rhs);
533 template <
typename T>
537 return PeekPointer<T>(lhs) < PeekPointer<const T>(rhs);
540 template <
typename T>
544 return PeekPointer<const T>(lhs) < PeekPointer<T>(rhs);
547 template <
typename T>
551 return PeekPointer<T>(lhs) <= PeekPointer<T>(rhs);
554 template <
typename T>
558 return PeekPointer<T>(lhs) > PeekPointer<T>(rhs);
561 template <
typename T>
565 return PeekPointer<T>(lhs) >= PeekPointer<T>(rhs);
577 template <
typename T1,
typename T2>
584 template <
typename T1,
typename T2>
591 template <
typename T1,
typename T2>
608 template <
typename T>
616 template <
typename T>
618 Copy(Ptr<const T>
object)
620 Ptr<T> p = Ptr<T>(
new T(*
PeekPointer(
object)),
false);
630 template <
typename T>
634 if (m_ptr !=
nullptr)
640 template <
typename T>
646 template <
typename T>
653 template <
typename T>
663 template <
typename T>
675 template <
typename T>
676 template <
typename U>
683 template <
typename T>
686 if (m_ptr !=
nullptr)
692 template <
typename T>
700 if (m_ptr !=
nullptr)
709 template <
typename T>
713 NS_ASSERT_MSG(m_ptr,
"Attempted to dereference zero pointer");
717 template <
typename T>
721 NS_ASSERT_MSG(m_ptr,
"Attempted to dereference zero pointer");
725 template <
typename T>
729 NS_ASSERT_MSG(m_ptr,
"Attempted to dereference zero pointer");
733 template <
typename T>
737 NS_ASSERT_MSG(m_ptr,
"Attempted to dereference zero pointer");
741 template <
typename T>
744 return m_ptr !=
nullptr;
NS_ASSERT() and NS_ASSERT_MSG() macro definitions.
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.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
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.
std::size_t hash(const BasicJsonType &j)
hash a JSON value
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.